EmbDev.net

Forum: ARM programming with GCC/GNU tools how can I read protect my STM32F4 with eclipse + openOCD JTAG ?


Author: magnetron (Guest)
Posted on:

Rate this post
0 useful
not useful
hello forum ,

I am using Eclipse + openOCD JTAG for downloading and debugging
my aplication for STM32F4

after I finish my project I want read protect my code
so that it is not stolen

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

thank you

Author: Spencer Oliver (ntfreak)
Posted on:

Rate this post
0 useful
not useful
Make sure you have an the latest version of OpenOCD (currently 0.7.0) 
and use the following cmds
# set readout protection
stm32f2x lock 0

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

Cheers
Spen

Author: magnetron (Guest)
Posted on:
Attached files:

Rate this post
0 useful
not useful
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

Author: Spencer Oliver (ntfreak)
Posted on:

Rate this post
0 useful
not useful
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

Author: magnetron (Guest)
Posted on:
Attached files:

Rate this post
0 useful
not useful
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

Author: Spencer Oliver (ntfreak)
Posted on:

Rate this post
0 useful
not useful
As you are using the gdb console then you need to prefix any OpenOCD 
cmds with monitor (or mon for short).

mon stm32f2x lock 0

Cheers
Spen

Author: magnetron (Guest)
Posted on:

Rate this post
0 useful
not useful
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

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.