Running MicroPython on QEMU-emulated NETDUINO_PLUS_2?

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
User avatar
WZab
Posts: 25
Joined: Tue Jan 21, 2020 7:45 pm

Running MicroPython on QEMU-emulated NETDUINO_PLUS_2?

Post by WZab » Wed Jul 14, 2021 6:11 pm

I need to do some work on MicroPython without access to the real hardware (only with PC). The target will be the STM32 machine, so I've checked what QEMU may emulate and for which boards the MicroPython is available, and I have found that NETDUINO_PLUS_2 may be the good choice.

Unfortunately, when I build the MicroPython for NETDUINO_PLUS_2:

Code: Select all

make BOARD=NETDUINO_PLUS_2 MICROPY_PY_LWIP=1 
and then try to emulate it in QEMU:

Code: Select all

qemu-system-arm -machine netduinoplus2 -cpu cortex-m4 -monitor none -serial stdio -kernel build-NETDUINO_PLUS_2/firmware.elf
I get the following error:

Code: Select all

qemu-system-arm -machine netduinoplus2 -cpu cortex-m4 -monitor none -serial stdio -kernel build-NETDUINO_PLUS_2/firmware.elf
qemu-system-arm: warning: dbind: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
qemu: fatal: Lockup: can't escalate 3 to HardFault (current priority -1)

R00=ffffffe0 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=ffffffe0 R14=fffffff9 R15=0804adfc
XPSR=41000003 -Z-- T handler
s00=00000000 s01=00000000 d00=0000000000000000
s02=00000000 s03=00000000 d01=0000000000000000
s04=00000000 s05=00000000 d02=0000000000000000
s06=00000000 s07=00000000 d03=0000000000000000
s08=00000000 s09=00000000 d04=0000000000000000
s10=00000000 s11=00000000 d05=0000000000000000
s12=00000000 s13=00000000 d06=0000000000000000
s14=00000000 s15=00000000 d07=0000000000000000
s16=00000000 s17=00000000 d08=0000000000000000
s18=00000000 s19=00000000 d09=0000000000000000
s20=00000000 s21=00000000 d10=0000000000000000
s22=00000000 s23=00000000 d11=0000000000000000
s24=00000000 s25=00000000 d12=0000000000000000
s26=00000000 s27=00000000 d13=0000000000000000
s28=00000000 s29=00000000 d14=0000000000000000
s30=00000000 s31=00000000 d15=0000000000000000
FPSCR: 00000000
Aborted
Has anybody succeeded to run the MicroPython on NETDUINO_PLUS_2 emulated in QEMU?
How to fix the above problem?

TIA & Regards,
Wojtek

User avatar
WZab
Posts: 25
Joined: Tue Jan 21, 2020 7:45 pm

Re: Running MicroPython on QEMU-emulated NETDUINO_PLUS_2?

Post by WZab » Sat Jul 17, 2021 8:25 pm

I have found the following patch to the QEMU, that is supposed to fix that problem: https://patchwork.kernel.org/project/qe ... TLOOK.COM/

However it seems that it is not present in the current version of QEMU: https://elixir.bootlin.com/qemu/v6.0.0/ ... inoplus2.c
Browsing different versions of QEMU shows that the above patch has been probably never included in the official source.

User avatar
WZab
Posts: 25
Joined: Tue Jan 21, 2020 7:45 pm

Re: Running MicroPython on QEMU-emulated NETDUINO_PLUS_2?

Post by WZab » Sat Jul 17, 2021 10:00 pm

I have prepared the modification of QEMU based on the patch https://patchwork.kernel.org/project/qe ... TLOOK.COM/ .
It is available at https://github.com/wzab/qemu/commit/cd1 ... 0780215a87 .

I compile it with:

Code: Select all

./configure --target-list=arm-softmmu && make
Now the emulation does not stop, but if I switch on the debugging, another errors are reported:

Code: Select all

