how can I read protect my STM32F4 with eclipse + openOCD JTAG ?

#3156025
Make sure you have an the latest version of OpenOCD (currently 0.7.0) 
and use the following cmds
1
# set readout protection
2
stm32f2x lock 0
3

4
# clear readout protection, power cycle may be required
5
stm32f2x unlock 0

Cheers
Spen
Guest #3159470
hello Spencer ,

first of all thank you for your answer

in the attachment the screenshot of my Eclipse

1) how can I upgrade this to 0.7.0 ?

2) should  I type "stm32f2x lock 0" in the console window ?

3) "power cycle may be required" - you mean power off and then on ?

4) I have stm32f4 - but your answer "stm32f2x" - is the command equal 
for both f2 and f4 ?

thank you
Attached files:
#3159510
magnetron wrote:
> hello Spencer ,
>
> first of all thank you for your answer
>
> in the attachment the screenshot of my Eclipse
>
> 1) how can I upgrade this to 0.7.0 ?
>

depends in your OS, for windoze you could try here - 
http://www.freddiechopin.info

>
> 2) should  I type "stm32f2x lock 0" in the console window ?
>

yes or in gdb or a script.

>
> 3) "power cycle may be required" - you mean power off and then on ?
>

yes

>
> 4) I have stm32f4 - but your answer "stm32f2x" - is the command equal
> for both f2 and f4 ?
>

yes

Spen
Guest #3163830
hello Spencer,

I downloaded unzipped and copied openocd-0.7.0 folder
into OlimexODS folder

first error olimex_stm32_e407. file was missing in \scripts\board 
directory
I copied this file from 0.6.1 into 0.7.0

then I run Eclipse chosen ARM_USB_TINY_H  and as you see
openocd-0.7.0.exe recognized the JTAG

afterwards I downloaded my code in my Olimex Board

I typed stm32f2x lock 0 in the console window

the console screen you can see in the attached picture

there was no acknowledgment of read protection

I tried to download my code again and there was no warning that
the uC is read protected

what am I doing wrong ?

thank you
Attached files:
Guest #3174230
hello Spencer ,

I sucessfully locked 0 the way you told

my question

what does lock 0 do ?
does it read protect the code flash ?
what else does it do ?

is there lock 1 or lock 2 too ?

thanks

Reply

A question of your own? This thread is over 13 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.