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           


I have discovered that it seems r0 is always set to 1, meaning INIT2 is never skipped.
What am I missing?
@Middleware & OS
Was this page helpful?