Persistent flight mode after power-cycle

Hi,

I would like my drone to keep the last flight mode before a power cycle in memory and automatically reset after reboot. Is there a way to do it?
Example:
Before reboot: ALTCTL → power cycle → ALTCL → user changes flight mode to POSITION → power cycle → POSITION

Thanks!