Contiki-NG
Loading...
Searching...
No Matches
TrustZone for Arm Cortex-M

Functions

bool tz_api_init (struct tz_api *apip)
 Initialize the TrustZone API.
 
bool tz_api_poll (void)
 Poll the secure world and process all events in the queue.
 
void tz_api_println (const char *text)
 Print the specified message via the secure world.
 
bool tz_api_request_poll_from_ns (void)
 Request poll from normal world.
 

Detailed Description

This subsystem implements TrustZone support for Arm Cortex-M processors. The archtiecture is based on dual Contiki-NG firmwares: the secure world contains an instance of Contiki-NG with reduced functionality, and the normal world contains an instance with regular functionality. When programming an IoT device, the hex files with the two firmwares are merged into a single hex file, which is flashed to the device.

Both worlds can access core system functionality such as processes, timers, and library functions. The normal world is expected to contain applications and networking functionality. By contrast, the secure world will contain secret information and functionality for monitoring the normal world. Hardware peripherals can be configured to be accessible in either of the worlds.

Currently, the only supported Contiki-NG platform is the nRF5340 development kit, which is equipped with two different Arm Cortex-M33 processors.

Function Documentation

◆ tz_api_init()

bool tz_api_init ( struct tz_api * apip)

Initialize the TrustZone API.

Parameters
apipA pointer to a tz_api structure.
Return values
falseError (apip pointed to invalid memory, or the API has been initialized already.)
trueSuccess.

Definition at line 59 of file tz-api.c.

References process_alloc_event(), process_post(), and tz_api_poll().

◆ tz_api_poll()

bool tz_api_poll ( void )

Poll the secure world and process all events in the queue.

Return values
trueIf the secure world has more events to process.
falseIf the secure world has no more events to process.

Definition at line 90 of file tz-api.c.

References clock_time(), process_nevents(), process_run(), and watchdog_periodic().

Referenced by tz_api_init().

◆ tz_api_request_poll_from_ns()

bool tz_api_request_poll_from_ns ( void )

Request poll from normal world.

          Only called from secure world.

Definition at line 124 of file tz-api.c.