half spooky microcontroller ghost story and half rubber ducking into the void

@emily@fedi.uni.horse

Content warning: half spooky microcontroller ghost story and half rubber ducking into the void

something is extremely, hilariously wrong with my mcu and i don't know what

so interrupts don't work. at all. after several days of staring at this, i found that the mcu thinks it's handling a HardFault, and so does not handle interrupts because of course you mask interrupts while you're handling a fault

but... there is no fault, afaict. it's still happily running through the instructions in main() like nothing is wrong

so, obvious next step, rule out any weird shit libopencm3's reset_handler may be doing. flashed a test firmware that replaces reset_handler with a function containing a single `.1: b .1` instruction, so it comes out of reset and immediately hits an infinite loop. it still does the thing

looked at the stack below it, and it has a normal looking exception stack, and the return address below that is... the start of where `.init_array` was, before i flashed this test firmware

seriously considering the possibility that something in my set of flashing/debugging tools implements reset as "fuck with the vector table and intentionally trigger a hardfault" because idk what else can possibly be happening here