6 years, 11 months ago.

Brown out detection for STM32F401

Hi all,

how to use https://os.mbed.com/cookbook/WatchDog-Timer#brown-out-detection for STM32F401. The code example "Brown_Out_Example" on that page uses

...
// Setup a Brown Out Detect (BOD) Interrupt Service Routine
    NVIC_SetVector(BOD_IRQn, (unsigned)BrownOut);
// Enable Brown Out Detect Interrupt
    NVIC_EnableIRQ(BOD_IRQn);
...

but i do not see "BOD_IRQn" type in STM32F401. How can i implement brown out detection for STM32F401?

Thanks

1 Answer

6 years, 11 months ago.

From the application notes for the STM32F4:

Quote:

The device has an integrated power-on reset (POR) / power-down reset (PDR), coupled with a brown-out reset (BOR) circuitry. The BOR is active in all power modes except Shutdown mode, and cannot be disabled. Five BOR thresholds can be selected through option bytes. During power-on, the BOR keeps the device under reset until the supply voltage VDD reaches the specified VBORx threshold. When VDD drops below the selected threshold, a device reset is generated. When VDD is above the VBORx upper limit, the device reset is released and the system can start. For more details on the brown-out reset thresholds, refer to the electrical characteristics section in the datasheet.

So it seems it's enabled by default for your board.

You can change the threshold though (see the app note), maybe through FLASH_OB_BOR_LevelConfig but I haven't tested it.