$/home/emb/qemu/qemu/build/arm-softmmu/qemu-system-arm -machine netduinoplus2 -cpu cortex-m4 -monitor none -serial stdio -kernel build-NETDUINO_PLUS_2/firmware.elf -d in_asm,int,exec,cpu,guest_errors,unimp

qemu-system-arm: warning: dbind: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
----------------
IN: Reset_Handler
0x08053508:  4604       mov      r4, r0
0x0805350a:  f8df d030  ldr.w    sp, [pc, #0x30]
0x0805350e:  490c       ldr      r1, [pc, #0x30]
0x08053510:  4a0c       ldr      r2, [pc, #0x30]
0x08053512:  4b0d       ldr      r3, [pc, #0x34]
0x08053514:  e003       b        #0x805351e

Trace 0: 0x7f92f8000100 [00800408/08053508/00000110/ff000000] 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=20020000 R14=ffffffff R15=08053508
XPSR=41000000 -Z-- T priv-thread
----------------
IN: Reset_Handler
0x0805351e:  429a       cmp      r2, r3
0x08053520:  d3f9       blo      #0x8053516

Linking TBs 0x7f92f8000100 [08053508] index 0 -> 0x7f92f8000380 [0805351e]
Trace 0: 0x7f92f8000380 [00800408/0805351e/00000110/ff000000] Reset_Handler
R00=00000000 R01=0807287c R02=20000000 R03=20000014
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=ffffffff R15=0805351e
XPSR=41000000 -Z-- T priv-thread
----------------
IN: Reset_Handler
0x08053516:  f851 0b04  ldr      r0, [r1], #4
0x0805351a:  f842 0b04  str      r0, [r2], #4
0x0805351e:  429a       cmp      r2, r3
0x08053520:  d3f9       blo      #0x8053516

Linking TBs 0x7f92f8000380 [0805351e] index 0 -> 0x7f92f8000500 [08053516]
Trace 0: 0x7f92f8000500 [00800408/08053516/00000110/ff000000] Reset_Handler
R00=00000000 R01=0807287c R02=20000000 R03=20000014
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=ffffffff R15=08053516
XPSR=81000000 N--- T priv-thread
Linking TBs 0x7f92f8000500 [08053516] index 0 -> 0x7f92f8000500 [08053516]
Trace 0: 0x7f92f8000500 [00800408/08053516/00000110/ff000000] Reset_Handler
R00=ffffffff R01=08072880 R02=20000004 R03=20000014
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=ffffffff R15=08053516
XPSR=81000000 N--- T priv-thread
----------------
IN: Reset_Handler
0x08053522:  2000       movs     r0, #0
0x08053524:  4909       ldr      r1, [pc, #0x24]
0x08053526:  4a0a       ldr      r2, [pc, #0x28]
0x08053528:  e001       b        #0x805352e

Linking TBs 0x7f92f8000500 [08053516] index 1 -> 0x7f92f8000740 [08053522]
Trace 0: 0x7f92f8000740 [00800408/08053522/00000110/ff000000] Reset_Handler
R00=c000c000 R01=08072890 R02=20000014 R03=20000014
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=ffffffff R15=08053522
XPSR=61000000 -ZC- T priv-thread
----------------
IN: Reset_Handler
0x0805352e:  4291       cmp      r1, r2
0x08053530:  d3fb       blo      #0x805352a

Linking TBs 0x7f92f8000740 [08053522] index 0 -> 0x7f92f8000940 [0805352e]
Trace 0: 0x7f92f8000940 [00800408/0805352e/00000110/ff000000] Reset_Handler
R00=00000000 R01=20000014 R02=20008938 R03=20000014
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=ffffffff R15=0805352e
XPSR=61000000 -ZC- T priv-thread
----------------
IN: Reset_Handler
0x0805352a:  f841 0b04  str      r0, [r1], #4
0x0805352e:  4291       cmp      r1, r2
0x08053530:  d3fb       blo      #0x805352a

Linking TBs 0x7f92f8000940 [0805352e] index 0 -> 0x7f92f8000ac0 [0805352a]
Trace 0: 0x7f92f8000ac0 [00800408/0805352a/00000110/ff000000] Reset_Handler
R00=00000000 R01=20000014 R02=20008938 R03=20000014
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=ffffffff R15=0805352a
XPSR=81000000 N--- T priv-thread
Linking TBs 0x7f92f8000ac0 [0805352a] index 0 -> 0x7f92f8000ac0 [0805352a]
Trace 0: 0x7f92f8000ac0 [00800408/0805352a/00000110/ff000000] Reset_Handler
R00=00000000 R01=20000018 R02=20008938 R03=20000014
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=ffffffff R15=0805352a
XPSR=81000000 N--- T priv-thread
----------------
IN: Reset_Handler
0x08053532:  f7ff ff63  bl       #0x80533fc

Linking TBs 0x7f92f8000ac0 [0805352a] index 1 -> 0x7f92f8000c80 [08053532]
Trace 0: 0x7f92f8000c80 [00800408/08053532/00000110/ff000000] Reset_Handler
R00=00000000 R01=20008938 R02=20008938 R03=20000014
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=ffffffff R15=08053532
XPSR=61000000 -ZC- T priv-thread
----------------
IN: SystemInit
0x080533fc:  490f       ldr      r1, [pc, #0x3c]

Trace 0: 0x7f92f8000d80 [00800408/080533fc/00000110/ff000000] SystemInit
R00=00000000 R01=20008938 R02=20008938 R03=20000014
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=08053537 R15=080533fc
XPSR=61000000 -ZC- T priv-thread
----------------
IN: SystemInit
0x080533fe:  f8d1 3088  ldr.w    r3, [r1, #0x88]

Trace 0: 0x7f92f8000f00 [00800408/080533fe/00000110/ff000000] SystemInit
R00=00000000 R01=e000ed00 R02=20008938 R03=20000014
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=08053537 R15=080533fe
XPSR=61000000 -ZC- T priv-thread
----------------
IN: SystemInit
0x08053402:  f443 0370  orr      r3, r3, #0xf00000
0x08053406:  f8c1 3088  str.w    r3, [r1, #0x88]
0x0805340a:  4b0d       ldr      r3, [pc, #0x34]
0x0805340c:  681a       ldr      r2, [r3]
0x0805340e:  2000       movs     r0, #0
0x08053410:  f042 0201  orr      r2, r2, #1
0x08053414:  601a       str      r2, [r3]
0x08053416:  6098       str      r0, [r3, #8]
0x08053418:  681a       ldr      r2, [r3]
0x0805341a:  f022 7284  bic      r2, r2, #0x1080000
0x0805341e:  f422 3280  bic      r2, r2, #0x10000
0x08053422:  601a       str      r2, [r3]
0x08053424:  4a07       ldr      r2, [pc, #0x1c]
0x08053426:  605a       str      r2, [r3, #4]
0x08053428:  681a       ldr      r2, [r3]
0x0805342a:  f422 2280  bic      r2, r2, #0x40000
0x0805342e:  601a       str      r2, [r3]
0x08053430:  60d8       str      r0, [r3, #0xc]
0x08053432:  f04f 6300  mov.w    r3, #0x8000000
0x08053436:  608b       str      r3, [r1, #8]
0x08053438:  4770       bx       lr

Trace 0: 0x7f92f8001080 [00800408/08053402/00000110/ff000000] SystemInit
R00=00000000 R01=e000ed00 R02=20008938 R03=00000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=08053537 R15=08053402
XPSR=61000000 -ZC- T priv-thread
RCC: unimplemented device read  (size 4, offset 0x000)
RCC: unimplemented device write (size 4, offset 0x000, value 0x00000001)
RCC: unimplemented device write (size 4, offset 0x008, value 0x00000000)
RCC: unimplemented device read  (size 4, offset 0x000)
RCC: unimplemented device write (size 4, offset 0x000, value 0x00000000)
RCC: unimplemented device write (size 4, offset 0x004, value 0x24003010)
RCC: unimplemented device read  (size 4, offset 0x000)
RCC: unimplemented device write (size 4, offset 0x000, value 0x00000000)
RCC: unimplemented device write (size 4, offset 0x00c, value 0x00000000)
----------------
IN: Reset_Handler
0x08053536:  4620       mov      r0, r4
0x08053538:  f7f7 baf4  b.w      #0x804ab24

Trace 0: 0x7f92f8001640 [00800408/08053536/00000010/ff000000] Reset_Handler
R00=00000000 R01=e000ed00 R02=00000000 R03=08000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=08053537 R15=08053536
XPSR=61000000 -ZC- T priv-thread
----------------
IN: stm32_main
0x0804ab24:  b570       push     {r4, r5, r6, lr}
0x0804ab26:  4c85       ldr      r4, [pc, #0x214]
0x0804ab28:  4e85       ldr      r6, [pc, #0x214]
0x0804ab2a:  f04f 6300  mov.w    r3, #0x8000000
0x0804ab2e:  60a3       str      r3, [r4, #8]
0x0804ab30:  6963       ldr      r3, [r4, #0x14]
0x0804ab32:  f443 7300  orr      r3, r3, #0x200
0x0804ab36:  b08a       sub      sp, #0x28
0x0804ab38:  6163       str      r3, [r4, #0x14]
0x0804ab3a:  4605       mov      r5, r0
0x0804ab3c:  f001 fb60  bl       #0x804c200

Trace 0: 0x7f92f8001740 [00800408/0804ab24/00000010/ff000000] stm32_main
R00=00000000 R01=e000ed00 R02=00000000 R03=08000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001fff8 R14=08053537 R15=0804ab24
XPSR=61000000 -ZC- T priv-thread
----------------
IN: powerctrl_check_enter_bootloader
0x0804c200:  4a0e       ldr      r2, [pc, #0x38]
0x0804c202:  6851       ldr      r1, [r2, #4]
0x0804c204:  b508       push     {r3, lr}
0x0804c206:  2301       movs     r3, #1
0x0804c208:  6053       str      r3, [r2, #4]
0x0804c20a:  f3c1 030b  ubfx     r3, r1, #0, #0xc
0x0804c20e:  b99b       cbnz     r3, #0x804c238

Trace 0: 0x7f92f8001bc0 [00800408/0804c200/00000010/ff000000] powerctrl_check_enter_bootloader
R00=00000000 R01=e000ed00 R02=00000000 R03=00000200
R04=e000ed00 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ffc0 R14=0804ab41 R15=0804c200
XPSR=61000000 -ZC- T priv-thread
----------------
IN: powerctrl_check_enter_bootloader
0x0804c210:  4b0b       ldr      r3, [pc, #0x2c]
0x0804c212:  6f58       ldr      r0, [r3, #0x74]
0x0804c214:  00c0       lsls     r0, r0, #3
0x0804c216:  d50f       bpl      #0x804c238

Linking TBs 0x7f92f8001bc0 [0804c200] index 1 -> 0x7f92f8001f00 [0804c210]
Trace 0: 0x7f92f8001f00 [00800408/0804c210/00000010/ff000000] powerctrl_check_enter_bootloader
R00=00000000 R01=00000000 R02=2001fff8 R03=00000000
R04=e000ed00 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ffb8 R14=0804ab41 R15=0804c210
XPSR=21000000 --C- T priv-thread
RCC: unimplemented device read  (size 4, offset 0x074)
----------------
IN: powerctrl_check_enter_bootloader
0x0804c238:  bd08       pop      {r3, pc}

Linking TBs 0x7f92f8001f00 [0804c210] index 0 -> 0x7f92f8002100 [0804c238]
Trace 0: 0x7f92f8002100 [00800408/0804c238/00000010/ff000000] powerctrl_check_enter_bootloader
R00=00000000 R01=00000000 R02=2001fff8 R03=40023800
R04=e000ed00 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ffb8 R14=0804ab41 R15=0804c238
XPSR=41000000 -Z-- T priv-thread
----------------
IN: stm32_main
0x0804ab40:  4b80       ldr      r3, [pc, #0x200]
0x0804ab42:  681a       ldr      r2, [r3]
0x0804ab44:  f442 7200  orr      r2, r2, #0x200
0x0804ab48:  601a       str      r2, [r3]
0x0804ab4a:  681a       ldr      r2, [r3]
0x0804ab4c:  f442 6280  orr      r2, r2, #0x400
0x0804ab50:  601a       str      r2, [r3]
0x0804ab52:  681a       ldr      r2, [r3]
0x0804ab54:  f442 7280  orr      r2, r2, #0x100
0x0804ab58:  601a       str      r2, [r3]
0x0804ab5a:  68e2       ldr      r2, [r4, #0xc]
0x0804ab5c:  4b7a       ldr      r3, [pc, #0x1e8]
0x0804ab5e:  f422 62e0  bic      r2, r2, #0x700
0x0804ab62:  0412       lsls     r2, r2, #0x10
0x0804ab64:  0c12       lsrs     r2, r2, #0x10
0x0804ab66:  4313       orrs     r3, r2
0x0804ab68:  60e3       str      r3, [r4, #0xc]
0x0804ab6a:  2000       movs     r0, #0
0x0804ab6c:  f7f9 f8f6  bl       #0x8043d5c

Trace 0: 0x7f92f80022c0 [00800408/0804ab40/00000010/ff000000] stm32_main
R00=00000000 R01=00000000 R02=2001fff8 R03=00000200
R04=e000ed00 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ffc0 R14=0804ab41 R15=0804ab40
XPSR=41000000 -Z-- T priv-thread
Flash Int: unimplemented device read  (size 4, offset 0x000)
Flash Int: unimplemented device write (size 4, offset 0x000, value 0x00000200)
Flash Int: unimplemented device read  (size 4, offset 0x000)
Flash Int: unimplemented device write (size 4, offset 0x000, value 0x00000400)
Flash Int: unimplemented device read  (size 4, offset 0x000)
Flash Int: unimplemented device write (size 4, offset 0x000, value 0x00000100)
----------------
IN: HAL_InitTick
0x08043d5c:  b510       push     {r4, lr}
0x08043d5e:  4b08       ldr      r3, [pc, #0x20]
0x08043d60:  4604       mov      r4, r0
0x08043d62:  6818       ldr      r0, [r3]
0x08043d64:  f44f 737a  mov.w    r3, #0x3e8
0x08043d68:  fbb0 f0f3  udiv     r0, r0, r3
0x08043d6c:  f000 fa30  bl       #0x80441d0

Trace 0: 0x7f92f80027c0 [00800408/08043d5c/00000010/ff000000] HAL_InitTick
R00=00000000 R01=00000000 R02=00000000 R03=05fa0300
R04=e000ed00 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ffc0 R14=0804ab71 R15=08043d5c
XPSR=41000000 -Z-- T priv-thread
----------------
IN: HAL_SYSTICK_Config
0x080441d0:  3801       subs     r0, #1
0x080441d2:  f1b0 7f80  cmp.w    r0, #0x1000000
0x080441d6:  d20a       bhs      #0x80441ee

Trace 0: 0x7f92f8002a80 [00800408/080441d0/00000010/ff000000] HAL_SYSTICK_Config
R00=00003e80 R01=00000000 R02=00000000 R03=000003e8
R04=00000000 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ffb8 R14=08043d71 R15=080441d0
XPSR=41000000 -Z-- T priv-thread
----------------
IN: HAL_SYSTICK_Config
0x080441d8:  4b06       ldr      r3, [pc, #0x18]
0x080441da:  4a07       ldr      r2, [pc, #0x1c]
0x080441dc:  6058       str      r0, [r3, #4]
0x080441de:  21f0       movs     r1, #0xf0
0x080441e0:  f882 1023  strb.w   r1, [r2, #0x23]
0x080441e4:  2000       movs     r0, #0
0x080441e6:  2207       movs     r2, #7
0x080441e8:  6098       str      r0, [r3, #8]
0x080441ea:  601a       str      r2, [r3]
0x080441ec:  4770       bx       lr

Linking TBs 0x7f92f8002a80 [080441d0] index 1 -> 0x7f92f8002c00 [080441d8]
Trace 0: 0x7f92f8002c00 [00800408/080441d8/00000010/ff000000] HAL_SYSTICK_Config
R00=00003e7f R01=00000000 R02=00000000 R03=000003e8
R04=00000000 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ffb8 R14=08043d71 R15=080441d8
XPSR=81000000 N--- T priv-thread
----------------
IN: HAL_InitTick
0x08043d70:  2200       movs     r2, #0
0x08043d72:  4621       mov      r1, r4
0x08043d74:  f04f 30ff  mov.w    r0, #-1
0x08043d78:  f000 f9d4  bl       #0x8044124

Trace 0: 0x7f92f8002f80 [00800408/08043d70/00000010/ff000000] HAL_InitTick
R00=00000000 R01=000000f0 R02=00000007 R03=e000e010
R04=00000000 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ffb8 R14=08043d71 R15=08043d70
XPSR=01000000 ---- T priv-thread
----------------
IN: HAL_NVIC_SetPriority
0x08044124:  4b17       ldr      r3, [pc, #0x5c]
0x08044126:  b570       push     {r4, r5, r6, lr}
0x08044128:  68dc       ldr      r4, [r3, #0xc]
0x0804412a:  f3c4 2402  ubfx     r4, r4, #8, #3
0x0804412e:  f1c4 0507  rsb.w    r5, r4, #7
0x08044132:  2d04       cmp      r5, #4
0x08044134:  f104 0304  add.w    r3, r4, #4
0x08044138:  bf28       it       hs
0x0804413a:  2504       movhs    r5, #4
0x0804413c:  f04f 36ff  mov.w    r6, #-1
0x08044140:  2b06       cmp      r3, #6
0x08044142:  fa06 f505  lsl.w    r5, r6, r5
0x08044146:  bf8c       ite      hi
0x08044148:  3c03       subhi    r4, #3
0x0804414a:  2400       movls    r4, #0
0x0804414c:  ea21 0105  bic.w    r1, r1, r5
0x08044150:  40a1       lsls     r1, r4
0x08044152:  fa06 f404  lsl.w    r4, r6, r4
0x08044156:  ea22 0304  bic.w    r3, r2, r4
0x0804415a:  2800       cmp      r0, #0
0x0804415c:  ea43 0301  orr.w    r3, r3, r1
0x08044160:  bfa8       it       ge
0x08044162:  f100 4060  addge.w  r0, r0, #-0x20000000
0x08044166:  ea4f 1303  lsl.w    r3, r3, #4
0x0804416a:  bfbc       itt      lt
0x0804416c:  f000 000f  andlt    r0, r0, #0xf
0x08044170:  4a05       ldrlt    r2, [pc, #0x14]
0x08044172:  b2db       uxtb     r3, r3
0x08044174:  bfaa       itet     ge
0x08044176:  f500 4061  addge.w  r0, r0, #0xe100
0x0804417a:  5413       strblt   r3, [r2, r0]
0x0804417c:  f880 3300  strbge.w r3, [r0, #0x300]
0x08044180:  bd70       pop      {r4, r5, r6, pc}

Trace 0: 0x7f92f80030c0 [00800408/08044124/00000010/ff000000] HAL_NVIC_SetPriority
R00=ffffffff R01=00000000 R02=00000000 R03=e000e010
R04=00000000 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ffb8 R14=08043d7d R15=08044124
XPSR=41000000 -Z-- T priv-thread
Stopped execution of TB chain before 0x7f92f80030c0 [08044124] HAL_NVIC_SetPriority
Taking exception 5 [IRQ]
...taking pending nonsecure exception 15
----------------
IN: SysTick_Handler
0x0804be94:  4b0c       ldr      r3, [pc, #0x30]
0x0804be96:  b510       push     {r4, lr}
0x0804be98:  681c       ldr      r4, [r3]
0x0804be9a:  3401       adds     r4, #1
0x0804be9c:  601c       str      r4, [r3]
0x0804be9e:  4b0b       ldr      r3, [pc, #0x2c]
0x0804bea0:  f004 0203  and      r2, r4, #3
0x0804bea4:  681b       ldr      r3, [r3]
0x0804bea6:  4b0a       ldr      r3, [pc, #0x28]
0x0804bea8:  f853 3022  ldr.w    r3, [r3, r2, lsl #2]
0x0804beac:  b10b       cbz      r3, #0x804beb2

Trace 0: 0x7f92f8003900 [00800409/0804be94/00000010/ff000000] SysTick_Handler
R00=ffffffff R01=00000000 R02=00000000 R03=e000e010
R04=00000000 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ff98 R14=fffffff9 R15=0804be94
XPSR=4100000f -Z-- T handler
----------------
IN: SysTick_Handler
0x0804beb2:  4b08       ldr      r3, [pc, #0x20]
0x0804beb4:  681b       ldr      r3, [r3]
0x0804beb6:  42a3       cmp      r3, r4
0x0804beb8:  d105       bne      #0x804bec6

Linking TBs 0x7f92f8003900 [0804be94] index 0 -> 0x7f92f8003d80 [0804beb2]
Trace 0: 0x7f92f8003d80 [00800409/0804beb2/00000010/ff000000] SysTick_Handler
R00=ffffffff R01=00000000 R02=00000001 R03=00000000
R04=00000001 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ff90 R14=fffffff9 R15=0804beb2
XPSR=0100000f ---- T handler
----------------
IN: SysTick_Handler
0x0804bec6:  bd10       pop      {r4, pc}

Linking TBs 0x7f92f8003d80 [0804beb2] index 0 -> 0x7f92f8003fc0 [0804bec6]
Trace 0: 0x7f92f8003fc0 [00800409/0804bec6/00000010/ff000000] SysTick_Handler
R00=ffffffff R01=00000000 R02=00000001 R03=00000000
R04=00000001 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ff90 R14=fffffff9 R15=0804bec6
XPSR=8100000f N--- T handler
Taking exception 8 [QEMU v7M exception exit]
Exception return: magic PC fffffff9 previous exception 15
...tailchaining to pending exception
...taking pending nonsecure exception 15
Trace 0: 0x7f92f8003900 [00800409/0804be94/00000010/ff000000] SysTick_Handler
R00=ffffffff R01=00000000 R02=00000001 R03=00000000
R04=00000000 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ff98 R14=fffffff9 R15=0804be94
XPSR=8100000f N--- T handler
Taking exception 8 [QEMU v7M exception exit]
Exception return: magic PC fffffff9 previous exception 15
...successful exception return
Trace 0: 0x7f92f80030c0 [00800408/08044124/00000010/ff000000] HAL_NVIC_SetPriority
R00=ffffffff R01=00000000 R02=00000000 R03=e000e010
R04=00000000 R05=00000000 R06=2001fbf8 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=2001ffb8 R14=08043d7d R15=08044124
XPSR=41000000 -Z-- T priv-thread
----------------
IN: HAL_InitTick
0x08043d7c:  2000       movs     r0, #0
0x08043d7e:  bd10       pop      {r4, pc}
[...]
Is it possible that now the problem is related to not emulated FLASH?

Post Reply