-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot get past reset with the blinky example. #263
Comments
Just a quick guess, do you need the feature stm32h743v instead of stm32h743?
ST made some major changes with revision V, so only the first 10 months or
so of production would use the original feature stm32h743, all newer parts
need stm32h743v instead.
The rev V parts have a V printed near the end of the part number, check the
datasheet for how to tell the difference for your package.
…On Mon, Oct 18, 2021, 3:26 AM Matous Hybl ***@***.***> wrote:
Hi, I am trying to start developing for the STM32H743, using the weact H7
board (https://github.com/WeActTC/MiniSTM32H7xx) but I am having trouble
even with the blinky example. From my understanding, the program panics
during the initialization phase and goes to a fault.
I am compiling the example like this:
cargo build --example blinky --features="stm32h743 rt log-semihost example-ldo"
Then I run the gdb:
arm-none-eabi-gdb -q target/thumbv7em-none-eabihf/debug/examples/blinky
Reading symbols from target/thumbv7em-none-eabihf/debug/examples/blinky...
(gdb) target extended-remote :3333
Remote debugging using :3333
0x080002aa in Reset ()
(gdb) monitor arm semihosting enable
semihosting is enabled
(gdb) break main
Breakpoint 1 at 0x8001574: file examples/blinky.rs, line 14.
Note: automatically using hardware breakpoints for read-only addresses.
(gdb) next
Single stepping until exit from function Reset,
which has no line number information.
halted: PC: 0x080002ac
halted: PC: 0x080002ae
halted: PC: 0x080002b0
halted: PC: 0x080002aa
halted: PC: 0x080002ac
halted: PC: 0x080002ae
halted: PC: 0x080002b0
halted: PC: 0x080002aa
halted: PC: 0x080002ac
halted: PC: 0x080002ae
halted: PC: 0x080002b0
halted: PC: 0x080002aa
halted: PC: 0x080002ac
The halted: PC ... messages keep going on forever.
Could you please help me with this issue? Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#263>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAUS5FPCKJZAIS3PXGJPCADUHPK3HANCNFSM5GGAV2PQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Thanks! Will investigate further, but I will be glad for any idea how to debug this. |
Try using step instruction Which version of |
Hi! I am using the current master. By reading the assembly and stepping using 08000298 <Reset>:
8000298: f04f 34ff mov.w r4, #4294967295 ; 0xffffffff
800029c: 46a6 mov lr, r4
800029e: f00d fe5b bl 800df58 <DefaultPreInit>
80002a2: 46a6 mov lr, r4
80002a4: 480d ldr r0, [pc, #52] ; (80002dc <Reset+0x44>)
80002a6: 490e ldr r1, [pc, #56] ; (80002e0 <Reset+0x48>)
80002a8: 2200 movs r2, #0
80002aa: 4281 cmp r1, r0
80002ac: d001 beq.n 80002b2 <Reset+0x1a>
80002ae: c004 stmia r0!, {r2}
80002b0: e7fb b.n 80002aa <Reset+0x12>
80002b2: 480c ldr r0, [pc, #48] ; (80002e4 <Reset+0x4c>)
80002b4: 490c ldr r1, [pc, #48] ; (80002e8 <Reset+0x50>)
80002b6: 4a0d ldr r2, [pc, #52] ; (80002ec <Reset+0x54>)
80002b8: 4281 cmp r1, r0
80002ba: d002 beq.n 80002c2 <Reset+0x2a>
80002bc: ca08 ldmia r2!, {r3}
80002be: c008 stmia r0!, {r3}
80002c0: e7fa b.n 80002b8 <Reset+0x20>
80002c2: 480b ldr r0, [pc, #44] ; (80002f0 <Reset+0x58>)
80002c4: f44f 0170 mov.w r1, #15728640 ; 0xf00000
80002c8: 6802 ldr r2, [r0, #0]
80002ca: 430a orrs r2, r1
80002cc: 6002 str r2, [r0, #0]
80002ce: f3bf 8f4f dsb sy
80002d2: f3bf 8f6f isb sy
80002d6: f001 f94b bl 8001570 <main> which means that it never even reaches the main function. I am currently looking for a tool that would help me analyze the assembly as I am too lazy to do it by hand and to figure out what is going on. |
That reset handler is from cortex-m-rt, which has the assembly pretty well commented: Looks like you're stuck in the loop that copies the
|
Thanks for the suggestions, I will try them tomorrow. Given that there is no build script, is there a preferred way of running the examples? cargo size reports the following memory mappings:
|
Since your sectors are all in the right place, it seems the |
Thanks for the explanation, now I understand. So after some debugging I figured out what the problem is, however I do not know the correct fix. When utilizing the memory.x script provided, the Reset assembly gets stuck in bss initialization because the __ebss is incorrectly set to address
When I utilized a simple memory.x script from embassy, the __ebss gets correctly set to the start of the .uninit section, the zeroing loop is short and the device boots without any problems.
I am not skilled enough to know what the root of this problem is, but I believe that this is a bug, maybe in cortex-m-rt. Thanks to everyone who helped me and if you've got any suggestions howto solve this, or what to try, let me know, I can try to debug it further. |
Yeah the linker script in cortex-m-rt has been really hard to get right, especially with |
I'm now also having issues when I don't remove With
So because With
Which obviously won't work. Removing the
I think we should remove the |
For more background see rust-embedded/cortex-m-rt#287 and rust-embedded/cortex-m-rt#323, but in short you're right, remove |
Hi, I am trying to start developing for the STM32H743, using the weact H7 board (https://github.com/WeActTC/MiniSTM32H7xx) but I am having trouble even with the blinky example. From my understanding, the program panics during the initialization phase and goes to a fault.
I am compiling the example like this:
Then I run the gdb:
The
halted: PC ...
messages keep going on forever.Could you please help me with this issue? Thanks!
The text was updated successfully, but these errors were encountered: