MCUXpresso Config Tools is available both as a standalone application, which can be used in connection with various IDEs (Integrated Development Environments), MCUXpresso IDE. This document focuses on the integrated version. However, the basic principles are also applicable to the standalone version.
A tutorial containing three videos is available on nxp.com. The first video shows how to install MCUXpresso IDE with MCUXpresso SDK. The remaining videos demonstrate, among other things, the usage of the MCUXpresso Config Tools.
The TEE (Trusted Execution Environment) tool is part of the MCUXpresso Config Tools. It can be used to configure ARM TrustZone®, the AHB Security Controller, Memory Protection Unit, and other .
This document describes the TEE tool user interface and the standard configuration process with a simple example – adding a new secure memory region and a secure peripheral to an existing project for a LPCXpresso55S69 board. To demonstrate access restrictions, the configuration of DMA0 as secure and DMA1 as non-secure is also described. For general overview of the MCUXpresso Config Tools, refer to the guide.
Start by importing an existing SDK example. You must first download and install the LPCXpresso55S69 MCUXpresso SDK into the MCUXpresso IDE. For more information about downloading and installing SDK, see MCUXpresso Config Tools Getting Started.
Once the MCUXpresso IDE contains the LPCXpresso55S69 SDK you can proceed and import an example project.
The TEE tool is graphically divided into three logical groups, from the left to the right: Configuration Area, Access Details, and Output. This tutorial will make use of all three.
The configuration area consists of two complementary views:
The suggested configuration flow is to first define regions in the User Memory Regions view and then fine-tune the configuration using the Security Access Configuration view. The hello_world_s example already contains pre-defined regions but if you to start from an empty project, or modify the existing regions, you can import a regions stub based on the hello_world_s and hello_world_ns projects linker memory configuration.
To demonstrate this functionality, change the linker memory configuration and then import it into the TEE tool.
Note: Make sure not to create an overlap between the hello_world_s and the hello_world_ns memory configuration. Keep in mind that the 28th bit in addresses is used just to separate secure areas from non-secure areas. Therefore, addresses differing in the 28th bit only, for example, 0x20000000 and 0x30000000, point to the same physical location in the RAM memory.
Note: The Import button is not available in the standalone MCUXpresso Config Tools version.
Now you can modify the imported regions stub:
Note: After a linker-memory configuration is imported, S-User (Secure-User), or NS-User (Non-Secure-User) is used by default depending on whether the memory region belongs to a secure or to a non-secure project. It may be needed to change it to S-Priv (Secure-Privileged), or NS-Priv (Non-Secure-Privileged), if you want to use the privileged state.
Note: The MCUXpresso Config Tools can point out configuration inconsistencies and problems and suggests quick-fixes. These fixes are not applied automatically. The reason is that there can be multiple interconnected settings influencing each other in the configuration, and changing the value of one of them could cause an unwanted chain reaction.
Now switch to the Security Access Configuration view.
This view consists of multiple sub-views, each of them allowing the configuration of separate block(s):
The access details area consists of three views.
The Memory Attribution Map view displays security configuration of peripherals/memories, as well as the resulting memory/peripheral security attribute, in its default state. It is possible to switch the memory map into the detailed bus master to memory/peripherals access detail view. This can be done using the Filter access for checkbox. Once checked, the memory map starts displaying access details for the selected bus master and its security level.
Note: The memory map displays S and NS in the Resulting Security Level column. This is caused by the privilege checking being disabled by default, therefore S-User and S-Priv are both considered the same. This option can be in the Miscellaneous sub-view of the Security Access Configuration view.
We will now check the access details of DMA0 to the Ram2_S region as well as to the ADC0 peripheral which we configured to S-Priv previously.
Note: Notice that the Memory Attribution Map contains different columns in the Core 0 and Other Masters sub-views. This is because different mechanisms protect the access to different bus masters. Core 0 uses SAU (and MPU), but other bus masters use Master Security Wrapper (MSW).
You can also check the Access Overview view for simplified overall yes/no access information. Rows represent memory/peripherals, columns represent bus masters, cells represent access details of a corresponding bus master and memory/peripheral combination.
Note: Core 0 master contains four columns in the Access Overview. Each of the columns represent access from different security level of the Core 0.
The output area consists of four views:
Note: Code Preview displays just a preview of the source files, but the source code is not updated in the MCUXpresso IDE project yet. To update it, use the Update Code button.
This tutorial described the basic principles of configuration flow in the TEE tool and brief overview of the TEE tool views. For a hands-on example see the Creating Secure and Non-Secure projects post. If you would like to get more information regarding the ARM TrustZone® or LPC55S69, refer to the https://mcuoneclipse.com/2019/04/27/trustzone-with-armv8-m-and-the-nxp-lpc55s69-evk/ or https://mcuoneclipse.com/2019/10/21/investigating-arm-cortex-m33-core-with-trustzone-trusted-executi...