This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Breakpoints do not work with CortexM4 Fast Model

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 

Parents
  • Hi Frederic

    My 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}" 0x1000
    But again, no address space prefix is needed for M-class.

    Hope this helps

    Stephen

Reply
  • Hi Frederic

    My 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}" 0x1000
    But again, no address space prefix is needed for M-class.

    Hope this helps

    Stephen

Children