Own PCB does not start by flash

63 views
Skip to first unread message

Alirio Freire

unread,
Aug 11, 2020, 1:50:24 PM8/11/20
to UMDKv2 Developers
Hello!
Is it possible to share the source code of the programs fpga-test.xsvf and chsum.xsvf?
I made it on a single pcb and ended up changing some pins.
spi flash and sdram test ok, but xc6slx9 in startting from spi-flash (I didn't change these pins) and M0-1 are the same as the original lx9. I load the xsvf using FPGALink.
Also, I didn't use fpga-prod.bin, I built it using the available source code.
Using a ST 25P16, I edited the file flash_chips.cpp to support this memory.
{
"ST",
"M25P16",
ST_ID,
ST_M25P16,
2048, // device size in KiB
256, // page size in bytes
8,
{
{65536, 256} // block size, num blocks
},
spiBlockEraseD8,
spiPageProgram02,
spiRead03,
nullSelector
}

Thank you for sharing this great work . 

Alirio Freire

unread,
Aug 11, 2020, 3:31:13 PM8/11/20
to UMDKv2 Developers
cksum, done!!!
I realized that it is part of the project swled.
Just missing fpga-test.xsvf and find out why it doesn't boot by flash.

Chris McClelland

unread,
Aug 11, 2020, 5:55:58 PM8/11/20
to umdkv...@googlegroups.com
If you download one of the binary distributions linked from the wiki, like (http://tiny.cc/umdk-lx64-20151220), there is a file "README-VHDL" which contains the commands used to build fpga-prod.xsvf and fpga-test.xsvf - they both appear to be build from the same VHDL source code in the UMDKv2 project on GitHub, but with different generics. I can't remember what the difference is though, you'd have to read the VHDL code to figure that out, unfortunately. At a guess the fpga-test.xsvf disables the first-stage bootloader (https://github.com/makestuff/umdkv2/wiki/Internals#flash-boot-process) and keeps the MD in reset until the PC has USB-loaded code for it to execute, so it can only be used in conjunction with a computer, not standalone.

Out of curiosity, is your "merged" PCB still four-layer? How much did it cost to have it manufactured? And which PCB company did you use?

Good luck!

Chris

--
You received this message because you are subscribed to the Google Groups "UMDKv2 Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to umdkv2-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/umdkv2-dev/f4714587-76b9-4c1d-9370-8e226e5bea77n%40googlegroups.com.

Alirio Freire

unread,
Aug 11, 2020, 7:05:59 PM8/11/20
to UMDKv2 Developers
I made one from scratch on easyeda, I made the mistake of doing it with atmega and not cypress usb, yes I know the speed, but I did it for learning, next time I'll go for cypress usb for speed.
A two layer PCB, I made a $ 2 for 5pcb jlcpcb. There was a lot of space left on the pcb and it was very small even though it was only two layers.
Message has been deleted

Alirio Freire

unread,
Aug 11, 2020, 8:52:41 PM8/11/20
to UMDKv2 Developers
Please don't laugh because I used atmega and not cypress.

Understand, the test code is the same as the production code but with other parameters.
Do you have any idea what may be preventing xc6 boot from flash?
And loader.exe run games nicelly, but keep no booting from flash and no running firmware.

Chris McClelland

unread,
Aug 12, 2020, 5:42:53 AM8/12/20
to umdkv...@googlegroups.com
Great job! And the Atmel will be fine for gdb and loading games. The only thing you won't be able to do is use the execution-tracing, because it needs a fair bit of bandwidth.

I can't think of any reason the FPGA won't boot from flash. You've been able to successfully read back and compare-equal the bitfile from the flash using the spi loader?

I suggest making a bitfile which just flashes an LED on a port that is accessible both on your board and my LX9 board, then send me the bitfile and I'll try it on my board. If it works there then we can eliminate some mistake in the process of creating the bitfile, and we can concentrate on the required electrical connections to get the LX9 to boot.

Chris

Alirio Freire

unread,
Aug 12, 2020, 4:29:55 PM8/12/20
to UMDKv2 Developers
My fault, writing wrong file. ><
Now i'm reading forum about umdkv2. my cart load rom from usb loader ok, but when try load menu from flash on start, it freeze on reading sd card.
I see on SpritesMind this is because speed spi/delay code, i'm using a 50MHz clock and startting spi with:
SLOW_COUNT => "111110"
FAST_COUNT =>  "000000"
Tried slow and fast clocks, but keep freezing on reading sd. Ill try a bit more.

You could tell me: 
For implements save, really need a vhdl fat16/32 implements or you see another solution?
Tried run UMK 10MB rom, but black screen after SEGA logo.

Hackers on MD use bus reserved for sega cd and 32x, so: $000000 to $9FFFFF
I still can't compile the menu, I'm doing a build on a vm to try, if you have a cart, can you check if the UMK3 hack really map using the placeholder and not sega mapper solution?

I believe I don't use the sega mapper, because it doesn't work here.

Ah, if you are interested in the pcb I can add you to easyeda, so you gain access.
Message has been deleted

Alirio Freire

unread,
Aug 13, 2020, 10:50:06 PM8/13/20
to UMDKv2 Developers
Today being able to compile the menu on a VM with debia 8, the program crashes in the function fatListDirectory();
asm ><.
the menu never return from this rts, I don't know asm, but thinking about it, it seems like a problem in sp, right?

Chris McClelland

unread,
Aug 14, 2020, 4:11:14 AM8/14/20
to umdkv...@googlegroups.com
Can you show the backtrace (i.e which function is calling this code, and at what line)?

Can you single-step through the code to see which UMDK function is hanging?

> if you have a cart, can you check if the UMK3 hack really map using the placeholder and not sega mapper solution?
>
Sorry, I don't understand what you mean. What is the UMK3 hack?

Chris

Alirio Freire

unread,
Aug 14, 2020, 3:30:29 PM8/14/20
to UMDKv2 Developers
UMK3 hacker, is a project where all Mortal Kombat players are in one game calling UMK3 hack
This rom got 10MB without map, abusing the Mega drive bus reserved address to 32X and Sega CD. $00.0000 to $9F.FFFF.

About menu, after main.c call (fat32.c)fatListDirectory, on first sdReadBlocks freeze executing.
follow backtrace and registers: https://imgur.com/EmpSq9w


Thanks for help, and sorry for take you time!

Chris McClelland

unread,
Aug 14, 2020, 3:48:45 PM8/14/20
to umdkv...@googlegroups.com
Are you running the release build of the menu program (the one generated by rel.sh)? You will have more luck debugging the debug build (i.e run dbg.sh instead of rel.sh).

Alirio Freire

unread,
Aug 21, 2020, 12:29:14 AM8/21/20
to UMDKv2 Developers
Hello Chris!

Solved the sd init.
I am now trying to run the 10MB UMK3.
If i move the prog menu up at +15MB(top close to monitor), could it work? If so, could you help me change the script to allow writing anywhere while on the menu? in the current model
- Only actually write to the 0x400000-0x7FFFFF range -
I do some changers to run,. the game UMK3
BankType to 32 
and when startting reading OE_sync=0
commented
--elsif ( mdAddr_sync(22) = '0' ) 

add
elsif ( mdAddr_sync(22 downto 19) < "1010" )   -- $0 to $9F.FFFF

The game run, but sometimes freeze. My vhdl skills need to improve a lot to make significant changes to this code.

One last thing, even with reset_init at 0 the MD does not start, only if I use loader -x 1.
the signal is correct, the fpga is at 0v reset pin and the cart reset pin has 5v on the other side of the coletor. It seems that something in fpga is not starting. I don't know, I'm very new to VHDL.

Today, I finished the new card with fx2 and a fram, this will help keep the save without writing too much vhdl code, so I don't need to back up the sdram on the sdcard at run time.

Alirio Freire

unread,
Aug 24, 2020, 8:31:15 PM8/24/20
to UMDKv2 Developers
Being able to make the changes I wanted, but I still haven't figured out why black screen when I turn on the MD. Only after a soft reset.
loader -x 2
Maybe this is wrong?
INIT_COUNT     => "1" & x"2C0",  --\
REFRESH_DELAY  => "0" & x"300",  -- Much longer in real hardware!
REFRESH_LENGTH => "0" & x"002"   --/

Found this at release from 20151220.
Reply all
Reply to author
Forward
0 new messages