We are trying to setup semihosting with a new Cortex-A32 SoC.
We are using gcc-arm-none-eabi v9.X to compile a bare-metal "hello world".
Does ARM DS 2020.1 support semihosting out-of-the-box for Cortex-A32 bare-metal application compiled with the abovementioned GCC?
We have enable semihosting with CLI, and when we step, we can observed SVC handler getting called.
But the App Console is not showing any of the printf().
Anything that we need to take care of specifically for Cortex-A32? This is a AArch32-only ARMv8 core.
Thanks Stephen for your detailed description!
After some tracing, we managed to narrow down the root cause, which we wish to share with the community here.
1. We have a typo error in our startup.S; it was jumping to main directly instead of jumping to mainCRTStartup.
#if 0 ldr r0, =main #else ldr r0, =_mainCRTStartup #endif
2. We added the follow CLI, per 2020.1 documentation:
set semihosting vector 0x10000040
PS: our SVC trap is located at 0x10000040
We had overlooked the user guide mentioning that AArch32 on ARMv8 is different vs ARMv7, which needs to use the above mentioned mechanism in order for debugger to trap semihosting calls.
3. From our earlier experience in DS5 with FVP (ARMv7 core), added the first 4 statements below before enabling semihosting (otherwise semihosting does not work properly it seems):
set semihosting stack-base 0 set semihosting stack-limit 0 set semihosting heap-base 0 set semihosting heap-limit 0 set semihosting enabled on
PS: We are not very sure about the exact result why; it seems with the above, debugger will get these from _mainCRTStartup()?
Kahho
Regards.
Hi Kahho,
Glad to hear you have this working now. Thanks for letting us know, and sharing with the Community :)
Stephen