SAML11 TrustZone® Touch Project

 Objective

SAML11 supports the use of TrustZone®. The following describes how to configure a TrustZone project with touch. Two options will be covered.

  1. Touch and application code are entirely within the secure area
  2. Touch is within the secure area, with control from the non-secure area

In both cases, a SAMQT7 was used in this guide.

Touch and application code entirely within the secure area

1

Create a SAML11 Harmony 3 project.

SAML11Project.png

2

Select the TrustZone Enabled checkbox when choosing the SAML11 as the target device. This will create two projects in the tree view, one for the secure region, the other for the non-secure region.

TrustzoneEnabled.png

3

Start the Microchip Harmony Configurator (MHC) when the projects are created.

LaunchHarmony.png

Secure projects are used with MHC. The secure project should be set to the Main Project (highlighted in the tree view).

MainProject.png

4

Add the Touch Library to the project and allow the Real-Time Clock (RTC) to be added. Clock configuration will also update.

TouchLibrary.png

5

Configure touch sensors as required using the Touch Configurator.

TouchConfigurationScreen.png

QT7 uses one slider and two touch buttons.

PinSelectionScreen.png

6

Configure TrustZone.

TrustZone.png

Adjust Memory Configuration to suit the user application.

MemoryConfiguration.png

The RTC and Peripheral Touch Controller (PTC) should be green (indicates placed in secure memory region).

PeripheralConfiguration.png

7

Assign pins and sercom as necessary if LED toggling or data visualizer is required.

PinSettings.png

Note the addition of the Security mode column in the pin configurator.

Sercom.png

8

Generate the project code.

GenerateCode.png

9

Main.c within the Secure project should be updated as follows:

Touch is within the secure area, with control from the non-secure area

The process of controlling touch operation from the non-secure project can be achieved using the TrustZone veneer.
The following files need to be modified:

Note: Veneer.h in both projects should contain the same function list.

Non-Secure Project

  • Main.c
  • Veneer.h

Secure Project

  • Veneer.h
  • Veneer.c
  • Secure.c
  • Secure.h

Non-Secure Project : Main.c

Secure Project Main.c is standard as per a new TrustZone project. It should contain:

Non-Secure Project: Veneer.h

Secure Project: Veneer.h

Secure Project: Veneer.c

Secure Project: Secure.h

Secure Project: Secure.c

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.