cancel
Showing results for 
Search instead for 
Did you mean: 

How to permanently remove debug protection from flash

richards2
Associate II
Posted on October 25, 2006 at 19:25

How to permanently remove debug protection from flash

2 REPLIES 2
richards2
Associate II
Posted on October 25, 2006 at 11:26

Please can you clarify how to permanently disable the Debug Protect mode.

I understand the application note software and documentation except for one small point regarding in which memory space the code should execute from that disables the Debug Protection permanently.

Please see section 3.2 of the application note, specifically the note:

''Note: The Debug/Readout protection operation can be executed from all the internal/external memories except Flash Bank 0 of the Flash module.''

Here I assume that this only applies to the action of setting DBG to zero to ENABLE Debug protection.

In section 3.3.2, there is the following statement:

''If the DEBUG bit is programmed to 0, disabling the protection by programming the PDSx bits can be done only by a program executed from the Flash Module. The user software design can ensure that this is accessible only to authorized users.''

This leads me to the conclusion that the only way to permanently disable debug protection is to program the required routine into BANK 1 of the flash as it will not be possible to update the PDSx bits with code running in BANK 0. i.e. Executing this code from any other internal memory except BANK 1 will fail.

Please can you correct my understanding or confirm that this is indeed the only way to permanently disable the Debug protection.

Thank you.

richards2
Associate II
Posted on October 25, 2006 at 19:25

After testing in a real device, it appears the statement in 3.2 is the definitive rule: i.e.

''Note: The Debug/Readout protection operation can be executed from all the internal/external memories except Flash Bank 0 of the Flash module.''

i.e. the a method call to the following function as defined in the latest version sample code for the flash programming app note,

FLASH_PermanentProtectionCmd(DISABLE);

will succeed if the method FLASH_PermanentProtectionCmd(); is located in internal RAM.