I'm using STM32L-Discovery with STM32L152RBT6 onboard with CoIDE. I've created new project, picked STM32L152RBT6 microcontroller and added following components:
- C_library
- cmsis_core (which as far as I can see contains boot)
- STM32L152xB_CUBELIB
Now I'm trying to perform step-by-step debugging of this very simple code:
int main(void)
{
int var1 = 1;
int var2 = 2;
while(1)
{
var1 = var1+1;
var2 = var2*var1; // breakpoint here
}
}
It compiles, loads, but when debugging step-by-step the compiler ommits lines of code. When running from breakpoint to breakpoint the program acts totally crazy and var1 and var2 values seem to be random. Compiler toolchain: GNU Tools ARM Embedded 4.9 2015q2
I've got another board with STM32F4xx uC where it works fine. Hey, community, do you have any ideas what's wrong?