Erase of Flash Causes Lock  up

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Erase of Flash Causes Lock  up

2,146 Views
morag
Contributor I
Has anyone caused a device to lockup by trying  too erase flash locations and if so is there a way of being able to connect to the device again?  I am trying  to implement a bootloader and issued a Erase_Flash_Sector command passing it the address 0xEF00 and the device locked up such  that I am no loonger able to connect to it with the P&E Multilink.  Is there a way to fix this or doo I have to replace the device?  What did I do wrong?
Many thanks
Morag
Labels (1)
0 Kudos
Reply
2 Replies

773 Views
DannyM83
Contributor III
You have likely cleared the address 0x7FFF0F and in doing so caused the MCU’s Flash Security to become enabled. If this byte is anything other than 0xFE the device cannot be accessed by debugger, this is to prevent unauthorised access to the contents of flash. There are two ways to unsecure the flash: using Back Door Access or by performing a mass erase. The latter requires an 8byte password to be set before the device is secured and since this is unlikely in this case, the only option is to mass erase the flash.

To do so you should use the enable the recovery command “unlock_flash_on_connect 1” in CodeWarrior in the memory configuration (.cfg) file.

More info can be found on page 100 of the Data Sheet:

Link

Danny
0 Kudos
Reply

773 Views
EliArad
Contributor I

Hi 

 

I have the same problem with 84789 microcontroller.

 

I did not erase the address 0x7FFF0F

 

i used the following command:

 hfm_command(FTFL_ERASE_SECTOR, (UInt16*)(i*FLASHP_PAGE_SIZE + PFLASH_START_ADDR), 0, 0);

where PFLASH_START_ADDR  is 0x3000.

 

After it, i think the chip is locked. I cannot program it any more to try fix the problem.

 

I dont want to replace chip.

 

I am using MCU 10.2 (new code warrior for microcontrollers MCU56F84789 (32 bit) with USB TAP.

 

Please tell what should i do to first remove the unclock and then what code i should run in order to be able to write 

and clear the memory for boot loader procedure.

 

Thanks,

Eli

0 Kudos
Reply