How to Debug TrustZone Project on MCUXpresso DIE

Document created by Alice_Yang Employee on Apr 10, 2019
Version 1Show Document
  • View in full screen mode

This document introduces how to debug TrustZone project on MCUXpresso IDE.

 

Use the latest version of MCUXpresso IDE v10.3.1.

Project is from SDK_2.5.0_LPCXpresso55S69.

Board is LPCXpresso55s69, use the LinkServer debug probe(on board debugger).

 

Every TrustZone based application consists of two independent parts - secure part/project and non-secure part/project. The secure project is stored in SDK_2.5.0_LPCXpresso55S69\boards\lpcxpresso55s69\trustzone_examples\<application_name>\ cm33_core0 \<application_name>_s directory. The non-secure project is stored in SDK_2.5.0_LPCXpresso55S69\boards\lpcxpresso55s69\ trustzone_examples\<application_name>\ cm33_core0 \<application_name>_ns directory. The secure projects always contains TrustZone configuration and it is executed after device RESET. The secure project usually ends by jump to non-secure application/project.

In this document, we use “hello_world” as example, this project contains both “hello_world_s” and “hello_world_ns” projects. Unlike Keil or IAR IDE, MCUXpresso IDE can’t debug jump directly from secure project to no-secure project, so we need add the no-secure executable file to secure project debug configuration manually(For this version of MCUXpresso IDE v10.3.1, we need do this step, while for  the later new versions, maybe they support jump directly from secure project to no-secure project ).

Steps outline:

  1. Import “hello_world_s” and “hello_world_ns” project.
  2. Build “hello_world_s” and “hello_world_ns”, without any error.
  3. Erase flash.
  4. Program no-secure project “hello_world_ns ”.
  5. Kill active debug.
  6. Add the location of file “lpcxpresso55s69_hello_world_ns.axf” to Debugger commands of “hello_world_s” project, and download “hello_world_s” project.
  7. After finish download, it stop at “hello_world_s” project, set a breakpoint at hello_world_ns project:
  8. Debug project

 

Detailed steps please refer to DOC in attachment.

 

Hope it helps,

 

BR

Alice

Outcomes