Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
157 Views

How to leave unused UFM Flash on MAX10 blank (0xFF)

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?

 

thank you

0 Kudos
18 Replies
Highlighted
Employee
60 Views

Hi,

 

Could you provide me the step that you use to convert the sof and hex to POF file and the step you used to program the flash?

0 Kudos
Highlighted
Partner
60 Views

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

 

In "Programmer":

  • 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
0 Kudos
Highlighted
Employee
60 Views

Hi,

 

May I know how is the hex file genrerated? Do you observed the 1st sector of the "system_onchip_flash_0.hex" file is 0x0 or 0xff?

0 Kudos
Highlighted
Partner
60 Views

In NSBT, I do "Build Project", then "MakeTargets -> build -> mem_init_generate"

 

The  "system_onchip_flash_0.hex" has 0x00 in scector 0 preceding my code and 0x00 everywhere after my code.

I will rename the .hex as .txt and add it here.

0 Kudos
Highlighted
Employee
60 Views

Hi,

 

You will either need to generate the hex file with unused sector to 0xFF or modify the hex file to make sure that the unused sector 1 to 0xff.

0 Kudos
Highlighted
Partner
60 Views

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?

 

0 Kudos
Highlighted
Employee
60 Views

Hi,

 

I would recommend you to modify your Nios II BSP so that the unused memory is set as 0xFF. This will be easiest method as it will generate the hex file for you.

0 Kudos
Highlighted
Partner
60 Views

This is exactly what I need.

Can you please point me to instructions on doing it?

0 Kudos
Highlighted
Employee
60 Views

Hi,

 

Can you share with me your Nios II software BSP?

0 Kudos
Highlighted
Partner
60 Views

Is it the summary.html or a different file?

0 Kudos
Highlighted
Employee
60 Views

Hi,

 

If possible, please provide me the whole software folder to build Nios II software.

0 Kudos
Highlighted
Partner
60 Views

I changed its extension to .txt to pass though the filter.

0 Kudos
Highlighted
Employee
60 Views

Hi,

 

Could you provide me your .sopcinfo file? May I know how do you set the sector 1 to be unused?

0 Kudos
Highlighted
Partner
60 Views

I set Sector 0 in the Linker Script as seen in the BSP Editor Screenshot.

It is the Linker Region called onchip_flash_0_data_BEFORE_RESET..

0 Kudos
Highlighted
Partner
60 Views

posted a file.
0 Kudos
Highlighted
Employee
60 Views

Hi,

 

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.

  1. Open the Hex file and use the default word size
  2. Highlight by dragging the starting location to the end location that you would like to modify
  3. Right click on the highlighted cell and select "Fill cells with 1's"
  4. Save the file
0 Kudos
Highlighted
Partner
60 Views

Thank you. I will try it.

0 Kudos
Highlighted
Employee
60 Views

Sure. Let me know if you have further queries.

0 Kudos