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

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]);


- Try again to write it:

alt_onchip_flash_write_block (&onchip_flash_0, 0, parameters[0], parameters[1], 1);


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,



0 Kudos
3 Replies

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:

Warm Regards.


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



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.