2015-09-21 11:16 AM
Hey,
I know that I can include a opt.s assembly instruction file in a keil project to set the read/write protection bits etc to level 1. I was just wondering, if I need to wipe such a device, how can I reset the option bits to wipe the flash, using keil ulink2? (I don't have the ST flash tool available). Is it even possible to do it with keil tools?Thanks2015-09-21 11:26 AM
Yes it is possible,
- Open ''Options for target''- Select ''Debug'' tab- Open settings for your ulink- Select ''Flash Download'' tab- Click ''Add'' below programming algorithm window- Look for your MCU flash options algorithm STM32xxx Flash Options (ex: STM32F4xx Flash Options or STM32F7xx Flash Options)Do erase2015-09-21 04:18 PM
Hi,
Thanks, but I would be grateful for a little further clarification as I am slightly confused.When I go to that location, I see the files examples that you mention - but the contents are not human readable/editable. Are you saying that one of these files has the effect of resetting the read/write protection bits back to level zero? Is it that there is a dialog elsewhere that changes the settings in these files? Or did you mean for me to write an assembly .s file specify the protection bits at level zero and load it through that dialog? Feel like I am missing something...Thanks again2015-09-21 04:41 PM
Don't they provide a wizard tab in the bottom left of the edit window, so you can modify the settings with a point-n-click interface?
http://www.keil.com/support/docs/3406.htm
2015-09-22 03:33 AM
Yes they do. In fact, I use that interface to set up my .s file for the purpose of elevating my read/write protection from 0 to 1.
What I am asking though is different. Having flashed an image which is protected, how do I get keil to reset the flash protection bits and erase the chip for next reprogramming?Surely I don't do that by editing that file again?2015-09-22 03:38 AM
2015-09-22 06:28 AM
Sorry,
I misread you and thought you just needed how to configure the ulink2 to erase and program the option bytes.Thank you Clive1 to complete the procedure.2015-09-22 06:29 AM
<duplicate>
2015-09-22 08:30 AM
Ok, I don't use Keil in that fashion. I'd suspect Flash->Erase might do it if you have both algorithms selected. And if not you'd want to review the Flash algorithm source to get it to behave in exactly the fashion desired.
I'm not sure I'd mess with the options if I only had one board, and one JTAG pod. I typically want access to the part via multiple paths (JTAG, USART, monitor, etc), and I add code to my app to modify and clear the options. Any in depth analysis of the protections is likely to result in a few bricked devices, if for no other reason than to see what techniques can be applied to de-brick it. As I recall the ST-LINK and J-LINK have mechanisms to nuke the parts, and the former are very cheaply sourced.