2018-05-08 12:30 PM
Hi,
I have a question... We use STM32F303 MCU and have configured a programmable voltage detector (PVD) to 2.9 V. At power-off interrupt is triggered and we have time till 2 V to store some diagnostic data into flash (free location is prepared at each power-on). Tu gain some time when voltage drops from 2.9 V to 2 V, we switch off complete AHB, APB1 and APB2 buses in RCC registers. Also we switch from HSE/PLL clock at 72 MHz to HSI at 8 MHz. We this actions, we gain quite a lot of additional time for saving data to flash.
The problem is next. In our application we also use few channels on DMA1 and DMA2. With switching off an AHB bus (which includes clocks for both DMAs) it turned out that saving data to flash is not executed each time. It fails very randomly. We found out, that if we switch off all clocks except DMA1 and DMA2 clock in AHB bus, the saving to flash in PVD interrupt does not fail (never).
Does anyone have an idea what might be going on, if DMA clocks are switched off, before saving data to flash?
Thank you,
Matic