AnsweredAssumed Answered

S12X flash protection problem CW SE 5.1 HIWAVE

Question asked by James Murray on Jun 17, 2015
Latest reply on Jun 29, 2015 by Edward Karpicz

A number of years ago I created a serial bootloader for MC9S12XEP100 using CodeWarrior 4.7 and have been using the P&E Multilink BDM device to load the bootloader to chips. (I have found the multilink to be horribly unreliable, but that's another story.)


Recently I installed a different version of CodeWarrior to support a newer different product family. The installer managed to break the drivers for the P&E multilink. After re-installing various stuff I'm in the same situation as a colleague...  I now have CodeWarrior for S12(X) v5.1 special edition installed. (Fresh download yesterday.) It can load firmware ok (for once) but the results don't work correctly.


My application uses flash protection and enables security.

When V4.7 worked this was going on.

With V5.1, when I enable security, the device unexpectedly has full flash protection too and the serial bootloader cannot do anything.


I have confirmed that the generated binary ( P&E_Multilink_CyclonePro.abs ) is identical between releases.

I have enabled protocol logging in HIWAVE and it looks like it is reading the binary correctly and the data it _should_ be writing to the chip is the same. However, when I get my loader to spit out memory locations afterwards, they don't look correct.


My bootloader binary puts the various flash/security words into memory at FF08 onwards: (no backdoor key)

org $ff08

fdb $ffff

fdb $ffff

fcb $cc  - protect high range of flash 0xf000 upwards FPROT

fcb $ff

fcb $ff

fcb $7d - enable device security FSEC


Afterwards, that $cc is reading back as $7f meaning full flash protection, which is why I get FPVIOL when I try to erase a flash sector from within my application.


Any ideas what changed in HIWAVE between V4.7 and V5.1 and how to workaround this change?


The amount of time I've spent on it so far, I could have been a good way through writing my own BDM driver... However, I have a customer's device here that I was trying to reflash and return yesterday...