Flash is secured after writing

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

Flash is secured after writing

1,139 Views
liuweiwei
Contributor I

Dear sir,

I am using ms9c12xdp512 16 bit mcu. After i writing to flash, the BDM prompt an dialog "Communications with target failed: The target MCU has no clock or wrong BDM clock speed is used to derivateve is secured" and can not debug the project. I must "unsecure" the flash, then i can use BDM to debug. I am sure my hardware and BDM are good. Which software issue can make this happen?

0 Kudos
Reply
1 Reply

868 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

The MCU is secured only if the SEC bits in flash security byte at address 0xFF0F (global address 0x7F_FF0F) are different from value 0b10. Recommended value of flash security byte for unsecured state is 0xFE.
So, there must be something in your code that changes this byte to secured state. Please check the content of address 0xFF0F after first download of firmware. Then run the code for certain time and check it again. What is the result?
Notice that the flash data are not refreshed in memory window by default: in debugger in main menu choose “MultilinkCyclonePro -> Debugging memory map” if you use P&E BDM multilink. New window will appear. Select appropriate block of memory in the list (it should be „flash C000“) and choose Modify/Details button. Enable the item “refresh memory when halting”.

 

Some more info. ERASE function in PROG12Z always forces address $FF0F to $FE to allow BDM access. V

In CodeWarrior and its Hiwave debugger we can turn off the reprogramming of flash security byte to $FE by command FLASH NOUNSECURE which cases MCU is secured and BDM is disabled after programming and reset.

 

Unsecuring the MCU:

1) By application SW, the unsecuring feature or backdoor key must by implemented in user’s application.

2) Another way how to unsecure the device is to use unsecure command from CodeWarrior debugger or unsecure program from www.pemicro.com pages.

 

If you use USB multilink you have to use unsecure Option MultilinkCyclonePro->Unsecure in the CodeWarrior Hiwave Debugger.

or you can use external usecure program which can be downloaded from pemicro pages.

 

Unsecure_12: Utility which unsecures HCS12 devices via P&E's BDM Interfaces such as Cyclone-PRO, USB-ML-12, and BDM-Multilink. This version supports the new Rev B Multilink.

http://www.pemicro.com/downloads/download_file.cfm?download_id=16

 

Unsecure_12 Help Files:  This .hlp file describes the use and operationg of the Unsecure_12 program which is used with P&E's interface devices to unsecure proeviously secured HCS12 microcontrollers.

http://www.pemicro.com/downloads/download_file.cfm?download_id=14

(These links I have stored in my PC…I wanted to check them but pemicro pages do not respond today)

 

 

Best Regards, Ladislav

0 Kudos
Reply