graceful shutdown for ARM board

Hello, I am currently using nanobsd on a Nanopi Neo and I am looking for a way to shutdown (and save configuration) via a external button.
My first idea was to use an AVR/PIC that sends a heartbeat via a GPIO pin. When a key is pressed, the heartbeat stops, the OS save the configuration and shutdown. The AVR could switch off the PSU after a delay.
The problem is how to be sure the OS is really stopped before switch-off. I saw a solution with an AVR/PIC that wait for some message on UART. In my case, I need the UART for other uses. But maybe you have a better, simpler idea?
 
Many SoC/SBC boards have a blinking blue LED that is operating system controlled heartbeat. You might be able to poll that LED voltage with your external circuit, and decide that when the heartbeat blue LED stops, the OS has shutdown (not sure if Nano-pi Neo does that - would want to verify that it does do that consistently before using this kind of trick).
 
Back
Top