gregdavill / foboot

Bootloader for Fomu
Other
39 stars 11 forks source link

Failing to flash bitstream with ecpprog #9

Open francis2tm opened 1 year ago

francis2tm commented 1 year ago

Hello, I'm trying to flash the r2.0 bootloader foboot-v3.0-orangecrab-r0.2-25F.bit into my orangecrab with ecpprog (latest commit).

However, the verification always fails at byte 4096, I tried many times and the result is the same:

$ ecpprog ../foboot-v3.0-orangecrab-r0.2-25F.bit
init..
IDCODE: 0x41111043 (LFE5U-25)
ECP5 Status Register: 0x06400000
reset..
flash ID: 0x00 0x00 0x00
file size: 266307
erase 64kB sector at 0x000000..
erase 64kB sector at 0x010000..
erase 64kB sector at 0x020000..
erase 64kB sector at 0x030000..
erase 64kB sector at 0x040000..
programming..  266307/266307
verify..       4096/266307Found difference between flash and file!
ABORT.

Any ideas why this is happening?

francis2tm commented 1 year ago

Update: I renamed the bitstream file and:

init..
IDCODE: 0x41111043 (LFE5U-25)
ECP5 Status Register: 0x06400000
reset..
flash ID: 0xEF 0x40 0x18
file size: 266307
erase 64kB sector at 0x000000..
erase 64kB sector at 0x010000..
erase 64kB sector at 0x020000..
erase 64kB sector at 0x030000..
erase 64kB sector at 0x040000..
programming..  266307/266307
verify..       266307/266307  VERIFY OK
Bye.

But now the orangecrab has its LED blinking with red light. I cannot connect it via litex terminal and I also cannot upload another gateware via DFU.

gregdavill commented 1 year ago

It appears like the first time you were programing it, the FLASH wasn't detected correctly...

flash ID: 0x00 0x00 0x00

But I'm not sure why that might have been the case...

Once the bootloader is loaded, If you hold down the button while plugging it in the DFU device should enumerate.

francis2tm commented 1 year ago

Makes sense, thanks for the reply ;) And the red bliking, what does it mean?