Example S32K144 Verify Backdoor Access Key S32DS1.3

Document created by Daniel Martynek Employee on Oct 1, 2017Last modified by Adrian Puga Candelario on Jan 17, 2020
Version 5Show Document
  • View in full screen mode


Detailed Description:


The S32K144 MCU is secure if SEC bits are set to non 0b10 value in Flash Secure Register (FSEC).
And can be unsecure using either Mass Erase or Verify Backdoor Access Key command
provided they are enabled, again indicated by bits KEYEN and MEEM in the FSEC register.


The FSEC register is a read-only register and is loaded with the content of the flash security
byte in the Flash Configuration Field located in program flash memory during the reset sequence.
The configuration field holds the Backdoor comparison key as well and is configurable in startup_S32K144.S file.


The attached example code shows use of Verify Backdoor Access Key flash command.


The MCU is secured in the Flash configuration field and therefore once the application has been loaded
the debugger does not have access to the MCU which must be run stand-alone.


The state of the SEC bits is indicated by LEDs.
The RED LED indicates the MCU is secure (SEC != 0b10) after reset.
After a delay loop, the Verify Backdoor key command is executed

which will unsecure the device and the LED will turn BLUE (SEC = 0b10).


NOTE: The Verify Backdoor key command is executed from RAM to avoid simultaneous access to the PFlash block.


Test HW:      S32144EVB-Q100
MCU:           S32K144 0N47T
Debugger:    S32DS1.3, OpenSDA
Target:          internal_FLASH
2.0     Sep-30-2017     Daniel

3 people found this helpful