FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
4960 Discussions

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

NNauf
Partner
526 Views

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
JohnT_Intel
Employee
429 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?

NNauf
Partner
429 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
JohnT_Intel
Employee
429 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?

NNauf
Partner
429 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.

JohnT_Intel
Employee
429 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.

NNauf
Partner
429 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?

 

JohnT_Intel
Employee
429 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.

NNauf
Partner
429 Views

This is exactly what I need.

Can you please point me to instructions on doing it?

JohnT_Intel
Employee
429 Views

Hi,

 

Can you share with me your Nios II software BSP?

NNauf
Partner
429 Views

Is it the summary.html or a different file?

JohnT_Intel
Employee
429 Views

Hi,

 

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

NNauf
Partner
429 Views

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

JohnT_Intel
Employee
429 Views

Hi,

 

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

NNauf
Partner
429 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..

NNauf
Partner
429 Views
posted a file.
JohnT_Intel
Employee
429 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
NNauf
Partner
429 Views
JohnT_Intel
Employee
429 Views

Sure. Let me know if you have further queries.

Reply