Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12590 Discussions

Nios2 - Cannot write the OnChip-Flash - Timeout error

TheRealPaulie
Beginner
915 Views

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

 

0 Kudos
3 Replies
BoonBengT_Intel
Moderator
883 Views

Hi @TheRealPaulie,

Thank you for your patients, would it be convenient for you to share the qsys diagram and also the NIOS project is possible?

Will be helpful for us to further check on the issues.

Attached below is some user guide for flash memory for Max 10, you may refer to the section 4.2 which explain the method of utilizing the operation on flash memory:

https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/max-10/ug_m10_ufm.pdf


Warm Regards.

0 Kudos
BoonBengT_Intel
Moderator
859 Views

Hi @TheRealPaulie.,

Hope this message find you well and good day, as we do not receive any response from you to the previous clarification that we have provided. Please post a response in the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you with your follow-up questions. 

 

Warm Regards

0 Kudos
TheRealPaulie
Beginner
854 Views

Hello,

I solved the problem. It was the configuration of the BSP. 

I was booting from FLASH but using the FLASH as program memory (I hope that terms I'm using are correct - I'm not a uController specialist). After I changed the settings to copy the code from FLASH to RAM and boot it from RAM, I was able to delete and to write the FLASH again.

Regards,

Paul

0 Kudos
Reply