Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

5.2.2.2. Nios® II Processor Application Execute-In-Place from UFM

This solution is suitable for Nios® II processor applications which require limited on-chip memory usage. The alt_load () function operates as a mini boot copier which copies the data sections (.rodata, .rwdata, or .exceptions) from boot memory to RAM based on the BSP settings. The code section (.text), which is a read only section, remains in the Intel® MAX® 10 On-chip Flash memory region. This setup minimizes the RAM usage but may limit the code execution performance as access to the flash memory is slower than the on-chip RAM.

The Nios® II processor application is programmed into the UFM sector. The Nios® II processor's reset vector points to the UFM base address in order to execute code from the UFM after the system resets.

If you are debugging the application using the source-level debugger, you must use a hardware break-point to debug because the UFM does not support random memory access. Random memory access is required for soft break-point debug.

Figure 50. Nios II Application XIP from UFM
Table 31.  RAM and ROM Size RequirementYou can manually determine the required RAM size for the On-Chip Flash by referring to the initial part of the .objdump file, created when you build your application.
RAM Size Requirement ROM Size Requirement
Equivalent to the dynamic memory space usage during run time which is the sum of the maximum heap and stack size. Executable code must not exceed the size of the UFM.
Figure 51. Design, Configuration and Booting Flow