RT-Thread / rt-thread

RT-Thread is an open source IoT Real-Time Operating System (RTOS).
https://www.rt-thread.io
Apache License 2.0
10.61k stars 5.03k forks source link

rt_thread中如何使用TrustZone #8116

Open li301597 opened 1 year ago

li301597 commented 1 year ago

rt_thread中如何使用arm CM33内核的TrustZone?打开宏定义ARM_CM33_ENABLE_TRUSTZONE时报错(TZ_StoreContext_S等函数未定义错误)

enkiller commented 1 year ago

rt_thread 系统运行在非安全态,打开 ARM_CM33_ENABLE_TRUSTZONE 后,需要安全态的库提供相关的API,用于支持安全态线程上下文保存功能。

li301597 commented 1 year ago

请问下”安全态的库提供相关的API”可以从哪里获取,不会是要自己实现吧?

enkiller commented 1 year ago

类似 TZ_StoreContext_S 的函数可以看看 ARM 给的示例:

Examples/Fault/B-U585I-IOT02A/Secure/tz_context.c

TrustZone 一般是跑加解密,鉴权等操作的。还需要搭配类似 trusted-firmware-m 的库一起使用