3 of 3 people found this helpful
Do you enable the DBGMCU clock on APB2 ??
RCC->APB2ENR |= RCC_APB2ENR_DBGMCUEN;
Thank you very much!
I inserted the suggested line and it started working.
I paste the working code:
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
/* Configure the system clock */
/* Initialize all configured peripherals */
/* USER CODE BEGIN 2 */
RCC->APB2ENR |= RCC_APB2ENR_DBGMCUEN; //enable MCU debug module clock
DBGMCU->APB1FZ |= DBGMCU_APB1_FZ_DBG_TIM7_STOP; //enable timer 7 stop
Thanks for the hint on the clock, I've been searching for an hour and this is the only place that mentions it and it fixed my issue.
Wow, thanks heaps Clive. I was struggling with that myself.
Suggestion to ST: Please implement that line in your __HAL_DBGMCU_FREEZE_xxx macros! I simply didn't know that was necessary and that's the whole point of having a macro, isn't it?