I use the UFM to store my NIOS code but I reserve Sector 1 (16kB) for data storage (Liker Script).
I use "Convert Programming File" to merge the .sof and .hex to make a .pof.
After configuration, any unused Flash location by the NIOS code is set to 0x00.
I need any unused Flash location to stay blank (0xFF), espetially the 16kB sector I reserve for data storage.
"Convert Programming File" does not allow me to add more .hex files.
I have the "initialize flash content" box checked in the Flash IP Core.
How do get sector 1 to remain blank (0xFF) at configuration time?
Is this done NSBT? How?
In Convert Programming Files:
- Select Internal Configuration
- In Options/Boot Info ... -- select UFM source: Load memory file, navigate to ./software/<project name>/mem_init/system_onchip_flash_0.hex, keep all defaults.
- Click "SOF Data" -- click Add File..., navigate to ./output_files/<project>.sof
- Keep default Programming file type: Programmer Object File (.pof)
- Click Generate
- Check the boxes for CFM0 and UFM in the Program/Configure column
- Click Change File ..., navigate to just created .pof
- Click Start and watch MAX10 get configured
Modifying the .hex is not as simple as find 00 and replace with FF. I have to calculate checksum for the end of every line on too many lines.
Isn't there a way for Quartus tools to do it?
I have check with engineering, unfortunately there is no way to implement it into the Nios II as the "make mem_init_generate" is automated from the tools.
I would recommend you to use Quartus to modify it.
- Open the Hex file and use the default word size
- Highlight by dragging the starting location to the end location that you would like to modify
- Right click on the highlighted cell and select "Fill cells with 1's"
- Save the file