Flash protection in 9S12X

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

Flash protection in 9S12X

1,256 Views
jmv
Contributor I

Hello

 

I am using Code Warrior 4.7 for S12X  and am trying to prevent Hiwave from erasing the top 4k of flash, which I use as a boot loader and subsequently set in my code as protected. Hiwave erases all the flash, which means I lose my boot loader every time I download anything from Hiwave. I can see no way of specifying a range of flash addresses that you wish Hiwave to leave alone.

 

Any suggestions?

 

Thanks

Labels (1)
0 Kudos
Reply
2 Replies

582 Views
kef
Specialist I

Instead of preventing flash erase you may include bootloader image in your project output files (S records files and *.abs ELF file). To do so you need to

1) copy bootloader S-records into project \bin folder. I guess any folder from project access path will work.

2) add line to prm file

 HEXFILE bootloader_S19_file_name.s19

 

Multilink/Cyclone connection has AEFSKIPERASING command, which can be added into one of *.cmd files. This commadn allows to skip erase of whole flash blocks or EEPROM blocks. This is not what you want. I guess flash loader uses mass erase command instead of erase sector by sector. Mass erase is faster. If that's the case, then flash protection won't help here, because mass erase doesn't work if any portion of flash array is write protected.

 

0 Kudos
Reply

582 Views
jmv
Contributor I

Thanks for your comments.

 

I have decided to use a method based on your first suggestion. I generate the two S-record files, remove the first line of one, the last line of the other, and merge them, using a combination of sed commands and cat. Then I download the resultant S-record and this seems to work.

 

Thanks again

 

0 Kudos
Reply