2015-10-12 12:55 PM
Hi All!
I'd like to know is there a way (linker directive or something) to set option byte value I'm aware that I can set ROP when downloading the program via ST_link, but that means there's a chance that I forget to make appropriate setting at some moment Another way would be checking the ROP state upon each reset, that's very reliable but implies slight code overhead What I want to find out is a way to put default option byte values into resulting .hex file by some compiler/linker directive. Is there any?2015-10-12 02:01 PM
Well with Keil you should be able to have the linker put data in the 0x1FFFF800 [16 bytes] space using #pragma or scatter file, and if you pick the flash programming algorithms to include the ''STM32F0 Options'' then they will be erased and written as part of the flashing process. You can also add these as suitably configure source files, with a bit level configuration wizard.
The most practical method is to use detection in your own code to recognize the options aren't set as you want, and to change them. Can't see that using an overwhelming amount of code.http://www.keil.com/support/docs/3406.htm
How you do it on other random tools would depend on their explicit support for the memory space using for the options and OTP spaces.2015-10-13 09:33 AM
Thank you! That's exactly what I was looking for.