LPC55S16 Trustzone "hello_world_s" example not running

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

LPC55S16 Trustzone "hello_world_s" example not running

464 Views
jesm86
Contributor II

Hello,

I am currently trying to get acquainted to Trustzone for Cortex-M33 on a LPCXpresso55S16 Board (LPC55S16 microcontroller). I actually thought that I managed to get a more or less good grasp on the theory and wanted to start working on implementations with the help of practical examples.

When I loaded up the Trustzone version of the "Hello Word"-Example provided by NXP especially for this specific microcontroller inside the MCUXpresso IDE and tried to run it, I get a hard fault error. I did not change any settings at all and strictly followed the instructions:

1) I built the secure project "hello_world_s" before the nonsecure version "hello_world_ns".

2) I then choose "Program Flash Action using SEGGER J-Link probes" for the nonsecure version

3) I started debugging using "Debug using SEGGER J-Link probes", which naturally starts the debugging process.

The moment the project tries to jump from the secure to the nonsecure domain, i get a "Precise Data Bus Error".

I tried to verify that everything was set up correctly with regards to the security settings: The nonsecure project begins at address 0x00010000. This is also - correctly - the argument given to the function TZM_JumpToNormalWorld(NON_SECURE_STATE). In the memory attribution map inside MCUXpresso, I was also able to verify that the Resulting security level of that area is "NS", for non-secure Code. So this also fits (which is actually to be expected, because I did not change anything also completely deleted and reinstalled the example project several times, just to be sure).

As an attachment I am providing some screenshots showcasing the problem.

Would be nice, if you could help me to get (finally really) started with Trustzone.

Thanks in advance, Jerome

1.PNGdisa.PNGhf.PNGmemmap.PNG

Labels (1)
0 Kudos
2 Replies

381 Views
jesm86
Contributor II

Hello,

in the meantime I managed to find a way to get all of the Trustzone example projects running. What I had to do is to take the output of the compilation of both (secure and non-secure) projects and and debug them with another debugging tool (not the debugger that is included in the MCUXpresse IDE). I used the Segger Ozone J-Link Debugger and it worked perfectly. When I tried a different toolchain (IAR) and used the IAR Workbench IDE, I could even used the debugger of that IDE and get it working right out of the box.

Therefore it seems to me that the problem was the debugger or the debugger settings in the MCUXpresso IDE toolchain. The debug configuration settings were identical, as can be seen on the attached screenshots.

Is there something known what could cause the problem in the MCU toolchain? Is anybody else having these problems?

Best regards,

Jerome

 

0 Kudos

452 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

The two examples "hello_world_s" and "hello_world_ns" are SDK examples, I suppose they are fully tested, there is not problem.

I copy the part from readme.txt in the project:

"

TrustZone application compilation
As first compile secure project since CMSE library is needed for compilation of non-secure project.
After successful compilation of secure project, compile non-secure project.

TrustZone application debugging
- Download both output file into device memory
- Start execution of secure project since secure project is going to be executed after device RESET.

If IDE (Keil MDK, IAR) allows to manage download both output files as single download, the secure project is configured to download both secure and non-secure output files so debugging can be fully managed from secure project.

"

So you are required to download only the "hello_world_s", it is okay, the "hello_world_ns" will be downloaded automatically.

Hope it can help you

BR

XiangJun Rong

0 Kudos