Hello,
I'm trying to program a Cyclone V SoC using DS-5 and I get the following errors:
Stopping running target Intel SoC FPGA - Cyclone V SoC (Dual Core) on connectionConnected to running target Intel SoC FPGA - Cyclone V SoC (Dual Core)Execution stopped in SVC mode at S:0x3FF8D94CS:0x3FF8D94C B {pc}-0xc ; 0x3ff8d940cd "D:\UserData\z0045mwh\Documents\DS-5 Workspace"Working directory "D:\UserData\z0045mwh\Documents\DS-5 Workspace"Execution stopped in SVC mode at S:0x3FF8D94CS:0x3FF8D94C B {pc}-0xc ; 0x3ff8d940source /v "C:\intelFPGA\18.1\embedded\ds-5\sw\debugger\configdb\Scripts\altera_target_check.py"No SYSID registers could be found. Has a peripheral description file been supplied?source /v "D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\preloader.ds"+stopWARNING(CMD315): Target is not running+wait 5s+reset system+wait 5s+loadfile "$sdir/uboot-socfpga/spl/u-boot-spl" 0x0Loaded section .text: S:0xFFFF0000 ~ S:0xFFFF671B (size 0x671C)Loaded section .rodata: S:0xFFFF671C ~ S:0xFFFF82E4 (size 0x1BC9)Loaded section .data: S:0xFFFF82E8 ~ S:0xFFFF91AF (size 0xEC8)Entry point S:0xFFFF0000Target has been resetExecution stopped in SVC mode at S:0x3FF8D94CS:0x3FF8D94C B shift+1073273152 ; 0x3FF8D940+set debug-from *$entrypoint # Set start-at setting to address of $entrypoint+start Reloading programStarting target with image D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\uboot-socfpga\spl\u-boot-splRunning from entry pointExecution stopped in SVC mode at S:0xFFFF0000In start.SUnable to read source file D:/SJ/nightly/14.0/200/w64/acds/embedded/examples/hardware/av_soc_devkit_ghrd/software/preloader/uboot-socfpga/arch/arm/cpu/armv7/start.SS:0xFFFF0000 39,0 B reset ; 0xFFFF0070+deleteAll user breakpoints deleted+tbreak spl_boot_deviceBreakpoint 2 at S:0xFFFF110C on file spl.c, line 70 on file spl.c, line 80+cont+wait 60sERROR(CMD360): # in D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\preloader.ds:46 while executing: wait 60s! Wait for stopped timed outERROR(CMD656): The script D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\preloader.ds failed to complete due to an error during execution of the scriptloadfile "D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\Debug\RTOSDemo.elf"ERROR(CMD16-TAD11-NAL33): ! Failed to load "RTOSDemo.elf"! Failed to write 8 bytes to address N:0x0010C2D8! Target is running, cannot access.set debug-from mainstartERROR(CMD350): Command not possible when runningwait
I'm also looking at the UART0 output and see this output:
data abort MAYBE you should read doc/README.arm-unaligned-accessespc : [<ffff018c>] lr : [<ffff0074>]sp : 3ff35630 ip : 00000010 fp : 00000001r10: 3ffa2bb1 r9 : 3ffaceb8 r8 : 3ff35f60r7 : 00000001 r6 : 3ffae32c r5 : 400001a7 r4 : ffff8368r3 : 00000000 r2 : c0000000 r1 : 00000048 r0 : 40000173Flags: nZcv IRQs off FIQs off Mode SVC_32Resetting CPU ...resetting ...U-Boot SPL 2013.01.01 (Apr 08 2018 - 17:00:50)BOARD : Altera SOCFPGA Cyclone V BoardCLOCK: EOSC1 clock 25000 KHzCLOCK: EOSC2 clock 25000 KHzCLOCK: F2S_SDR_REF clock 0 KHzCLOCK: F2S_PER_REF clock 0 KHzCLOCK: MPU clock 800 MHzCLOCK: DDR clock 400 MHzCLOCK: UART clock 100000 KHzCLOCK: MMC clock 50000 KHzCLOCK: QSPI clock 3125 KHzRESET: WARMINFO : Watchdog enabledSDRAM: Initializing MMR registersSDRAM: Calibrating PHYSEQ.C: Preparing to start memory calibrationSEQ.C: CALIBRATION PASSEDSDRAM: 1024 MiBALTERA DWMMC: 0reading u-boot.imgreading u-boot.imgU-Boot 2013.01.01 (Apr 08 2018 - 17:02:43)CPU : Altera SOCFPGA PlatformBOARD : Altera SOCFPGA Cyclone V BoardI2C: readyDRAM: 1 GiBMMC: ALTERA DWMMC: 0*** Warning - bad CRC, using default environmentIn: serialOut: serialErr: serialSkipped ethaddr assignment due to invalid EMAC address in EEPROMNet: mii0Warning: failed to set MAC addressHit any key to stop autoboot: 0reading u-boot.scr** Unable to read file u-boot.scr **Optional boot script not found. Continuing to boot normallyreading zImage** Unable to read file zImage **reading socfpga.dtb** Unable to read file socfpga.dtb **Bad Linux ARM zImage magic!SOCFPGA_CYCLONE5 #
Am I running into some problem because there is already a Linux kernel on the HPS already? Any help is greatly appreciated.
Hello, I believe you have the same issue as reported on the Intel forum below:https://community.intel.com/t5/Nios-II-Embedded-Design-Suite/DS-5-Baremetal-Failed-to-load-image/td-p/138277The solution mentioned there is to manually enable semihosting:
set semihosting enabled true
Thank you. That does seem to be one of the issues I am having. I believe I corrected it but now still have an issue with:
Starting target with image D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\uboot-socfpga\spl\u-boot-splRunning from entry pointExecution stopped in SVC mode at S:0xFFFF0000
In start.SUnable to read source file D:/SJ/nightly/14.0/200/w64/acds/embedded/examples/hardware/av_soc_devkit_ghrd/software/preloader/uboot-socfpga/arch/arm/cpu/armv7/start.S
which was in my error log but not the original poster's output.
The "Unable to read source file" message is displayed because the elf file that was loaded (D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\uboot-socfpga\spl\u-boot-spl) includes symbols and knows the path/filenames of the original files used to compile the elf image.
You can safely ignore this message. It is not an error. It is mentioning that it cannot find the source assembly/C file(s) associated with the current address of the breakpoint. This is usually ok, in this case, since you want to stop the preloader at a safe place, then load the rest of the code. You usually don't need to debug or step through the source in start.S.
You can also download all the source code for the preloader, and provide path substitutions in the GUI to the location of the start.S (and the rest of the preloader source), but it is likely not needed.
Here is more information on the path substitution used in both Arm DS and DS-5:
https://developer.arm.com/documentation/dui0446/v/controlling-execution/configuring-the-debugger-path-substitution-rules
Thanks for the response. It seems like I was mistaken that I solved the original problem then. After adding the line "set semihosting enabled 1" in the preloader.ds I get the same errors with some additional ones now.
Stopping running target Intel SoC FPGA - Cyclone V SoC (Dual Core) on connectionConnected to running target Intel SoC FPGA - Cyclone V SoC (Dual Core)Execution stopped in SVC mode at S:0xFFFF446CS:0xFFFF446C B {pc} ; 0xffff446ccd "D:\UserData\z0045mwh\Documents\DS-5 Workspace"Working directory "D:\UserData\z0045mwh\Documents\DS-5 Workspace"Execution stopped in SVC mode at S:0xFFFF446CS:0xFFFF446C B {pc} ; 0xffff446csource /v "C:\intelFPGA\18.1\embedded\ds-5\sw\debugger\configdb\Scripts\altera_target_check.py"No SYSID registers could be found. Has a peripheral description file been supplied?source /v "D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\preloader.ds"+stopWARNING(CMD315): Target is not running+wait 5s+reset system+wait 5s+loadfile "$sdir/uboot-socfpga/spl/u-boot-spl" 0x0Loaded section .text: S:0xFFFF0000 ~ S:0xFFFF671B (size 0x671C)Loaded section .rodata: S:0xFFFF671C ~ S:0xFFFF82E4 (size 0x1BC9)Loaded section .data: S:0xFFFF82E8 ~ S:0xFFFF91AF (size 0xEC8)Entry point S:0xFFFF0000Target has been resetExecution stopped in SVC mode at S:0xFFFF446CUnable to read source file D:/SJ/nightly/14.0/200/w64/acds/embedded/examples/hardware/av_soc_devkit_ghrd/software/preloader/uboot-socfpga/common/spl/spl.cS:0xFFFF446C 56,0 B hang+8 ; 0xFFFF446C+set semihosting enabled 1Semihosting server socket created at port 8001+set debug-from *$entrypoint # Set start-at setting to address of $entrypoint+start Reloading programStarting target with image D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\uboot-socfpga\spl\u-boot-splRunning from entry pointExecution stopped in SVC mode at S:0xFFFF0000In start.SUnable to read source file D:/SJ/nightly/14.0/200/w64/acds/embedded/examples/hardware/av_soc_devkit_ghrd/software/preloader/uboot-socfpga/arch/arm/cpu/armv7/start.SS:0xFFFF0000 39,0 B reset ; 0xFFFF0070+deleteAll user breakpoints deleted+tbreak spl_boot_deviceBreakpoint 2 at S:0xFFFF110C on file spl.c, line 70 on file spl.c, line 80+cont+wait 60sERROR(CMD360): # in D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\preloader.ds:49 while executing: wait 60s! Wait for stopped timed outERROR(CMD656): The script D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\preloader.ds failed to complete due to an error during execution of the scriptloadfile "D:\UserData\z0045mwh\Documents\DS-5 Workspace\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\Debug\RTOSDemo.elf"ERROR(CMD16-TAD11-NAL22): ! Failed to load "RTOSDemo.elf"! Failed to write 8 bytes to address S:0x0011B754! General error on memory or register access.ERROR(COR118-TAD1-NAL52): ! Unable to determine if stopped for semihosting! Unable to read from register SPSR_UND! Cannot attain state requested.Execution stopped in UND mode at S:0xFFFF0004Unable to read source file D:/SJ/nightly/14.0/200/w64/acds/embedded/examples/hardware/av_soc_devkit_ghrd/software/preloader/uboot-socfpga/arch/arm/cpu/armv7/start.SERROR(CMD256-TAD10-NAL52): ! Unable to display contents at location "S:0xFFFF0004"! Failed to read 4 bytes from address S:0xFFFF0004! Cannot attain state requested.set debug-from mainstartWARNING(CMD399-COR168): ! Failed to start the target! No function named "main" could be foundWARNING(CMD407): Trying the entry point insteadERROR(CMD399-CMD27-TAD1-NAL52): ! Failed to start the target! Failed to set a breakpoint! Unable to read from register SP! Cannot attain state requested.waitERROR(TAD1-NAL52): ! Unable to read from register SP! Cannot attain state requested.Target Message: Could not determine target stateTarget Message: Could not determine target stateTarget Message: Could not determine target stateTarget Message: Could not determine target stateTarget Message: Could not determine target state
Any insight is greatly appreciated.
Is it possible to share this script? I don't know what exactly it does.Making an educated guess - it is initializing memory, but in your case, it takes more than 60 seconds (the CMD360 error), which tells me that something went wrong with that stage - then it tries to load the ELF file to this address, which therefore fails?
Here is the preloader.ds script
############################################################ # # Copyright Altera 2013 # All Rights Reserved # File: preloader.ds # ############################################################ # # stop processor if running # stop wait 5s reset system wait 5s #set semihosting enabled # # load the preloader (a.k.a the spl from our uboot dist) # loadfile "$sdir/uboot-socfpga/spl/u-boot-spl" 0x0 set semihosting enabled 1 # # set pc to entry point # set debug-from *$entrypoint # Set start-at setting to address of $entrypoint start # # delete any breakpoints # delete # # set hw breakpoint in spl in function, spl_boot_device, # The function, spl_boot_device, is called right before the spl tries # to load. We stop here so we don't have to change any spl. # tbreak spl_boot_device # tell target to continue executing spl cont # wait for breakpoint wait 60s
I'm basically trying to follow these steps but on a different Cyclone V development board. I've updated the application code to control a GPIO that's connected to an LED on this board.
https://www.freertos.org/RTOS_Altera_SoC_ARM_Cortex-A9.html#build_instructions
Also, you might be able to find answers directly from Intel, since Altera (now Intel) originally created the ds scripts above. Their Embedded forum can be found here:
https://community.intel.com/t5/Intel-SoC-FPGA-Embedded/bd-p/soc-fpga-embedded-development-suite
There are also example designs included with SoCEDS. These containother scripts that might be useful. These can be found here:
https://fpgasoftware.intel.com/soceds/
any thoughts now that the script is included?
thanks for the reference. I also posted a question over there as well.
Hi again,Sorry, I can't think of anything detailed to add - the script sets a breakpoint at "spl_boot_device" that is never hit, the script times out after 60 seconds.Perhaps try manually performing each step of the script, or set additional breakpoints - do you ever reach main()?
I'm stuck with the same very problem and cannot proceed. Were you able to solve it? I'm also getting the error:
"
ERROR(CMD360): # in C:\Work\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\preloader.ds:45 while executing: wait 60s! Wait for stopped timed outERROR(CMD656): The script C:\Work\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\preloader.ds failed to complete due to an error during execution of the scriptloadfile "C:\Work\FreeRTOSv10.3.1\FreeRTOS\Demo\CORTEX_A9_Cyclone_V_SoC_DK\Debug\RTOSDemo.elf"ERROR(CMD16-TAD11-NAL33): ! Failed to load "RTOSDemo.elf"! Failed to write 8 bytes to address N:0x0015447C! Target is running, cannot access.set debug-from mainstart
Help would be very much appreciated.
Kind regards,
Filip in Sweden
Hi Filip,
Sorry but I still don't have a solution to this. It's taken a bit of a back seat lately while I work on more pressing issues. Please let me know if you find a solution.