Brown Out Detection - Best Practices


I have a quick question.
In case of a brown out detection does FreeRTOS have a “best practice”.
Should i e.g. suppress all task and wait to see what happen, or should I just let the run like normal?

other data
Working on a NetX90 (ARM Cortex-M4F) with a build-in BOD Detection in the chip, which will produce a interrupt when BOD is detected.

FreeRTOS doesn’t care. It will just keep running until the system resets or turns off. It doesn’t have anything that needs to worry about such conditions.

Your application may have things that you don’t want to start or need to quickly finish in this state, but that is YOUR design requirements that will control.

Generally speaking a brown-out is a situation where the power dips low enough that memory integrity is lost, which means the only reasonable thing to do is to reset the CPU and start from scratch.

Best practice is to hold the device in reset and not restart until the power is stable again, this is always done in hardware and many CPU’s have this hardware built-in.

Of course like richard-damon said FreeRTOS will not and cannot do anything about this, but you should probably set up your device to remain in reset.

1 Like

My presumption is if the CPU has a ‘Brown Out’ Detection flag, this is a signal that happens BEFORE we get to the state where data loss occurs. The usual thing that we do with this sort of thing is inhibiting actions like starting a Flash Erase/Write cycle, as we might not be able to finish it before we actually lose power. We also might want to command some things into a ‘safe’ configuration to handle the impending reset.

Quickly checked the datasheet on NetX90 and you are correct, that device can generate an interrupt for you when a voltage level of your choosing has been met, programmed with a resistor divider on the outside, so you probably want to use this to do some application specific emergency stuff and brace for impact then.