The Morello Edition of Development Studio user guide states: “If you are debugging code on the Arm Morello System Development Platform, you can either use the embedded debug probe on the board, or you can attach one of the supported debug hardware probes.”
How do you use the embedded debug probe on the board to connect to Development Studio for bare-metal development and debugging? And what are the steps to follow?
A USB debug cable to the host computer came with the Morello hardware. I have used this to talk to the com ports and set up time/date as per the set up instructions. Is the embedded debug accessed via this same cable?
Also to set up a hardware debug connection (instead of model connection to FVP) in Development Studio, it seems to require hardware packs to be downloaded, is there one available for Morello?, is it required for the embedded debug?
Hello, I'm a beginner trying to debug a baremetal application running on the Morello board.I followed the "User Guide" and "Running a standalone baremetal application" documents from release1.4. I created the "fip.bin" from "helloworld" executable, and copied it to "SOFTWARE" directory of storage device that pops up after plugging Debug USB cable. The AP port prints "hello" correctly. In Arm Development Studio 2022.0M0 I followed steps from the answer to the original question and I was able to view the following:
Below is the configuration I used:
I can see that some information is outputted like disassembly, memory contents, and registers. But there are errors and warnings in the "Commnads" tab like:
"ERROR(CMD16-COR107): ! Failed to load "helloworld"! Unable to detect image type of file "/home/michal/morello_board/standalone_build/helloworld/helloworld""
"WARNING(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 entrypoint"
Do you know what I may be doing wrong?
Also, should I somehow modify the compilation commands to output a file with symbols?
I assume that typically in IDE like this, it is possible to compile a program, set a breakpoint, run the program (possibly on external hardware), examine its state during a breakpoint and then proceed with execution, stepping line by line. Is such "line by line stepping" possible using Arm Development Studio 2022.0M0 and Morello board?
Thank you in advance.
Hi MichalThe errors you see coming from the Arm DS Debugger are because it is expecting an ELF image, possibly containing DWARF debug information.The "helloworld" binary generated by the llvm-objcopy step is a plain binary, with no ELF wrapper or DWARF debug information.An ELF version of the image is generated by the link step, but it looks like that is being overwritten by the objcopy step.You'll need to:- add "-g" to the compile step to add debug information- change the output filename of the link and/or objcopy step, so that both helloworld.elf and helloworld (.bin) are generated- rebuildThe helloworld binary is already loaded on the target, so there is no need for you to tell the debugger to load it too, however, you will need to load the debug symbols into the debugger, so add helloworld.elf into the "Load symbols from file" option in the debug configuration.To avoid the helloworld binary from completing execution before you've had a chance to connect the debugger, you may need to add a branch-to self loop into the beginning of it. Then, after connecting the debugger, you can stop, set the PC to the next instruction, and then continue running.Please also take a look at https://community.arm.com/support-forums/f/morello-forum/52905/how-to-load-a-bare-metal-el3-program-onto-the-hardwareandhttps://community.arm.com/support-forums/f/morello-forum/52923/baremetal-tfa-payload-built-for-capability-mode-still-in-pstate-a64-on-el2-entry
Hope this helpsStephen
Thank you, I followed the steps but it seems there is "unsupported ELF file" issue
I used the following commands to create the elf file:
$TOOLCHAIN/bin/clang -target aarch64-none-elf -c $PROGRAM_NAME.c -o $PROGRAM_NAME.o -O3 -g$TOOLCHAIN/bin/ld.lld -o $PROGRAM_NAME.elf -T link_scripts.ld.S $PROGRAM_NAME.o -s
Where "TOOLCHAIN" leads to "baremetal-release-1.4" branch of llvm-project-releases. I'm using ARM Development Studio version 2022.0M0 (build 202200006).
Do you know what may be the reason for this error?
Hi MichalIt looks like you have accidentally connected to the Cortex-M3 core, and are trying to download an AARCH64 image to it. That won't work :) Try connecting to the Morello core 0 instead.Stephen