In GeMRTOS multiprocessor RTOS systems on Altera FPGA platforms with Nios V processors, you may find that only processor ID=1 starts correctly after downloading software with nios2-download, while all other processors fail to launch. This is a known boot sequence issue caused by how nios2-download handles the CPU reset across multiple processors.
Root Cause #
Prior to downloading the memory code, nios2-download resets the CPU. When processor ID=1 asserts the debug reset signal before the program code is downloaded, this reset propagates to all remaining processors. The problem is that the remaining processors are not paused during the download — unlike processor ID=1. If the boot code for those processors is not already stored in memory at the time of reset, they have nothing to execute and fail to start.
How to Fix It #
Boot code must be loaded into the boot memory when the FPGA device is configured. Follow these steps:
- Run the
make mem_init_generatecommand in your GeMRTOS BSP/application build directory to generate the memory initialization files. - Add the generated .qip file to the Quartus Prime project files.
- Perform a full hardware compilation in Quartus Prime to embed the boot code into the FPGA configuration.
After the FPGA is reprogrammed with the new configuration, all processors will have their boot code available in memory at reset and will start correctly.
Alternative: Update Memory Contents Without Full Recompilation #
If you want to avoid a full hardware recompilation, follow the “Update Memory Contents Without Recompiling” procedure described in the Intel Quartus Prime documentation. This updates the memory initialization data in the FPGA configuration without regenerating the full bitstream.
Key Takeaways #
- In GeMRTOS Nios V multiprocessor systems, processors ID>1 are not paused during nios2-download — they reset and immediately try to execute code. If boot code is absent from memory, they fail to start.
- The fix is a one-time step: run make mem_init_generate, add the .qip file to the Quartus project, and recompile hardware to embed boot code into the FPGA configuration.
- After the initial hardware recompilation, subsequent software-only downloads via
nios2-downloadwill work correctly for all processors. - If full recompilation is impractical, use Intel’s “Update Memory Contents Without Recompiling” flow to update boot memory contents faster.