Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
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.
12420 Discussions

DS-5 Baremetal:Failed to load image

Honored Contributor II



I'm running a baremetal application to write and read a byte of data into the DDR memory. The attached image shows the configuration of the DS-5 debugger being used. 


The error log is as shown: 

Stopping running target Altera - Cyclone V SoC (Dual Core) on TCP:localhost on connection 

Connected to running target Altera - Cyclone V SoC (Dual Core) on TCP:localhost 

Execution stopped at: S:0x3FF84E5C 

source /v "D:\Altera\embedded\ds-5\sw\debugger\configdb\Scripts\

S:0x3FF84E5C LDR r3,[pc,#188] ; [0x3FF84F20] = 0xFF706FFF 



No SYSID registers could be found. Has a peripheral description file been supplied? 



source /v "D:\Altera\projects\system\software\spl_bsp\preloader.ds


WARNING(CMD315): Target is not running 

+wait 5s 

+reset system 

+wait 5s 

+set semihosting enabled 0 

+loadfile "$sdir/uboot-socfpga/spl/u-boot-spl" 0x0 

Loaded section .text: S:0xFFFF0000 ~ S:0xFFFF7AE3 (size 0x7AE4) 

Loaded section .rodata: S:0xFFFF7AE4 ~ S:0xFFFF9D7B (size 0x2298) 

Loaded section .data: S:0xFFFF9D80 ~ S:0xFFFFAC53 (size 0xED4) 

Entry point S:0xFFFF0000 

Target has been reset 

Execution stopped due to a breakpoint or watchpoint: S:0x00000000 

S:0x00000000 LDR pc,[pc,#24] ; [0x20] = 0xA8 

+set debug-from *$entrypoint # Set start-at setting to address of $entrypoint 


Reloading program 

Starting target with image D:\Altera\projects\system\software\spl_bsp\uboot-socfpga\spl\u-boot-spl 

Running from entry point 

Execution stopped at: S:0xFFFF0000 

In start.S 

S:0xFFFF0000 39,0 _start: b reset 


All user breakpoints deleted 

+tbreak spl_boot_device 

Breakpoint 2 at S:0xFFFF2084 

on file spl.c, line 71 

on file spl.c, line 81 


+wait 60s 


# in D:\Altera\projects\system\software\spl_bsp\preloader.ds:46 while executing: wait 60s 

! Wait for stopped timed out 

ERROR(CMD656): The script D:\Altera\projects\system\software\spl_bsp\preloader.ds failed to complete due to an error during execution of the script 

loadfile "C:\Users\Administrator\Documents\DS-5 Workspace\app_test\Debug\app_test.axf" 


! Failed to load "app_test.axf" 

! Failed to write 8 bytes to address N:0x00117748 

! Target is running, cannot access. 

cd "C:\Users\Administrator\Documents\DS-5 Workspace" 

Working directory "C:\Users\Administrator\Documents\DS-5 Workspace" 

set debug-from main 



Sometimes upon reload, I get this warning(s): 


! Failed to start the target 

! No function named "main" could be found 

WARNING(CMD407): Trying the entry point instead 




WARNING(CMD452-COR167): ! Breakpoint 3 has been pended! No compilation unit matching "C:/Users/Administrator/Documents/DS-5 Workspace/app_test/Debug/test.c" was found 


Am I missing anything in the configuration? Is there any specific jumper settings? I suspect the problem is initialization of the memory but not completely sure on it. 

Please advice on this issue. Thanks in advance. 


I am using a Cyclone V Arrow SocKit with Quartus 14.1 edition. The preloader and uboot were generated through the bsp-editor after the system was generated through Qsys. 


Best Regards, 

0 Kudos
6 Replies
Honored Contributor II

This problem was solved.  


The semihosting should be turned on for the debugger to recognize the code for execution. Adding this line into the application code would resolve the error. More information about semihosting can be found here: 


The error ERROR(CMD16-TAD11-NAL33): appears sometimes since the system is not reset. Either doing a reset through the debugger/powering the board off and on should be able to resolve this. 


Hope this helps for others facing the same issue. 



Honored Contributor II


--- Quote Start ---  

The semihosting should be turned on for the debugger to recognize the code for execution. Adding this line into the application code would resolve the error. More information about semihosting can be found here: 

--- Quote End ---  


Hi. Could you tell me what is "this line" you refer to? 


I get pretty much exactly the same error messages you got, and am trying to debug a bare metal FPGA + NIOS2 + ARM system on a rev.D VEEK-MT-SoCKit. The FPGA and NIOS2 portion seems to be working just fine, but the ARM/DS-5 stuff not so much. I have tried with different preloaders (boot from QSPI/SDMMC/none) and debugger scripts (semihosting on/off etc.), to no avail. This is really starting to p**s me off, I think this entire procedure could and should have been made much simpler. Help would be much appreciated. TIA! 


BTW, the link you provided does not work.
Honored Contributor II

hello moggiozzi 


I can't understand that what kind of change I have to make in spl code. FYI I want to test DDR3 - HPS interface using a bare metal debugging. 

"OR 3) Initialisation scripts used precompiled version of u-boot-spl. You have to build your own version of SPL and replace it in project direcoty (or adjust makefile). In my case I add little changes to spl code that he completed after hardware initialization."
Honored Contributor II

I do not remember exactly, in some places I commented hang().


I have fixed this error in different projects by adding the peripheral description as a .tcf file to the DS-5 project. It also hit me in linux debugging if I removed the SysID peripheral from the hardware.


After loading the preloader, manually or using the debugger script, you need to turn on semihosting by adding the following line;

set semihosting enabled true