altos/stm32f04x: Smite the OPL_LAUNCH bit to reset boot config
authorKeith Packard <keithp@keithp.com>
Sun, 16 Apr 2023 04:53:28 +0000 (21:53 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 16 Apr 2023 04:53:28 +0000 (21:53 -0700)
commitcb756983a26595a5d2f317a6693f9a670665c86a
tree5214e921b301f00eedc7a718a0898534fe615219
parent16c3f541e80d77f4adc1a69f15e82c23d7947138
altos/stm32f04x: Smite the OPL_LAUNCH bit to reset boot config

When rebooting, make sure the option bytes are recomputed based upon
the latest flash configuration, including whether there's a program
loaded. This ensures that we don't end up re-starting the DFU loader
and mangling our ao_boot values. Without this, our flash loader code
wouldn't be able to see the signal to stay in the loader and we'd end
up back in the application.

Of course, this is only necessary if we want to reboot just after
flashing the boot loader without power cycling. Once the chip is power
cycled, it recomputes the option bytes automatically.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stmf0/ao_arch.h