I don't know which instruction first raised the fault. It seems that it's not even an instruction from the enc_bootloader, because I reduced its code to simply and I still get the exact same HardFault at pc 0x000002f8
Code:
int main() { int i = 0; while(1) i++; }Notice, I also read the 0x40120128 register, which i believe is the OTP: USR Register at offset 0x128. It seems that the DCTRL value is set to 1, which disables SBPI according to the datasheet. Perhaps this is the root of my issues? I do not set this register anywhere in my code though, so i don't know how it became 00000001[rp2350.cm0] halted due to breakpoint, current mode: Handler HardFault
xPSR: 0x09000003 pc: 0x000002f8 msp: 0x400e0058
[rp2350.cm1] halted due to debug-request, current mode: Thread
xPSR: 0x09000000 pc: 0x000000ec msp: 0xf0000000
> mdw 0x40120128
0x40120128: 00000001
> mdw 0xE000ED2C
0xe000ed2c: 40000000
> mdw 0xE000ED28
0xe000ed28: 00008200
> mdw 0xE000ED38
0xe000ed38: 40138100
Statistics: Posted by simashvili — Sun Nov 02, 2025 2:57 pm