2006-01-12 12:48 AM
2005-02-16 03:08 AM
Hi to all
In ''Flash Programming Reference Manual'' you can read (par. 3.4): ''You can permanently unprotect a protected sector (write protect), or protected Flash Module (debug protect) [...] by programming PDSx bit . . . .'' a) PROBLEM: writing the PSDx bit disable permanently the ''debug protection'' but NOT the ''sector write protection'' So, I cannot reload new F/W: is correct ? :-[ . . . one chip is dead . . . :-[ :-[ b) The ACCP bit in FLASH_NVAPR0 is disappeared. This implies that in new micro release it is unused: is correct ? Bye Smart :-?2005-02-16 03:53 AM
Hello smart, :-[
I'm sorry, but if you enable the Debug Protection of internal flash memory, then the code crashes. The device will always stay in Debug Protection mode! This means that this chip can't be used anymore because JTAG interface is disabled. With regards, Hich 8-)2005-02-16 04:05 AM
Hi Hich,
. . . i have implemented a USB bootloader and i can disable and reenable debug protection whit my specific commands . . . (up to 16 time...) The problem is that sectors remains write protected . . . Regards Smart :-?2005-02-16 06:51 PM
This is the situation:
- B0F0..B0F4 -->> ProgramA - the first time ProgramA load ProgramB in B0F5..B0F7, activate WriteProtection on all sector and activate Debug Protection - ProgramA can erase WP, load a new Program and write it in B0F5..B0F7 - ProgramA can enable or disable Debug protection and write protection The problem is that your data sheet write that is possible PERMANENTLY UNPROTECT A WRITE PROTECTED SECTOR by resetting bit PDSx: it is false !! -->> I cannot rewrite ProgramA by JTAG (I can only if Program B can disable WP and load and write the new ProgramA !!!) Regards smart :)2006-01-12 12:48 AM
Quote:
On 17-02-2005 at 10:37, Anonymous wrote: smart, I propose fo you to - Load a program to B0F5..B0F7 to disable the DEBUG protection. - Connect to the micro, Write a program which disable the WP, and run it from RAM. - Open your prject ''USB bootloader'' WITHOUT RESETTING THE MICRO and load it to the flash Best regards,can ''USB bootloader'' not disable the WP (because it is in B0) ?''- Load a program to B0F5..B0F7 to disable the DEBUG protection.'' in FLASH PROGRAMMING REFERENCE MANUAL 3.6 SET PROTECTION EXAMPLES Example 3: Disable Debug Protection permanently. FLASH_CR0 |= 0x01000000; /*Set SPR in FLASH_CR0*/ FLASH_AR = 0x0010DFBC; /*Load Add in FLASH_AR*/ FLASH_DR0 = 0xFFFFFFFE; /*Load Data in FLASH_DR0*/ FLASH_CR0 |= 0x80000000; /*Operation start*/ Example 4: Re-Enable Debug Protection permanently, after having disabled it. FLASH_CR0 |= 0x01000000; /*Set SPR in FLASH_CR0*/ FLASH_AR = 0x0010DFBC; /*Load Add in FLASH_AR*/ FLASH_DR0 = 0xFFFEFFFE; /*Load Data in FLASH_DR0*/ FLASH_CR0 |= 0x80000000; /*Operation start*/ Note You can disable and re-enable the Debug Protection permanently (as shown in examples 3 and 4) a maximum of 16 times.
Note These examples can only be done by code which is fetched from RAM.3.4 PERMANENT UNPROTECTIONYou can permanently unprotect a protected sector (write protect), or protected Flash Module (debug protect). You may need to use this feature under certain circumstances, for example to analyze rejects. Debug protection can be disabled by programming the PDSx bits in the FLASH_NVAPR1 register. If the DBGP 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. is Code in RAM or Flash ?