I'm trying to blink a LED on a Nucleo-L476 with CubeMX and ST's HAL. It worked perfectly on Windows (System Workbench). Now, I'm trying to do the same on Linux with CubeMX and Qt Createor (my favorite IDE) and OpenOCD. I am now able to compile and debug the target.
However, the program crashes during HAL initialization. More precisely, when it tries to access the
The problem, in general, is that a global function can't be accessed from a function :
uint32_t dummyVar = 123;
uint32_t loc = 123;
uint32_t *p = &loc;
p = &dummyVar; // debugger says &dummyVar = 0x20000004 and p = 0x011a3b01 (outside RAM)
loc = dummyVar; // *** crash here (WWDG IRQ) or random value
p here points outside the RAM, which starts at 0x20000000. The nop instructions make sure
p = &dummyVar; is really executed and the debugger doesn't fool me.