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

Debug the R52 sample project in DS-5 Studio, stuck into EL1_undefined_Handler

I was using the evalution ultimated version of DS5 studio. To try and play, I chose the R52 sample program to import.

Follow the DS-5-Workspace/startup_Cortex-R52/readme.html, I didnt get error when build and debug configuration. But after start debugging and run the debug, it always stuck into the same place without getting into main function.

''

Starting target with image /home/caoj/DS-5-Workspace/startup_Cortex-R52/startup_Cortex-R52.axf
Running from entry point
wait
Execution stopped in SVC mode at N:0x00000000
N:0x00000000 69,0 LDR PC, EL2_Reset_Addr
break -p "/home/caoj/DS-5-Workspace/startup_Cortex-R52/startup.s":206
Breakpoint 2 at N:0x00002890
on file startup.s, line 206
condition 2
break-script 2 ""
ignore 2 0
break-stop-on-cores 2
unsilence 2
Breakpoint 2 unsilenced
add-symbol-file "${workspace_loc:/startup_Cortex-R52/startup_Cortex-R52.axf}" N:0
ERROR(ITR575): Symbols for image /home/caoj/DS-5-Workspace/startup_Cortex-R52/startup_Cortex-R52.axf are already loaded at offset N:0x00000000
wait
continue
interrupt
Execution stopped in UND mode at N:0x000000A0
N:0x000000A0 149,0 B EL1_Undefined_Handler

''

I tried do it on console, it is successful to print out the result same as the readme.

$ FVP_BaseR_Cortex-R52x1 -a startup_Cortex-R52.axf
terminal_2: Listening for serial connection on port 5004
terminal_3: Listening for serial connection on port 5005
terminal_1: Listening for serial connection on port 5006
terminal_0: Listening for serial connection on port 5007
ERROR:
Default Memory Map Error: Invalid json format.

Cortex-R52 bare-metal startup example
Floating point calculation using the software floating point library (no FPU)...
Float result is 0.937500
Float result should be 0.937500
Insertion sort took 3 clock ticks
Shell sort took 5 clock ticks
Quick sort took 0 clock ticks

Can anyone help me on this issue, thanks.

Parents
  • Hello - I tested both with the example project from DS-5 5.29.2, and the latest Arm Development Studio, and it executed correctly (as you see from the command line).

    I note when you load the image it loads to the Normal World (N: prefix on the address)

    Execution stopped in SVC mode at N:0x00000000

    The image should start in Hypervisor mode (H:), as it does for me:

    Execution stopped in SVC mode at H:0x00000000

    That would explain the exception, but I do not know why the FVP would not start in Hypervisor mode. Which version of the tools do you have installed?

Reply
  • Hello - I tested both with the example project from DS-5 5.29.2, and the latest Arm Development Studio, and it executed correctly (as you see from the command line).

    I note when you load the image it loads to the Normal World (N: prefix on the address)

    Execution stopped in SVC mode at N:0x00000000

    The image should start in Hypervisor mode (H:), as it does for me:

    Execution stopped in SVC mode at H:0x00000000

    That would explain the exception, but I do not know why the FVP would not start in Hypervisor mode. Which version of the tools do you have installed?

Children
  • Hi Ronan,

    Thanks for your prompt reply. I was using the DS-5 v5.29.1 which host is linux 64bit, Ubuntu 18.04.

    I think you are finding the root cause. How could I suppose to change the SVC mode to Hypervisor?

    Thanks,

    Peter

  • Are you using the debug config supplied, or are you creating your own?

    Could you provide the complete output from the Commands pane from the connection?

  • Yes, its debug config supplied.

    `

    Connected to stopped target ARM FVP - BaseR_R52x1
    cd "/home/peter/DS-5-Workspace"
    Working directory "/home/peter/DS-5-Workspace"
    loadfile "/home/peter/DS-5-Workspace/startup_Cortex-R52/startup_Cortex-R52.axf"
    Execution stopped in UND mode at N:0x000000A0
    N:0x000000A0 B {pc} ; 0xa0
    Loaded section CODE: N:0x00000000 ~ N:0x00002E03 (size 0x2E04)
    Loaded section DATA: N:0x00008000 ~ N:0x0000800F (size 0x10) at N:0x00002E04
    Entry point N:0x00000000
    Semihosting server socket created at port 8000
    WARNING(TAB362): AArch32 semihosting on Armv8-A/R requires using HLT-based semihosting or a user-specified vector address
    Semihosting enabled automatically due to semihosting symbol detected in image 'startup_Cortex-R52.axf'
    set debug-from *$ENTRYPOINT
    start
    Starting target with image /home/peter/DS-5-Workspace/startup_Cortex-R52/startup_Cortex-R52.axf
    Running from entry point
    wait
    Execution stopped in SVC mode at N:0x00000000
    N:0x00000000 69,0 LDR PC, EL2_Reset_Addr
    add-symbol-file "${workspace_loc:/startup_Cortex-R52/startup_Cortex-R52.axf}" N:0
    ERROR(ITR575): Symbols for image /home/peter/DS-5-Workspace/startup_Cortex-R52/startup_Cortex-R52.axf are already loaded at offset N:0x00000000

    `

  • It seems to be executing some (garbage) code before your code gets downloaded

    > Execution stopped in UND mode at N:0x000000A0

    Please go into Debug Configurations, and verify that the settings are the same as below.

  • Thanks Ronan, you are right. I reset the system and re-open the DS-5, it worked. Seems some process or service of DS-5 will not be closed when close the DS-5 studio only.

  • Hi Peter, glad this is working for you. Was this a one-off, or does it happen repeatedly? The debugger should terminate the FVP executable upon disconnect.

    FWIW, DS-5 is an older toolchain, and technically does not support 18.04. If you are currently evaluating tools, I would recommend you look at our new Arm Development Studio, which is the best choice going forwards. You can download a 30-day evaluation from here (and this does officially support 18.04).

    Happy to answer any questions you may have - feel free to send me a private message if more appropriate.