Hi, I am struggling in running the ready-examples of the ARM development studio IDE. I demonstrate the "TrustZone_Cortex-A9AC6" example here.
I am using the following resources:
1) "ARM Cyclone V SoC FPGA development kit".
2) Licensed copy of the ARM development studio IDE version 2021.1.
3) Windows 10 OS.
4) JTAG connection between the FPGA kit and the PC.
Please also refer to the snapshots in the attached pdf file for more details.
According to the description provided with this example "readme.html", the system should display some text on the "Target Console" like "Hello from Normal world" and so on.
However, nothing was displayed on the Target Console although the system was running without a clear reason.
Any advice please to handle this issue? thanks a lot.
TrustZone_Cortex-A9AC6 example does not run normally.pdf
Hi Stephen, thank you for your great support
The problem happened for both FVP model and real hardware. In both cases, I am connecting the Cyclone V dev kit to the PC, where the ARM DS IDE ver21.1 is installed.
There are no error messages shown in the Commands view.
About modifying the memory addresses, I didn't done that before and I am not sure how to modify them. Can you please help in this point?
Thanks a lot, your support is highly appreciated.
Hi again MohammedSorry, I can't explain why you are not seeing the correct output when connected to the FVP model.I suggest you delete the project from the workspace, then re-import it afresh. It is supplied pre-built, so there's no need to recompile it. Double click on TrustZone_Cortex-A9_AC6-FVP.launch, and press Debug. Does the FVP model launch? You should see in the Commands view:Connected to stopped target Arm FVP (Installed with Arm DS) - VE_Cortex_A9x1cd "C:\Users\yourname\Development Studio Workspace"Working directory "C:\Users\yourname\Development Studio Workspace"Execution stopped in SVC mode at S:0x00000000loadfile "C:\Users\yourname\Development Studio Workspace\TrustZone_Cortex-A9_AC6\TrustZone_Cortex-A9_AC6.axf"S:0x00000000 DCI 0xe7ff0010 ; ? UndefinedLoaded section SECURE_EXE: S:0x80000000 ~ S:0x800012FF (size 0x1300)Loaded section SECURE_EXE: S:0x80001300 ~ S:0x80001307 (size 0x8)Loaded section NORMAL_IMAGE: S:0x80100000 ~ S:0x8010103F (size 0x1040)Entry point S:0x80000000Semihosting server socket created at port 8000Semihosting enabled automatically due to semihosting symbol detected in image 'TrustZone_Cortex-A9_AC6.axf'set debug-from *$ENTRYPOINTstartStarting target with image C:\Users\yourname\Development Studio Workspace\TrustZone_Cortex-A9_AC6\TrustZone_Cortex-A9_AC6.axfRunning from entry pointwaitExecution stopped in SVC mode at S:0x80000000In startup_secure.sS:0x80000000 51,0 MSR CPSR_c, #Mode_SVC:OR:I_Bit:OR:F_Bit ; No interruptsadd-symbol-file "${workspace_loc:/TrustZone_Cortex-A9_AC6/normal.axf}" N:0To modify the Arm DS examples to work on your hardware, first find out where there is RAM on your board. In general, you must then modify the scatter-file (.scat) or linker --ro-base=address, replacing the 0x8xxxxxxx-based addresses ("RAM" in the FVP model) with the base address of RAM on your board, and re-compile.The TrustZone_Cortex-A9_AC6 might not be easy to port, because it assumes the existence of a BP147 TrustZone controller (is there one on your board? if so, at what address?), and has two scatter-files. You'll need to modify the addresses in both scatter-files to match the RAM (and TrustZone controller) on your board.It might be easier to start with a simpler example, such as the "startup_Cortex-A9_AC6" example. That has a single scatter-file, and no dependence of any special hardware.Hope this helpsStephen
Connected to stopped target Arm FVP (Installed with Arm DS) - VE_Cortex_A9x1
cd "C:\Users\yourname\Development Studio Workspace"
Working directory "C:\Users\yourname\Development Studio Workspace"
Execution stopped in SVC mode at S:0x00000000
loadfile "C:\Users\yourname\Development Studio Workspace\TrustZone_Cortex-A9_AC6\TrustZone_Cortex-A9_AC6.axf"
S:0x00000000 DCI 0xe7ff0010 ; ? Undefined
Loaded section SECURE_EXE: S:0x80000000 ~ S:0x800012FF (size 0x1300)
Loaded section SECURE_EXE: S:0x80001300 ~ S:0x80001307 (size 0x8)
Loaded section NORMAL_IMAGE: S:0x80100000 ~ S:0x8010103F (size 0x1040)
Entry point S:0x80000000
Semihosting server socket created at port 8000
Semihosting enabled automatically due to semihosting symbol detected in image 'TrustZone_Cortex-A9_AC6.axf'
set debug-from *$ENTRYPOINT
start
Starting target with image C:\Users\yourname\Development Studio Workspace\TrustZone_Cortex-A9_AC6\TrustZone_Cortex-A9_AC6.axf
Running from entry point
wait
Execution stopped in SVC mode at S:0x80000000
In startup_secure.s
S:0x80000000 51,0 MSR CPSR_c, #Mode_SVC:OR:I_Bit:OR:F_Bit ; No interrupts
add-symbol-file "${workspace_loc:/TrustZone_Cortex-A9_AC6/normal.axf}" N:0
Hi Stephen, thank you again for your great support
I re-imported the project and debug it according to your suggestion, some errors were found in the Commands Views, please check them in below. I think you are right, there is a problem with the RAM base addresses, is it possible to know the base address of the RAM on my board from the error messages? If no, how to find out them please? The error messages contains some addresses that started with "0x0000....", is that means the base address in my board is "0x00000000"?
-------------------------------------------- Error messages on the Commands Views --------------------------------------
Stopping running target Intel SoC FPGA - Cyclone V SoC (Single Core) on connectionConnected to running target Intel SoC FPGA - Cyclone V SoC (Single Core)Execution stopped in ABT mode at S:0xFFFF000CTarget Message: Memory access caused precise abort.Debug Precise Abort Registers : DFSR = 0x0000100C, DFAR = 0xFFFF0000Target Message: Memory access caused precise abort.Debug Precise Abort Registers : DFSR = 0x0000100C, DFAR = 0xFFFF000CERROR(CMD256-TAD10-NAL18): ! Unable to display contents at location "S:0xFFFF000C"! Failed to read 4 bytes from address S:0xFFFF000C! Bus error on memory operation.cd "C:\Users\Mohammed Lami\Development Studio Workspace"Working directory "C:\Users\Mohammed Lami\Development Studio Workspace"Execution stopped in ABT mode at S:0xFFFF000Csource /v "C:\Program Files\Arm\Development Studio 2021.1\sw\debugger\configdb\Scripts\altera_target_check.py"Target Message: Memory access caused precise abort.Debug Precise Abort Registers : DFSR = 0x0000100C, DFAR = 0xFFFF000CERROR(CMD256-TAD10-NAL18): ! Unable to display contents at location "S:0xFFFF000C"! Failed to read 4 bytes from address S:0xFFFF000C! Bus error on memory operation.
No SYSID registers could be found. Has a peripheral description file been supplied?
loadfile "C:\Users\Mohammed Lami\Development Studio Workspace\TrustZone_Cortex-A9_AC6\TrustZone_Cortex-A9_AC6.axf"Target Message: Memory access caused precise abort.Debug Precise Abort Registers : DFSR = 0x0000180C, DFAR = 0x80100FE0ERROR(CMD16-TAD274-NAL18): ! Failed to load "TrustZone_Cortex-A9_AC6.axf"! Failed to write 4,160 bytes to address S:0x80100000 while writing block of 4,096 bytes to address S:0x80100000! Bus error on memory operation.set debug-from *$ENTRYPOINTstartWARNING(CMD399-CMD38-CMD722): ! Failed to start the target! The string "$ENTRYPOINT" cannot be interpreted as a positive int! Entry point not setWARNING(CMD407): Trying the entry point insteadERROR(CMD426): Cannot find symbol to start or entrypoint, the file or load commands may be used to set the entrypointwaitadd-symbol-file "${workspace_loc:/TrustZone_Cortex-A9_AC6/normal.axf}" N:0Semihosting server socket created at port 8000Semihosting enabled automatically due to semihosting symbol detected in image 'normal.axf'Target Message: Memory access caused precise abort.Debug Precise Abort Registers : DFSR = 0x0000100C, DFAR = 0xFFFF0000Target Message: Memory access caused precise abort.Debug Precise Abort Registers : DFSR = 0x0000100C, DFAR = 0xFFFF0008Target Message: Memory access caused precise abort.Debug Precise Abort Registers : DFSR = 0x0000100C, DFAR = 0xFFFF000CwaitcontinuequitDisconnected from running target Intel SoC FPGA - Cyclone V SoC (Single Core)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hi again Mohammed"Execution stopped in ABT mode at S:0xFFFF000C"means the Arm core is in Abort mode, which is not a good start.I would expect it to be in SVC (Supervisor) mode.An Abort exception will occur if the core fails to read an instruction from an address (Prefetch Abort), or fails to read/write some data (Data Abort) from/to an address, but in either case that address is not accessible. What code does the core on your board execute when it first powers up?"Failed to write 4,160 bytes to address S:0x80100000 while writing block of 4,096 bytes to address S:0x80100000"means the Debugger was unable to download the TrustZone_Cortex-A9_AC6 executable because the memory at 0x80100000 is not accessible. Presumably there is no RAM at that address on your board.As I wrote before, you must first find out where there is RAM on your board. Sorry, I can't help you with that. It might be described in the documentation for your board, or you could try asking on the Intel forum at community.intel.com/.../fpgaI suggest that you start with a simpler example, such as the "startup_Cortex-A9_AC6" example. That has a single scatter-file, and no dependence on any special hardware. Import this example into your workspace. Don't modify anything. Double-click on startup_Cortex-A9_AC6-FVP.launch, and press Debug. Does the FVP model launch? Check that you can see some valid instructions in the Disassembly view. Press Run. Do you see some output in the Target Console? Once you have that working example on the FVP model, try modifying it to work on your board. Change the addresses in the scatterfile to suit the RAM on your board, and re-compile it. Create a new debug launcher to download the code to your board, and press Debug. Check in the Commands view whether the code has been downloaded correctly, and that you see the same instructions in the Disassembly view as for the FVP model. Then try single-stepping through the code. Set a breakpoint on main() and try running to it. Run again to completion.Hope this helps you to get startedStephen
"Execution stopped in ABT mode at S:0xFFFF000C"
"Failed to write 4,160 bytes to address S:0x80100000 while writing block of 4,096 bytes to address S:0x80100000"
Hi Stephen
Many thanks for your support
It seems that I got a successful startup for the Cyclone V SoC board in the supervisory mode (SVC), the "startup_Cortex-A9_AC6" has been cleaned and rebuild, without modifying the scatter file, then I debugged it in the FVP mode, all messages in the commands view were normal and the data was loaded successfully, please check the messages below, except one line that I am not sure what does mean by the peripheral description file: "No SYSID registers could be found. Has a peripheral description file been supplied?".
The project was imported from the archived projects, I only exchanged the "C-code" in the "sort.c" file with a simpler one, the code should return the value of a variable, but after the successful startup and clicking on the the "run" button, nothing was displayed in the Target console or in the App console.
Anyway, I attached the "startup_Cortex-A9_AC6" project here (with the modified "sort.c" file), could you please check it for me, thanks again for your support.
startup_Cortex-A9_AC6.rar
-------------- messages in the commands view --------------------------
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:0x8001E5C8S:0x8001E5C8 MOV pc,lrcd "C:\Users\Mohammed Lami\Development Studio Workspace"Working directory "C:\Users\Mohammed Lami\Development Studio Workspace"Execution stopped in SVC mode at S:0x8001E5C8S:0x8001E5C8 MOV pc,lrsource /v "C:\Program Files\Arm\Development Studio 2021.1\sw\debugger\configdb\Scripts\altera_target_check.py"
loadfile "C:\Users\Mohammed Lami\Development Studio Workspace\startup_Cortex-A9_AC6\startup_Cortex-A9_AC6.axf"Loaded section VECTORS: S:0x80000000 ~ S:0x80000233 (size 0x234)Loaded section RO_CODE: S:0x80000234 ~ S:0x800028D7 (size 0x26A4)Loaded section RO_DATA: S:0x800028D8 ~ S:0x80002B0F (size 0x238)Loaded section RW_DATA: S:0x80002B10 ~ S:0x80002B1B (size 0xC)Entry point S:0x80000000Semihosting server socket created at port 8000Semihosting enabled automatically due to semihosting symbol detected in image 'startup_Cortex-A9_AC6.axf'set debug-from *$ENTRYPOINTstartStarting target with image C:\Users\Mohammed Lami\Development Studio Workspace\startup_Cortex-A9_AC6\startup_Cortex-A9_AC6.axfRunning from entry pointwaitExecution stopped in SVC mode at S:0x80000000In startup.SS:0x80000000 43,0 LDR PC, Reset_Addrwaitcontinue
-------------------------------------------------------------------------------------------------------------------------------
Hi again MohammedI tried your modified "startup_Cortex-A9_AC6" project and it works well on the FVP model (see screenshot). But I hope that you've already tried that yourself, so I'm not sure what you are asking to check. I don't have access to a Cyclone V SoC FPGA development kit or USB Blaster, so I can't test it on real hardware.
The messages in the Commands view you showed look OK but, sorry, I can't diagnose why you don't see any output in the App console when you run. Try single-stepping through the instructions to see where execution fails. I guess some exception occurred at run-time.Regarding the messageNo SYSID registers could be found. Has a peripheral description file been supplied?please see this thread:community.arm.com/.../failed-to-load-project-axf---error-cmd16-tad274-nal22---can-t-run-bare-metal-application-from-sdramHope this helpsStephen
Thanks for your response
When you said: "I tried your modified "startup_Cortex-A9_AC6" project and it works well on the FVP model (see screenshot). But I hope that you've already tried that yourself, so I'm not sure what you are asking to check. I don't have access to a Cyclone V SoC FPGA development kit or USB Blaster, so I can't test it on real hardware."
in my client, I can't debug the project in FVP mode without connecting the pc to SoC cyclone V kit via usb B-blaster interface. So I am wondering how did you run the project without connecting to the real hardware as you mentioned please?
Thank you
Hello Mohammed,
I am a colleague of Stephen at Arm. I suspect you are using Arm Development Studio Intel Edition:https://developer.arm.com/tools-and-software/embedded/arm-development-studio/editions/intel-soc-fpga
This is a special edition only for those FPGA devices, rather than the 'full' Development Studio which offers FVPs and other targets.
We don't have access to the hardware and so it is difficult for us to suggest solutions, you may be better served asking on the Intel specific forums:https://community.intel.com/t5/Programmable-Devices/bd-p/programmable-devices
A cursory search found these examples. which may be useful for you:https://www.intel.com/content/www/us/en/support/programmable/support-resources/design-guidance/bare-metal-developer.html
These place the code/stack in addresses up to 0x40000000. Perhaps adjusting the scatter file to reflect these addresses may fix the issue?