# HG changeset patch # User Ethan Zonca # Date 2015-06-01 16:54:27 # Node ID 8f7cba39fbe74237a12e4b1c7a8332efa5fde9d3 # Parent f2990941d9d943dc9c77cff1a23a5b0d14d7f554 Added notes about jumping to user program, etc. Need to check boot flags to match F042 processor (example was f1). diff --git a/bootlib.c b/bootlib.c --- a/bootlib.c +++ b/bootlib.c @@ -1,5 +1,15 @@ #include "stm32f0xx_hal.h" +/* Notes: + +Need to have DFU jump right to the program to unset those option bytes, or somehow have dfu-util unset them. Probably try using the :leave parameter... + + Flashing a binary file to address 0x8004000 of device memory and ask the device to leave DFU mode: + $ dfu-util -a 0 -s 0x08004000:leave -D /path/to/image.bin + +*/ + + // Unset bootloader option bytes void bootloader_unset(void) { @@ -31,6 +41,8 @@ void bootloader_enter(void) { HAL_FLASHEx_OBGetConfig(&OBParam); + + // FIXME TODO: CHECK THESE OPTION BYTES, he was using an F1 processor. What about the switch flag? OBParam.OptionType = OPTIONBYTE_USER; /*Reset NBOOT0 and BOOT_SEL, see: RM 2.5 Boot configuration*/ OBParam.USERConfig = 0x77; //Sorry for magic number :)