I have discovered that it seems r0 is always set to 1, meaning INIT2 is never skipped.

Good day guys, this code here is part of the initialization code for a firmware of an STM32F030 microcontroller, disassembled using Radare2. It is executed after the clock initialization but before the heap setup.
0x0800335c 00f00bf8 bl fcn.08003376
0x08003360 0028 cmp r0, 0
0x08003362 01d0 beq 0x8003368
0x08003364 fff7d4ff bl INIT2
0x08003368 0020 movs r0, 0
[...]
0x08003376 0120 movs r0, 1
0x08003378 7047 bx lr
0x0800335c 00f00bf8 bl fcn.08003376
0x08003360 0028 cmp r0, 0
0x08003362 01d0 beq 0x8003368
0x08003364 fff7d4ff bl INIT2
0x08003368 0020 movs r0, 0
[...]
0x08003376 0120 movs r0, 1
0x08003378 7047 bx lr
I have discovered that it seems r0 is always set to 1, meaning INIT2 is never skipped. What am I missing? @Middleware & OS
3 Replies
Enthernet Code
Enthernet Code4mo ago
What are you trying to do
Enthernet Code
Enthernet Code4mo ago
From there we would know if u re Missing something
Sterling
Sterling4mo ago
Well, I am just trying to understand the control flow and conditions under which INIT2 is called.
Want results from more Discord servers?
Add your server