Flash security, securing on MCF52259 (MCF5213) Coldfire

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

Flash security, securing on MCF52259 (MCF5213) Coldfire

1,122 Views
juanee
Contributor III

Hello everyone,


Does anyone know of examples on how to enable the flash security on the Coldfire Flash Module (CFM) on MCF52259?


I understand I have to write the security flash word: 0x80004AC8 to location 0x0414 to enable security, but have been unable to do so.

 

I have searched the forum but some discussions have dead links to more information.


Any help with an example or more information would be appreciated.

 

(I am using Codewarrior 10.2 Coldfire (MCF52259 target) with MQX 3.8.)


juan

Labels (1)
0 Kudos
2 Replies

535 Views
CarlosCasillas
NXP Employee
NXP Employee

Hello Juan.

It is possible to configure the internal Flash in security state. Please refer following action to configure CFM security: The CFMSEC register is a read only register, you cannot write value to it at address of IPSBAR + 0x1D_0008 directly.

All the bits in the CFMSEC are loaded at reset from the Flash Security long word stored at the internal Flash base address + 0x0000_0414. That means if you want to write 0x40004AC8 in to the CFMSEC register, what you need to do is write the value to Flash Security long word (Internal Flash base address + 0x0000_0414). If you are using CodeWarrior software, you can find CFMSEC configure info in CFM Flash Configuration Field. 

/* * CFM Flash Configuration Field */ KEY_UPPER: .long 0x00000000 KEY_LOWER: .long 0x00000000 CFMPROT: .long 0x00000000 CFMSACC: .long 0x00000000 CFMDACC: .long 0x00000000 CFMSEC: .long 0x40004AC8 // during reset, the value will be loaded to CFMSEC register. After that, the internal Flash is in security state. When internal flash in security state, it will disable BDM mode, and the internal code could not be copied with any tool.

If then you want to unsecure internal flash on Coldfire, there is a very useful tool in P&E website named UNSECURE_CF. Please check below download linkage:

http://www.pemicro.com/support/download_processor.cfm?family=7

Hope this information will be useful for you. Have a nice day.


0 Kudos

535 Views
juanee
Contributor III

I totally forgot that I posted this question. Thank you for the advice Carlos.  I figured it out.  For MQX though, the settings for those registers are inside the vector.c file for the specific bsp build (Freescale MQX x.x\mqx\source\bsp\specificboard\vector.c  and requires a MQX rebuild.  Thanks.

0 Kudos