Page 1 of 1

Send something over /dev/serial0 after disks are unmounted?

Posted: Fri Jan 24, 2020 8:14 pm
by allpass
I've got an application which involves a pi CM3+ module. It communicates with a microcontroller on the same PCB over UART serial. During shutdown the micro will show a shutdown message on the internal LCD. But I want to know when it's safe for the user to unplug the power.

Is there some way I can have a program resident in memory, or some kind of kernel module which hangs around during shutdown? Basically once the disk is in a safe state I just want to send a little message to the MCU to change the shutdown status on the display.

Does anyone know if there is a simple way to do this? I'm comfortable hacking kernel modules if that helps, but would prefer some kind of script for ease of testing.

Thanks!