MCU runs different in free running than in manual stepping in debug mode
Hey guys,
I have expereinced a very strange behaviour of my STM32F429ZIT6 custom board:
When I execute the following code the processor behaves differently in free running then in manual stepped mode or my oscilloscope seems to be completely broken - which I doubt.
_5_PLUS_COIL_HIGH;
delay_TIM10(50);
STANDARD_COIL_LOW;
_5_MINUS_COIL_LOW;the macros behinde _5_PLUS_COIL_HIGH , STANDARD_COIL_LOW and _5_MINUS_COIL_LOW are simply GPIO output state settings:
#define STANDARD_COIL_HIGH STANDARD_COIL_GPIO_Port->BSRR = STANDARD_COIL_Pin
#define STANDARD_COIL_LOW STANDARD_COIL_GPIO_Port->BSRR = (STANDARD_COIL_Pin << 16U)
#define _5_PLUS_COIL_HIGH _5_PLUS_COIL_GPIO_Port->BSRR = _5_PLUS_COIL_Pin
#define _5_PLUS_COIL_LOW _5_PLUS_COIL_GPIO_Port->BSRR = (_5_PLUS_COIL_Pin << 16U)and the function delay_TIM10(50) is a msec delay function:
#pragma GCC push_options
#pragma GCC optimize ("O3")
void delay_TIM7(uint32_t ucnt) // IMPORTANT!! always check with clock speed for correct delays in STM32CubeMX
{
uint32_t start = TIM7->CNT;
while(tim7_tick() - start < ucnt);
}
void delay_TIM10(uint32_t mcnt) // IMPORTANT!! always check with clock speed for correct delays in STM32CubeMX
{
uint32_t start = TIM10->CNT;
while(tim10_tick() - start < mcnt);
}
#pragma GCC pop_options
#define tim7_tick() (TIM7->CNT)
#define tim10_tick() (TIM10->CNT)I halt the program per breakpoint at _5_PLUS_COIL_HIGH and trigger my oscilloscope on that pin to check for a rising edge, as the pin is LOW prior. Normally I would just hit run and the socilloscope would get triggered. But for a reason I don't know, the oscilloscope gets not triggered. When I maually step from the breakpoint the oscilloscope gets triggered.
Has anybody a clue why this is the case?
My processor runs only at 68MHz.
best regards
Benjamin