As discussed in https://my.st.com/3077d1fa, the bootloader requires
an odd (Thumb mode) address for the GO command. If an even address
is used, the Cortex M does something like a software reset, but this
is not generated by the write to AICR in stm_reset_code, but by an
exception due to the even address which is not compatible with
Thumb mode. ARM specifies 'Hard Fault' for this case:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0497a/BABDCDHA.html
On some devices, when programming an initially
blank device, -R will reenter the bootloader
unless the OBL_LAUNCH bit in FLASH_CR is set.
Refer to RM0360, section 2.5 "Empty Check".
The STM32F030xC device is marked in the device
table to use the OBL_LAUNCH reset.
Anonymous
Your st.com link only gives a login page, do you have the correct link? Anyway, AN3155 explains the GO command and I agree the code execution address stored at the "go address" + 4 must be an odd address.
I am just surprised this was wrong because I had tested it with a hardware debugger when fixing alignment issue in https://sourceforge.net/p/stm32flash/code/ci/1381ff50f11706e746c28008eed6561c592fccf5 :)
Hm, the function 'Share discussion' of the ST forum is broken, it creates the same non-functioning link again.
Here's a deep link:
https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/System%20boot%20mode%20and%20Go%20command%20STM32f103rbt6
Thanks! I have pushed both patches to git.