altos/stm32f04x: Smite the OPL_LAUNCH bit to reset boot config
[fw/altos] / src / stmf0 / ao_arch.h
index d70a9110e91fa02ac481ced1e928fa1868b0ca6d..1450545a10c015d9d33fd2c75f95d5f68eb57f07 100644 (file)
 #define __interrupt(n)
 #define __at(n)
 
-#define ao_arch_reboot() \
-       (stm_scb.aircr = ((STM_SCB_AIRCR_VECTKEY_KEY << STM_SCB_AIRCR_VECTKEY) | \
-                         (1 << STM_SCB_AIRCR_SYSRESETREQ)))
+static inline void ao_arch_reboot(void) {
+       stm_flash.cr = (1 << STM_FLASH_CR_OBL_LAUNCH);
+       stm_scb.aircr = ((STM_SCB_AIRCR_VECTKEY_KEY << STM_SCB_AIRCR_VECTKEY) |
+                        (1 << STM_SCB_AIRCR_SYSRESETREQ));
+}
 
 #define ao_arch_nop()          asm("nop")
 
@@ -53,7 +55,8 @@
  * ao_romconfig.c
  */
 
-#define AO_ROMCONFIG_SYMBOL __attribute__((section(".romconfig"))) const
+#define AO_ROMCONFIG_SYMBOL __attribute__((section(".init.1"))) const
+#define AO_USBCONFIG_SYMBOL __attribute__((section(".init.2"))) const
 
 extern const uint16_t ao_romconfig_version;
 extern const uint16_t ao_romconfig_check;