sipeed / Tang-Nano-Doc

Document for Tang Nano FPGA board
Apache License 2.0
56 stars 12 forks source link

Not flashing device #8

Open NicolaGiardino opened 3 years ago

NicolaGiardino commented 3 years ago

I tried flashing the example led project on my tang nano's SRAM. It worked. Then I flashed it using embFlash, and it stopped working, now I get this output

:
Info:   "embFlash Erase,Program" starting on device-1...
Warn:   Unknown Cable
Warn:   Unknown Cable
Info:   Status Code: 0x00019020
Error:  Finished, NOT wakes up
Info:   User Code: 0x00000000
Info:   Finished!
Info:   Cost 5.27 second(s)
:    
peterkrull commented 3 years ago

Just got my two Tang Nanos yesterday and also tried the embFlash on one of them only for it to lock up and give this output. I assume flasing the embFlash would be the way to store the program in non-volatile memory. The documentation is not very helpful on this matter, so let me know if you find a solution.

NicolaGiardino commented 3 years ago

Yes, that's what it means. The problem is that it always fails to program the onboard flash, it only works to flash the SRAM

towoe commented 3 years ago

Hi, I have the same problem, but with a different status code. I am able to program the SRAM but not the flash.

 "embFlash Erase,Program" starting on device-1...
 Unknown Cable
 Unknown Cable
Programming...: [#########################] 100%
 Status Code: 0x00015421

Error: Finished, NOT wakes up
 User Code: 0x00000000
 Finished!
 Cost 10.61 second(s)

Using openFPGALoader I get some description for the status code:

displayReadReg 00015421
        CRC Error
        Memory Erase
        Non-jtag is active
        Gowin VLD
        Security Final
        POR

And after the erroneous flash programming, the device will mostly refuse to work. Not sure how, but at some point, after a few attempts to program the SRAM it reset the status code to a friendly:

Status Code: 0x0001F020
AntonioDrusin commented 2 years ago

I am not sure if this was just a fluke or if it works this way. Using the programmer that comes with Gowin 1.9.8 I was able to setup the cable to 15MHz (from a default of 2MHz). That made programming the flash work (I tried three different projects and they all stuck). I tried 2.5MHz like I saw mentioned in another post, but that was unsuccessful. Maybe the data needs to come in at a certain rate so it is always ready for the flash programmer?

AntonioDrusin commented 2 years ago

A link to the post that mentioned trying 2.5Mhz cable speed https://lirc572.com/2019/12/23/sipeed-tang-nano-development-environment-setup/