Nios2 - Cannot write the OnChip-Flash - Timeout error
Hi there,
I have the following configuration:
- MAX 10 FPGA (Compact)
- NIOS2/e with OnChip Flash Intel
Firstly, I set the reset vector memory an "on chip memory RAM" for the NIOS2/e and program it over Eclipse:
- I tried to write the flash
alt_onchip_flash_write_block (&onchip_flash_0, 0, parameters[0], parameters[1], 1);
and after several seconds got the error: 0x8c from the function. This looks like the "#define ETIMEDOUT 116 /* Connection timed out */" in the alt_onchip_flash_poll_for_status_to_go_idle.
The functions returs -ETIMEDOUT (minus) that is why 0x8c
- After this error I tried to read the flash:
alt_onchip_flash_read(&onchip_flash_0, parameters[0], out, parameters[1]);
Successful
- Try again to write it:
alt_onchip_flash_write_block (&onchip_flash_0, 0, parameters[0], parameters[1], 1);
Successful.
I needed always a Read command before a Write. Not ideal but no a big deal.
Ok, now I want to program the NIOS2 in the non-volatile memory. Because I have a MAX10 DC (Compact version) I have to load the NIOS2 firmware in flash. I changed the reset vector memory to "on chip flash" and I set the correct values in the BSP. Booting is successful. All the functions (NIOS2 and FPGA) are working except write flash.
alt_onchip_flash_write_block (&onchip_flash_0, 0, parameters[0], parameters+1, 1); --> gives me all the time a 0x8C error "#define ETIMEDOUT 116 /* Connection timed out */"
the trick with read first and than write is not working anymore. I cannot write to flash anymore....
Any idea what am I doing wrong? Suggestions?
Thank you,
Paul