AnsweredAssumed Answered

Flashing via the bootloader with device security enabled does not work

Question asked by Gerhard Grasruck on Jun 25, 2017
Latest reply on Sep 13, 2017 by Radek Sestak

We want to activate the S12ZVML128 device security via the corresponding configuration byte in the flash configuration field, in order to prevent unauthorized reading out of the flash contents (Access by backdoor keys is to be enabled). However, when security is enabled, writing the flash when not using the programmer, but the bootloader (using Vector vFlash) does not work. An error occurs when descending into the bootloader routine.

 

Initial state of the Flash Configuration Fields, security is not enabled, error does not occur:

0x00FFFE00: 0x01 0x23 0x45 0x67 0x89 0xAB 0xCD 0xEF 0xFF 0xFF 0xFF 0xFF 0xFF 0x8F 0xFA 0xBE

0x00FFFE10: …..

 

Security is enabled, error does occur:

0x00FFFE00: 0x01 0x23 0x45 0x67 0x89 0xAB 0xCD 0xEF 0xFF 0xFF 0xFF 0xFF 0xFF 0x8F 0xFA 0xBD

0x00FFFE10: …..

 

 Strangely it does work, if other, not directly related, settings in the Flash Configuration Field are modified:

 

Security is enabled, flash nonvolatile byte (initializes Flash Option Register FOPT)) is set to 0xFF, error does not occur:

0x00FFFE00: 0x01 0x23 0x45 0x67 0x89 0xAB 0xCD 0xEF 0xFF 0xFF 0xFF 0xFF 0xFF 0x8F 0xFF 0xBD

0x00FFFE10: …..

 

Security is enabled, EEPROM Protection byte (initializes EEPROM Protection Register DFPROT)) is set to 0Xff, error does not occur:

0x00FFFE00: 0x01 0x23 0x45 0x67 0x89 0xAB 0xCD 0xEF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFA 0xBD

0x00FFFE10: …..

 

Even though it does work with certain modifications, as shown above, we are unsure how reliable the behavior is and would like to have an explanation before proceeding.

Outcomes