How to use BootLoader with security feature?(HCS12)

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

How to use BootLoader with security feature?(HCS12)

860 Views
niyin
Contributor I

Hello everyone :

I know how to use bootloader according to AN3275 and AN4258.

I know how to secure the mcu (by writing 'const char Set_key @0xFF0F = 0X80;' )

but how to do them at the same time?

 

As usual I tried to write 'const char Set_key @0xFF0F = 0X80;'but when I try to download my code to MCU by using BootLoader, it doesn't work. Maybe it’s because ‘the area 0xF0000xFFFF is occupied by the bootloader’ according to AN4258.

 

And AN4258 said: By using the different menus of the bootloader, the user can set the backdoor keys and secure the microcontroller.

I found a menu which can set 'keys', but didn't find any menu to secure the microcontroller.

 

What can I do?

4 Replies

581 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

 

Yes, the area is occupied by the bootloader.

It would require to erase the whole sector, change the FSEC byte and program the sector back.

Which is not recommended.

 

The solution is to secure the MCU in the code of the bootloader.

Below is a screenshot of main.c file of AN4258, Bootloader_S12

Bootloader_FSEC.png

Regards,

Daniel

581 Views
wangjiajie
Contributor III

Hello,How can i use this" FLASH NOUNSECURE " in CodeWorr 10.7 ?

,the project is based on Processor Expert

0 Kudos

581 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

If you use standard download and your code contains a constant array at FSEC address, the CW10.7 will not unsecure the device. This is done automatically.

If you program the MCU with tasks in Flash programmer, you have the choice to select the option.

pastedImage_2.png

 

Regards,

Daniel

0 Kudos

581 Views
niyin
Contributor I

Thank you vey much! I found the solution by myself yesterday and it was exactly same to the solution you provide. What you provide makes sure what I have done is right!

0 Kudos