Hello
using ARM DS 2021.2, I am unable to put breakpoints on code running on the Cortex M4 Fast Model 11.15
I did some tricky things with the R52 Fast model by using the debugger command :
add-symbol-file "${workspace_loc:/startup_Cortex-R52/startup_Cortex-R52.axf}" N:0
This allowed me to use breakpoints on code running in EL0 (User) mode.
But what is the equivalent command for enabling breakpoints for M4 C Code running on Privileged or User mode ?
This is described nowhere in the ARM DS documentations.
Best Regards
Frederic HUGUET
Hi FredericMy name is Stephen and I work at Arm.Arm Cortex-A and Cortex-R processors support multiple address spaces. For example, for Armv7-A/R AArch32, secure (S:), non-secure (N:) and hypervisor (H:), and multiple ELs for Armv8-A/R AArch64. These address spaces may be physically separate. To debug at source-level, debug symbols must be loaded for each address space that your code traverses, because the address space information is not encoded in the ELF file, so must be specified as an address space prefix (e.g. N:0) at the end of the add-symbol-file command.Cortex-M processors support only a single address space (though typically partitioned into secure and non-secure areas by the MPU), so no address space prefix is needed on the add-symbol-file command. The base address for the image is encoded within the ELF.For example, for the startup_Cortex-M4_AC6 example provided with Arm DS, you could simply use:add-symbol-file "${workspace_loc:/startup_Cortex-M4_AC6/startup_Cortex-M4_AC6.axf}"It is possible to use multiple add-symbol-file commands to load debug symbols separately for M-class for e.g. privileged and unprivileged address ranges. In this case, the base addresses are still encoded within the ELF, so no address space prefix is needed on the add-symbol-file command. For an example of this, see the Armv8-M_security example for Cortex-M33. In cases where code gets relocated at run-time, it is possible to add an address offset to the add-symbol-file command, e.g.add-symbol-file "${workspace_loc:/startup_Cortex-M4_AC6/startup_Cortex-M4_AC6.axf}" 0x1000But again, no address space prefix is needed for M-class.Hope this helpsStephen
Hello Stephen,
first, many thanks for your answer, it's crystal-clear.
Unfortunately, we still cannot put breakpoints in C source code running on M4.
It works when going on the disassembled window. So breakpoints on assembly code = OK. But not on C code even if we used add symbol file command with the proper path to the ELF binary file.
In the "debug configurations" window, we did this:
- in "files", set the field "application on host to Download" with the path of the binary , using ${workspace_loc} (since the embedded code has been imported into ARM DS)
"Load symbols from file" has been set up with the same file path.
In "debugger", we provided the field "execute debugger commands" with add-symbol-file with the same file path than previously.
I have no problem with this configuration on R52 Fast Model 11.16, but it does not work with cortex M4 Fast Model 11.15 ....
So we are unable to debug the M4 software easily (with the C code instead of assembly)
Frederic Huguet
Hi FredericSorry that you are still having problems. Here's some things to try/check:1) Please try the startup_Cortex-M4_AC6 example provided in Arm DS. This shows C source-level debug of code running on the Cortex-M4 FVP model.2) Check that your C code is compiled with "-g", which adds debug information into the image.3) There's no need to have "Load symbols from file" and "add-symbol-file". Just having the debug .axf in the "Application on host to download" and the "Load symbols" tick-box next to it ticked should be sufficient.4) I'm puzzled why you have two different versions of Fast Models FVPs (R52 11.16 and M4 11.15). Do you have two versions of Arm DS installed? This won't solve your problem, but I suggest you update to the latest Arm DS 2022.0, which includes FVPs from Fast Models 11.17.Hope this helpsStephen