cancel
Showing results for 
Search instead for 
Did you mean: 

Code Protect

sami
Associate II
Posted on May 26, 2013 at 20:51

Hello

After I have finished my project I need to protect my code  from being read from JTAG or from serial bootloader ,

Could you guid me or show me how can I protect my code ?

I am using keil . , STM32f407.

Thank you in advanced

Esat
5 REPLIES 5
flyer31
Senior
Posted on May 27, 2013 at 08:13

The easiest way would be, that you set the option byte to read level 1 (menu Target - Option Bytes, do NOT use read level 2 - except you want to configure it such, that absolutely no more re-programming possible on the chip).

You can also program the option byte quite easily from inside your software. You can also do it during Flash programming via Keil - you have to look for an example of Keil, where they use the programming cycle Flash + Option Byte (Project settings, Utilities/Debug).

sami
Associate II
Posted on May 27, 2013 at 16:55

Thank you Bil

I still could not do that . I am using keil ..

Could you show a code for this or exmple , please?

Amel NASRI
ST Employee
Posted on June 11, 2013 at 12:44

Hello,

You can do it with an easy way using the ST-Link utility tool that you can download from this page:

http://www.st.com/web/en/catalog/tools/PF258168

.

All the required documentation is available on the same page.

Best Regards,

ST.MCU

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

sami
Associate II
Posted on June 20, 2013 at 11:24

Thank you Mayla

I dont have  st_link , I have ulink2 keil ,

is there away in the software for example a function , that protect the code ?

martinmartin9129
Associate II
Posted on June 20, 2013 at 15:35

You can put in your code:

FLASH_OB_Unlock();
FLASH_OB_RDPConfig(OB_RDP_Level_1);
FLASH_OB_Launch(); 
FLASH_OB_Lock();