Hello,
I am running baremetal programs on FVP. I compiled using llvm toolchain with baremetal support and created the .axf binaries under the debug directory of the project folder. This .axf executable Is something I like to test on morello board without any OS environment. when I tried to run the .axf binary on the board using the ARM development studio IDE morello edition, under the run> debug config> made the settings and when I I started debugging it gets stuck at the HLT instruction (when performing debug from symbol) or starting from the initial address and going into an infinite loop when starting from entry point. while on the terminal console I couldn't see the output of the printf statement which i was expecting. even if I try to run directly or debug it step by step. (the program is correct because I already tested on FVP) ..I am being redirected to the debug configuration. and iterating thru the same process as described without seeing the actual output on the terminal which I configured with the /dev/ttyusb2 115200 command. Any suggestions please.
I have also used the semihosting code
set semihosting heap-base 0set semihosting heap-limit 0x80800000set semihosting stack-limit 0x80800000set semihosting stack-base 0x81000000set semihosting enabled on
Hi againWhat happens when you carefully single-step at instruction-level from _start, one instruction at a time? Does the HLT instruction get executed? Again, please attach a copy of the text from the Commands view, from the beginning to where the exception occurs.See also this post which looks similar to your situation:community.arm.com/.../program-gets-stuck-in-_start-crt0-on-morello-hardware-on-angel-command-dissassembled-to-hlt-0xf000-at-el2The addresses for stack and heap should be ok as a starting point, but it is ultimately up to you to decide on where you want to place the stack and heap, within the constraints of the memory system.Did you try adding:set semihosting vector ADDR EL2N:0x200If you are still stuck, it might be a good idea to start with a simpler project, which doesn't use semihosting:git.morello-project.org/.../standalone-baremetal-readme.rstStephen
Hello Stephen,
here I am including the copy of the text from the command view where the program below is getting halted as shown in the pic below. Here also I am not using semihosting, but the problem still persists.
======================================
#include <stdio.h>#include <stdlib.h>#define PLAT_ARM_BOOT_UART_BASE 0x2A400000volatile char * ptr = (volatile char*) PLAT_ARM_BOOT_UART_BASE;int main(){ *ptr='h'; *ptr='e'; *ptr='l'; *ptr='l'; *ptr='o'; while (1); return 0;}
=============================================
================ Command view =================================================
Connected to stopped target Arm - Morello SDPcd "/home/sanu/developmentstudio-workspace_2"Working directory "/home/sanu/developmentstudio-workspace_2"Execution stopped in EL2h mode at EL2N:0x0000000000000200loadfile "/home/sanu/developmentstudio-workspace_2/Proj_HelloWorld/Debug/Proj_HelloWorld.elf"EL2N:0x0000000000000200 UDF #0Loaded section .rela.dyn: EL2N:0x0000000080000200 ~ EL2N:0x0000000080001E1F (size 0x1C20)Loaded section .rodata: EL2N:0x0000000080001E20 ~ EL2N:0x0000000080001E3F (size 0x20)Loaded section .text: EL2N:0x0000000080012000 ~ EL2N:0x00000000800184BB (size 0x64BC)Loaded section .init: EL2N:0x00000000800184BC ~ EL2N:0x00000000800184EF (size 0x34)Loaded section .fini: EL2N:0x00000000800184F0 ~ EL2N:0x0000000080018523 (size 0x34)Loaded section .data.rel.ro: EL2N:0x0000000080028530 ~ EL2N:0x00000000800285AF (size 0x80)Loaded section .init_array: EL2N:0x00000000800285B0 ~ EL2N:0x00000000800285BF (size 0x10)Loaded section .got: EL2N:0x00000000800285C0 ~ EL2N:0x00000000800287BF (size 0x200)Loaded section .data: EL2N:0x0000000080039000 ~ EL2N:0x000000008003CDD1 (size 0x3DD2)Loaded section .data.rel.ro: EL2N:0x0000000080028530 ~ EL2N:0x00000000800285AF (size 0x80)Loaded section .init_array: EL2N:0x00000000800285B0 ~ EL2N:0x00000000800285BF (size 0x10)Loaded section .got: EL2N:0x00000000800285C0 ~ EL2N:0x00000000800287BF (size 0x200)Entry point EL2N:0x0000000080012000add-symbol-file "/home/sanu/developmentstudio-workspace_2/Proj_HelloWorld/Debug/Proj_HelloWorld.elf"ERROR(ITR575): Symbols for image /home/sanu/developmentstudio-workspace_2/Proj_HelloWorld/Debug/Proj_HelloWorld.elf are already loaded at offset EL2N:0x0000000000000000set debug-from *$ENTRYPOINTstartStarting target with image /home/sanu/developmentstudio-workspace_2/Proj_HelloWorld/Debug/Proj_HelloWorld.elfRunning from entry pointwaitExecution stopped in EL2h mode at EL2N:0x0000000080012000In _start (no debug info)EL2N:0x0000000080012000 ADR x1,#0x280waitstepiExecution stopped in EL2h mode at EL2N:0x0000000080012004EL2N:0x0000000080012004 MOV w0,#0x16waitstepiExecution stopped in EL2h mode at EL2N:0x0000000080012008EL2N:0x0000000080012008 HLT #0xf000waitstepiExecution stopped in EL2h mode due to a breakpoint or watchpoint: EL2N:0x0000000080012008EL2N:0x0000000080012008 HLT #0xf000
========================================================================================================
GUI:
Debug Config view and selected debug from entry point.
I am using the compiler path as shown below:
with the C build settings for the project
For reference, I am also enclosing the contents of the header section of the elf file that is being generated.
I am not sure why this problem still persists. Is there any step where I am making a mistake please?