Forum Discussion
Nios V XIP boot from UFM does not work with dual configuration on FPGA 10M50 Evaluation Kit
Hi watanabe
The standalone LED run shows the Nios V design works when the ELF is downloaded. UFM execute-in-place is a different boot path. usleep() is separate from that.
In Dual Compressed Images mode, keep the two FPGA images in CFM0–CFM2 and the Nios V application in UFM0/UFM1. Set that same mode in the On-Chip Flash IP and in Device and Pin Options. A mismatch fails with Error (14740). Assign Hidden Access to every CFM region, set the Nios V reset agent to On-Chip Flash, and point the reset vector at the UFM base address. Program the application into UFM, then power-cycle. On this kit, SW2.3 (CONFIG_SEL) selects the first image: low is CFM0, high is CFM1 or CFM2. Do not erase or write UFM while executing from it. Use a hardware breakpoint to debug that code.
Put .text in On-Chip Flash and the writable sections in RAM. Enable allow_code_at_reset, enable_alt_load, enable_alt_load_copy_rodata, and enable_alt_load_copy_rwdata. If .exceptions is in RAM, also enable enable_alt_load_copy_exceptions.
For usleep(), include <unistd.h> and check hal.sys_clk_timer. The default clock is the Nios V built-in timer. A missing delay is a system-clock setting. UFM execute-in-place can make the same code take longer than execution from on-chip RAM.
Best wishes