arm-embedded / gcc-arm-none-eabi.debian

Bare metal compiler for embedded ARM chips using Cortex-A/R/M debianization
4 stars 3 forks source link

How to actually use qemu/semihosting #1

Open domenpk opened 7 years ago

domenpk commented 7 years ago

I spend a bit of time struggling with this, and I was surprised I couldn't find a nice resource online, so these are minimum changes I needed to run it.

First realise that qemu needs a "machine" and that defines memory layout (-M none, or -machine none will not work, although you really need an "empty" machine for this test). I see three compatible with arm-cortex-m3 (also m0, since m3 is binary compatible with it) in qemu 2.8: netduino2, lm3s6965evb and lm3s811evb.

Changes needed

-LFLAGS=$(USE_NANO) $(USE_SEMIHOST) $(GC) $(MAP) +LFLAGS=$(USE_NANO) $(USE_SEMIHOST) $(GC) $(MAP) -T nokeep.ld

-$(NAME)-$(CORE).axf: $(NAME).c +$(NAME)-$(CORE).axf: $(NAME).c $(STARTUP) $(CC) $^ $(CFLAGS) $(LFLAGS) -o $@

clean:


**How to run**

$ qemu-system-arm -machine lm3s6965evb -kernel hello-CM0.axf -monitor none -serial stdio -semihosting -nographic Hello, world!

$ qemu-system-arm -M netduino2 -cpu cortex-m0 -kernel hello-CM0.axf -monitor none -serial stdio -semihosting -nographic Hello, world!

$ qemu-system-arm -M netduino2 -cpu cortex-m3 -kernel ../qemu/hello-CM3.axf -monitor none -serial stdio -semihosting -nographic Hello, world!

ghost commented 7 years ago

qemu-arm can also be used: qemu-arm -cpu any program.axf and in debug mode with qemu-arm -cpu any -g 1234 program.axf where 1234 is the local port where the gdb stub is listening.

Then arm-none-eabi-gdb and type in target remote localhost:1234

BrendanSimon commented 6 years ago

Changing the RAM from ORIGIN = 0x10000000 to ORIGIN = 0x20000000 fixed things for me :)

And also -D__START=main

Thanks !!!

BrendanSimon commented 6 years ago

My big problem now is that "return 0" in main() is not exiting qemu. How to solve that ???

piso77 commented 5 years ago

$ qemu-system-arm -machine lm3s6965evb -kernel hello-CM0.axf -monitor none -serial stdio -semihosting -nographic qemu: fatal: Lockup: can't escalate 3 to HardFault (current priority -1)

R00=00000000 R01=00000000 R02=00000000 R03=00000000 R04=00000000 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=46c0b5d8 R14=fffffff9 R15=00000000 XPSR=40000003 -Z-- A handler FPSCR: 00000000 Aborted (core dumped)

not sure what i did wrong..

software-fool commented 4 years ago

$ qemu-system-arm -machine lm3s6965evb -kernel hello-CM0.axf -monitor none -serial stdio -semihosting -nographic qemu: fatal: Lockup: can't escalate 3 to HardFault (current priority -1)

R00=00000000 R01=00000000 R02=00000000 R03=00000000 R04=00000000 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=46c0b5d8 R14=fffffff9 R15=00000000 XPSR=40000003 -Z-- A handler FPSCR: 00000000 Aborted (core dumped)

not sure what i did wrong..

I've seen this and on an M0 I think you'll probably find it's an alignment issue. I had problems with the Application Exited SVC call constant (0x20026) not being properly aligned and got this. Whether that's your problem here I'm not sure.

Also, I've been using the -device loader,file=foo.elf to load the image which takes not of the start address in the ELF file which may make life easier.

AbhijitInamdar5 commented 3 years ago

Hi,

I did the same changes on qemu-4.2.0 its enters the machine I created but is not executing the hello world!

IN: Reset_Handler 0x0000050c: f7ff fff0 bl #0x4f0

Trace 0: 0x7f27e05ce100 [00000000/0000050c/0x110000c1] Reset_Handler R00=00000000 R01=00000000 R02=00000000 R03=00000000 R04=00000000 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=ffffffff R15=0000050c XPSR=41000000 -Z-- T priv-thread

IN: SystemInit 0x000004f0: 4770 bx lr

