mcu is secured after upgrade.

cancel
Showing results for 
Search instead for 
Did you mean: 

mcu is secured after upgrade.

Jump to solution
380 Views
everkimage
Contributor IV

My mcu is MC9S12X.

I have a bootloader and a app.First i write bootloader to board using TBDML and run it,then i upgrade the app through CAN by bootloader using a pc software.

If i delete the VECTOR 0 xxx in prm file of app,it's ok.

But if i undelete it,after upgrade and reboot,mcu is secured.

Why does it happen?

Labels (1)
1 Solution
267 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

there is security in the flash at global address 0x7F_FF0F which is copied into FSEC register after reset. If you erase sector which contains this byte and you do not program the byte  to unsecure status then the MCU is secured after next reset, The unsecure status of the register is 0xFE. (The info for sector is valid also for other initial values like FPROT)

(0x7FF08 - 0x7F_FF0F form a Flash phrase and must be programmed in a single command write sequence. Each byte in the 0x7F_FF08 - 0x7F_FF0B reserved field should be programmed to 0xFF.)

For more info: Table 24-3. Flash Configuration Field in the ref.manual.

In order to be sure only one link AN4258: http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4258.pdf 

The an and SW files can be found in Documentation Tab at:

S12XE MCUs|16-Bit Microcontroller | NXP 

An example for unsecured status of security after reset:

//set backdoor key and UNsecure the flash (0xFE)
const unsigned char flash_array[] @0xFF00 = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE};

An example for required security and backdoor key after reset:

//set backdoor key ( value, for example: 0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA) and secure the flash (0xBD)
const unsigned char flash_array[] @0xFF00 = {0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBD};

Best regards,

Ladislav

View solution in original post

1 Reply
268 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

there is security in the flash at global address 0x7F_FF0F which is copied into FSEC register after reset. If you erase sector which contains this byte and you do not program the byte  to unsecure status then the MCU is secured after next reset, The unsecure status of the register is 0xFE. (The info for sector is valid also for other initial values like FPROT)

(0x7FF08 - 0x7F_FF0F form a Flash phrase and must be programmed in a single command write sequence. Each byte in the 0x7F_FF08 - 0x7F_FF0B reserved field should be programmed to 0xFF.)

For more info: Table 24-3. Flash Configuration Field in the ref.manual.

In order to be sure only one link AN4258: http://cache.freescale.com/files/microcontrollers/doc/app_note/AN4258.pdf 

The an and SW files can be found in Documentation Tab at:

S12XE MCUs|16-Bit Microcontroller | NXP 

An example for unsecured status of security after reset:

//set backdoor key and UNsecure the flash (0xFE)
const unsigned char flash_array[] @0xFF00 = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE};

An example for required security and backdoor key after reset:

//set backdoor key ( value, for example: 0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA) and secure the flash (0xBD)
const unsigned char flash_array[] @0xFF00 = {0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xBD};

Best regards,

Ladislav