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?
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