Linking TBs 0x7f27e05ce100 [0000050c] index 0 -> 0x7f27e05ce200 [000004f0] Trace 0: 0x7f27e05ce200 [00000000/000004f0/0x110000c1] SystemInit R00=00000000 R01=00000000 R02=00000000 R03=00000000 R04=00000000 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=000004f0 XPSR=41000000 -Z-- T priv-thread

IN: Reset_Handler 0x00000510: 4c19 ldr r4, [pc, #0x64] 0x00000512: 4d1a ldr r5, [pc, #0x68] 0x00000514: 42ac cmp r4, r5 0x00000516: da0a bge #0x52e

Trace 0: 0x7f27e05ce340 [00000000/00000510/0x110000c1] Reset_Handler R00=00000000 R01=00000000 R02=00000000 R03=00000000 R04=00000000 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=00000510 XPSR=41000000 -Z-- T priv-thread

IN: Reset_Handler 0x00000518: 6821 ldr r1, [r4] 0x0000051a: 6862 ldr r2, [r4, #4] 0x0000051c: 68a3 ldr r3, [r4, #8] 0x0000051e: 009b lsls r3, r3, #2 0x00000520: 3b04 subs r3, #4 0x00000522: bfa2 ittt ge 0x00000524: 58c8 ldrge r0, [r1, r3] 0x00000526: 50d0 strge r0, [r2, r3] 0x00000528: e7fa bge #0x520

Linking TBs 0x7f27e05ce340 [00000510] index 1 -> 0x7f27e05ce580 [00000518] Trace 0: 0x7f27e05ce580 [00000000/00000518/0x110000c1] Reset_Handler R00=00000000 R01=00000000 R02=00000000 R03=00000000 R04=000023e8 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=00000518 XPSR=81000000 N--- T priv-thread

IN: Reset_Handler 0x00000520: 3b04 subs r3, #4 0x00000522: bfa2 ittt ge 0x00000524: 58c8 ldrge r0, [r1, r3] 0x00000526: 50d0 strge r0, [r2, r3] 0x00000528: e7fa bge #0x520

Linking TBs 0x7f27e05ce580 [00000518] index 0 -> 0x7f27e05ce900 [00000520] Trace 0: 0x7f27e05ce900 [00000000/00000520/0x110000c1] Reset_Handler R00=00000000 R01=000023f4 R02=20000000 R03=00000188 R04=000023e8 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=00000520 XPSR=21000000 --C- T priv-thread Linking TBs 0x7f27e05ce900 [00000520] index 0 -> 0x7f27e05ce900 [00000520] Trace 0: 0x7f27e05ce900 [00000000/00000520/0x110000c1] Reset_Handler R00=0000039d R01=000023f4 R02=20000000 R03=00000184 R04=000023e8 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=00000520 XPSR=21000000 --C- T priv-thread

IN: Reset_Handler 0x0000052a: 340c adds r4, #0xc 0x0000052c: e7f2 b #0x514

Linking TBs 0x7f27e05ce900 [00000520] index 1 -> 0x7f27e05ceb80 [0000052a] Trace 0: 0x7f27e05ceb80 [00000000/0000052a/0x110000c1] Reset_Handler R00=00000000 R01=000023f4 R02=20000000 R03=fffffffc R04=000023e8 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=0000052a XPSR=81000000 N--- T priv-thread

IN: Reset_Handler 0x00000514: 42ac cmp r4, r5 0x00000516: da0a bge #0x52e

Linking TBs 0x7f27e05ceb80 [0000052a] index 0 -> 0x7f27e05cecc0 [00000514] Trace 0: 0x7f27e05cecc0 [00000000/00000514/0x110000c1] Reset_Handler R00=00000000 R01=000023f4 R02=20000000 R03=fffffffc R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=00000514 XPSR=01000000 ---- T priv-thread

IN: Reset_Handler 0x0000052e: 4914 ldr r1, [pc, #0x50] 0x00000530: 4a14 ldr r2, [pc, #0x50] 0x00000532: 4b15 ldr r3, [pc, #0x54] 0x00000534: 429a cmp r2, r3 0x00000536: bfbe ittt lt 0x00000538: f851 0b04 ldrlt r0, [r1], #4 0x0000053c: f842 0b04 strlt r0, [r2], #4 0x00000540: e7f8 blt #0x534

Linking TBs 0x7f27e05cecc0 [00000514] index 0 -> 0x7f27e05cee40 [0000052e] Trace 0: 0x7f27e05cee40 [00000000/0000052e/0x110000c1] Reset_Handler R00=00000000 R01=000023f4 R02=20000000 R03=fffffffc R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=0000052e XPSR=61000000 -ZC- T priv-thread

IN: Reset_Handler 0x00000534: 429a cmp r2, r3 0x00000536: bfbe ittt lt 0x00000538: f851 0b04 ldrlt r0, [r1], #4 0x0000053c: f842 0b04 strlt r0, [r2], #4 0x00000540: e7f8 blt #0x534

Linking TBs 0x7f27e05cee40 [0000052e] index 0 -> 0x7f27e05cf180 [00000534] Trace 0: 0x7f27e05cf180 [00000000/00000534/0x110000c1] Reset_Handler R00=00000000 R01=000023f8 R02=20000004 R03=2000018c R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=00000534 XPSR=81000000 N--- T priv-thread Linking TBs 0x7f27e05cf180 [00000534] index 0 -> 0x7f27e05cf180 [00000534] Trace 0: 0x7f27e05cf180 [00000000/00000534/0x110000c1] Reset_Handler R00=00000000 R01=000023fc R02=20000008 R03=2000018c R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=00000534 XPSR=81000000 N--- T priv-thread

IN: Reset_Handler 0x00000542: 4b12 ldr r3, [pc, #0x48] 0x00000544: 4c12 ldr r4, [pc, #0x48] 0x00000546: 42a3 cmp r3, r4 0x00000548: da09 bge #0x55e

Linking TBs 0x7f27e05cf180 [00000534] index 1 -> 0x7f27e05cf400 [00000542] Trace 0: 0x7f27e05cf400 [00000000/00000542/0x110000c1] Reset_Handler R00=00000000 R01=00002580 R02=2000018c R03=2000018c R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=00000542 XPSR=61000000 -ZC- T priv-thread

IN: Reset_Handler 0x0000055e: 490d ldr r1, [pc, #0x34] 0x00000560: 4a0d ldr r2, [pc, #0x34] 0x00000562: 2000 movs r0, #0 0x00000564: 4291 cmp r1, r2 0x00000566: bfbc itt lt 0x00000568: f841 0b04 strlt r0, [r1], #4 0x0000056c: e7fa blt #0x564

Linking TBs 0x7f27e05cf400 [00000542] index 0 -> 0x7f27e05cf640 [0000055e] Trace 0: 0x7f27e05cf640 [00000000/0000055e/0x110000c1] Reset_Handler R00=00000000 R01=00002580 R02=2000018c R03=000023f4 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=0000055e XPSR=61000000 -ZC- T priv-thread

IN: Reset_Handler 0x00000564: 4291 cmp r1, r2 0x00000566: bfbc itt lt 0x00000568: f841 0b04 strlt r0, [r1], #4 0x0000056c: e7fa blt #0x564

Linking TBs 0x7f27e05cf640 [0000055e] index 0 -> 0x7f27e05cf900 [00000564] Trace 0: 0x7f27e05cf900 [00000000/00000564/0x110000c1] Reset_Handler R00=00000000 R01=20000190 R02=20000264 R03=000023f4 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=00000564 XPSR=81000000 N--- T priv-thread Linking TBs 0x7f27e05cf900 [00000564] index 0 -> 0x7f27e05cf900 [00000564] Trace 0: 0x7f27e05cf900 [00000000/00000564/0x110000c1] Reset_Handler R00=00000000 R01=20000194 R02=20000264 R03=000023f4 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=00000564 XPSR=81000000 N--- T priv-thread

IN: Reset_Handler 0x0000056e: f7ff ff4b bl #0x408

Linking TBs 0x7f27e05cf900 [00000564] index 1 -> 0x7f27e05cfb00 [0000056e] Trace 0: 0x7f27e05cfb00 [00000000/0000056e/0x110000c1] Reset_Handler R00=00000000 R01=20000264 R02=20000264 R03=000023f4 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000511 R15=0000056e XPSR=61000000 -ZC- T priv-thread

IN: _mainCRTStartup 0x00000408: 2016 movs r0, #0x16 0x0000040a: a131 adr r1, #0xc4 0x0000040c: beab bkpt #0xab

Linking TBs 0x7f27e05cfb00 [0000056e] index 0 -> 0x7f27e05cfc00 [00000408] Trace 0: 0x7f27e05cfc00 [00000000/00000408/0x110000c1] _mainCRTStartup R00=00000000 R01=20000264 R02=20000264 R03=000023f4 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000573 R15=00000408 XPSR=61000000 -ZC- T priv-thread Taking exception 16 [Semihosting call] ...handling as semihosting call 0x16

IN: _mainCRTStartup 0x0000040e: 4830 ldr r0, [pc, #0xc0] 0x00000410: 6841 ldr r1, [r0, #4] 0x00000412: 2900 cmp r1, #0 0x00000414: d001 beq #0x41a

Trace 0: 0x7f27e05cfd40 [00000000/0000040e/0x110000c1] _mainCRTStartup R00=00000000 R01=000004d0 R02=20000264 R03=000023f4 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000573 R15=0000040e XPSR=21000000 --C- T priv-thread

IN: _mainCRTStartup 0x00000416: 4a35 ldr r2, [pc, #0xd4] 0x00000418: 6011 str r1, [r2] 0x0000041a: 6801 ldr r1, [r0] 0x0000041c: 2900 cmp r1, #0 0x0000041e: d101 bne #0x424

Linking TBs 0x7f27e05cfd40 [0000040e] index 1 -> 0x7f27e05cff40 [00000416] Trace 0: 0x7f27e05cff40 [00000000/00000416/0x110000c1] _mainCRTStartup R00=20000000 R01=08000000 R02=20000264 R03=000023f4 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000573 R15=00000416 XPSR=21000000 --C- T priv-thread

IN: _mainCRTStartup 0x00000424: 6881 ldr r1, [r0, #8] 0x00000426: 68c2 ldr r2, [r0, #0xc] 0x00000428: 2900 cmp r1, #0 0x0000042a: d000 beq #0x42e

Linking TBs 0x7f27e05cff40 [00000416] index 0 -> 0x7f27e05d0180 [00000424] Trace 0: 0x7f27e05d0180 [00000000/00000424/0x110000c1] _mainCRTStartup R00=20000000 R01=04000000 R02=2000017c R03=000023f4 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000573 R15=00000424 XPSR=21000000 --C- T priv-thread

IN: _mainCRTStartup 0x0000042c: 468d mov sp, r1 0x0000042e: 2a00 cmp r2, #0 0x00000430: d001 beq #0x436

Linking TBs 0x7f27e05d0180 [00000424] index 1 -> 0x7f27e05d0380 [0000042c] Trace 0: 0x7f27e05d0380 [00000000/0000042c/0x110000c1] _mainCRTStartup R00=20000000 R01=08000000 R02=00000000 R03=000023f4 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=20002000 R14=00000573 R15=0000042c XPSR=21000000 --C- T priv-thread

IN: _mainCRTStartup 0x00000436: 2100 movs r1, #0 0x00000438: 468b mov fp, r1 0x0000043a: 460f mov r7, r1 0x0000043c: 4825 ldr r0, [pc, #0x94] 0x0000043e: 4a26 ldr r2, [pc, #0x98] 0x00000440: 1a12 subs r2, r2, r0 0x00000442: f001 f87c bl #0x153e

Linking TBs 0x7f27e05d0380 [0000042c] index 0 -> 0x7f27e05d0500 [00000436] Trace 0: 0x7f27e05d0500 [00000000/00000436/0x110000c1] _mainCRTStartup R00=20000000 R01=08000000 R02=00000000 R03=000023f4 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=08000000 R14=00000573 R15=00000436 XPSR=61000000 -ZC- T priv-thread

IN: memset 0x0000153e: 4603 mov r3, r0 0x00001540: 4402 add r2, r0 0x00001542: 4293 cmp r3, r2 0x00001544: d100 bne #0x1548

Trace 0: 0x7f27e05d0740 [00000000/0000153e/0x110000c1] memset R00=2000018c R01=00000000 R02=000000d8 R03=000023f4 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=08000000 R14=00000447 R15=0000153e XPSR=21000000 --C- T priv-thread

IN: memset 0x00001548: f803 1b01 strb r1, [r3], #1 0x0000154c: e7f9 b #0x1542

Linking TBs 0x7f27e05d0740 [0000153e] index 0 -> 0x7f27e05d08c0 [00001548] Trace 0: 0x7f27e05d08c0 [00000000/00001548/0x110000c1] memset R00=2000018c R01=00000000 R02=20000264 R03=2000018c R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=08000000 R14=00000447 R15=00001548 XPSR=81000000 N--- T priv-thread

IN: memset 0x00001542: 4293 cmp r3, r2 0x00001544: d100 bne #0x1548

Linking TBs 0x7f27e05d08c0 [00001548] index 0 -> 0x7f27e05d0a40 [00001542] Trace 0: 0x7f27e05d0a40 [00000000/00001542/0x110000c1] memset R00=2000018c R01=00000000 R02=20000264 R03=2000018d R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=08000000 R14=00000447 R15=00001542 XPSR=81000000 N--- T priv-thread Linking TBs 0x7f27e05d0a40 [00001542] index 0 -> 0x7f27e05d08c0 [00001548] Trace 0: 0x7f27e05d08c0 [00000000/00001548/0x110000c1] memset R00=2000018c R01=00000000 R02=20000264 R03=2000018d R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=08000000 R14=00000447 R15=00001548 XPSR=81000000 N--- T priv-thread

IN: memset 0x00001546: 4770 bx lr

Linking TBs 0x7f27e05d0a40 [00001542] index 1 -> 0x7f27e05d0bc0 [00001546] Trace 0: 0x7f27e05d0bc0 [00000000/00001546/0x110000c1] memset R00=2000018c R01=00000000 R02=20000264 R03=20000264 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=08000000 R14=00000447 R15=00001546 XPSR=61000000 -ZC- T priv-thread

IN: _mainCRTStartup 0x00000446: f001 f9bb bl #0x17c0

Trace 0: 0x7f27e05d0d00 [00000000/00000446/0x110000c1] _mainCRTStartup R00=2000018c R01=00000000 R02=20000264 R03=20000264 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=08000000 R14=00000447 R15=00000446 XPSR=61000000 -ZC- T priv-thread

IN: initialise_monitor_handles 0x000017c0: e92d 47ff push.w {r0, r1, r2, r3, r4, r5, r6, r7, r8, sb, sl, lr} 0x000017c4: f04f 0803 mov.w r8, #3 0x000017c8: 2300 movs r3, #0 0x000017ca: f8df 9094 ldr.w sb, [pc, #0x94] 0x000017ce: 2401 movs r4, #1 0x000017d0: f8cd 9004 str.w sb, [sp, #4] 0x000017d4: af01 add r7, sp, #4 0x000017d6: f8cd 800c str.w r8, [sp, #0xc] 0x000017da: 9302 str r3, [sp, #8] 0x000017dc: 4620 mov r0, r4 0x000017de: 4639 mov r1, r7 0x000017e0: beab bkpt #0xab

Trace 0: 0x7f27e05d0e00 [00000000/000017c0/0x110000c1] initialise_monitor_handles R00=2000018c R01=00000000 R02=20000264 R03=20000264 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=08000000 R14=0000044b R15=000017c0 XPSR=61000000 -ZC- T priv-thread Taking exception 4 [Data Abort] ...with CFSR.PRECISERR and BFAR 0x7ffffd0 ...BusFault with BFSR.STKERR ...taking pending nonsecure exception 3

IN: HardFault_Handler 0x00000572: e7fe b #0x572

Trace 0: 0x7f27e05d1480 [00000000/00000572/0x312000c1] HardFault_Handler R00=2000018c R01=00000000 R02=20000264 R03=20000264 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=07ffffe0 R14=fffffff9 R15=00000572 XPSR=61000003 -ZC- T handler Linking TBs 0x7f27e05d1480 [00000572] index 0 -> 0x7f27e05d1480 [00000572] Trace 0: 0x7f27e05d1480 [00000000/00000572/0x312000c1] HardFault_Handler R00=2000018c R01=00000000 R02=20000264 R03=20000264 R04=000023f4 R05=000023f4 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=07ffffe0 R14=fffffff9 R15=00000572 XPSR=61000003 -ZC- T handler

AbhijitInamdar5 commented 3 years ago

I am trying this on arm cortex-m3. Memory is same as yours and in addition heap and stack is 0 and 0xc00 respectively. Can any suggest me what else changes to be made.

AbhijitInamdar5 commented 3 years ago

Did anyone try qemu/semihosting on qemu-4.2.0?