我研究了如何在PX4
上设置QEMU
。
在创建stm32f427
板之前,我先设置stm32-p103
提供的板QEMU
并将内核映像用作由PX4 firmware.
获得的.elf文件>
./arm-softmmu/qemu-system-arm -M stm32-p103 -cpu cortex-m4 -kernel ~/src/Firmware/build/nuttx_px4fmu-v2_default/nuttx_px4fmu-v2_default.elf -gdb tcp::9000
但是一旦开始,它就会挂起。
使用arm-none-eabi-gdb
,我检查了问题所在,发现它停止在__start.
的第一条指令上
arm-none-eabi-gdb nuttx_px4fmu-v2_default.
我认为,如果CPU规格和板卡不适合该固件,但仍未启动,它将可以使用。
请帮助我...
这是我的代码:
Breakpoint 1, __start ()
at chip/stm32_start.c:243
243 {
(gdb) disassemble
Dump of assembler code for function __start:
=> 0x080041cc <+0>: push {r3, lr}
0x080041ce <+2>: bl 0x800424c <stm32_clockconfig>
0x080041d2 <+6>: mrs r3, CONTROL
0x080041d6 <+10>: orr.w r3, r3, #4
0x080041da <+14>: msr CONTROL, r3
0x080041de <+18>: ldr r2, [pc, #84] ; (0x8004234 <__start+104>)
0x080041e0 <+20>: ldr r3, [r2, #0]
0x080041e2 <+22>: bic.w r3, r3, #3221225472; 0xc0000000
0x080041e6 <+26>: str r3, [r2, #0]
0x080041e8 <+28>: sub.w r2, r2, #428 ; 0x1ac
0x080041ec <+32>: ldr r3, [r2, #0]
0x080041ee <+34>: orr.w r3, r3, #15728640 ; 0xf00000
0x080041f2 <+38>: str r3, [r2, #0]
0x080041f4 <+40>: bl 0x80045b4 <stm32_lowsetup>
0x080041f8 <+44>: bl 0x80043b4 <stm32_gpioinit>
0x080041fc <+48>: ldr r3, [pc, #56] ; (0x8004238 <__start+108>)
0x080041fe <+50>: ldr r2, [pc, #60] ; (0x800423c <__start+112>)
0x08004200 <+52>: movs r1, #0
0x08004202 <+54>: cmp r3, r2
0x08004204 <+56>: bcc.n 0x8004222 <__start+86>
0x08004206 <+58>: ldr r2, [pc, #56] ; (0x8004240 <__start+116>)
0x08004208 <+60>: ldr r3, [pc, #56] ; (0x8004244 <__start+120>)
0x0800420a <+62>: ldr r1, [pc, #60] ; (0x8004248 <__start+124>)
0x0800420c <+64>: cmp r3, r1
0x0800420e <+66>: bcc.n 0x8004228 <__start+92>
0x08004210 <+68>: bl 0x8004c68 <up_earlyserialinit>
0x08004214 <+72>: bl 0x80a465c <stm32_boardinitialize>
0x08004218 <+76>: movw r1, #750 ; 0x2ee
0x0800421c <+80>: ldr r0, [pc, #28] ; (0x800423c <__start+112>)
0x0800421e <+82>: bl 0x80041a8 <go_os_start>
0x08004222 <+86>: str.w r1, [r3], #4
0x08004226 <+90>: b.n 0x8004202 <__start+54>
0x08004228 <+92>: ldr.w r0, [r2, #4]!
0x0800422c <+96>: str.w r0, [r3], #4
0x08004230 <+100>: b.n 0x800420c <__start+64>
0x08004232 <+102>: nop
<tinue, or q <return> to quit---
0x08004234 <+104>: and lr, r0, r4, lsr pc
0x08004238 <+108>: andcs r0, r0, r0, lsl #28
0x0800423c <+112>: andcs r5, r0, r8, lsl r10
0x08004240 <+116>: stmdaeq pc, {r2, r3, r4, r5, r9, r11, lr, pc} ; <UNPREDICTABLE>
0x08004244 <+120>: andcs r0, r0, r0
0x08004248 <+124>: andcs r0, r0, r9, lsr #27
End of assembler dump.