cancel
Showing results for 
Search instead for 
Did you mean: 

Kei uLink resetting read/write protection

estersci2
Associate III
Posted on September 21, 2015 at 20:16

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?

Thanks
8 REPLIES 8
keaven
Associate II
Posted on September 21, 2015 at 20:26

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 erase

estersci2
Associate III
Posted on September 22, 2015 at 01:18

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 again

Posted on September 22, 2015 at 01:41

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

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
estersci2
Associate III
Posted on September 22, 2015 at 12:33

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? 

estersci2
Associate III
Posted on September 22, 2015 at 12:38

Clive - in other words, that link shows hot to lock the flash at level 1.

What I am asking is, having locked it, how do I unlock it? 

Do I edit that file back down to level 0 and just reflash?

Do I edit the file and load it up via the dialog that Keaven mentioned?

I will only have one device initially and I can't afford to brick it. 

Thanks

keaven
Associate II
Posted on September 22, 2015 at 15:28

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.

keaven
Associate II
Posted on September 22, 2015 at 15:29

<duplicate>

Posted on September 22, 2015 at 17:30

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.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..