FreeRTOS with Arm Trustzone

A SecureContext is allocated with portALLOCATE_SECURE_CONTEXT();
I would like to know on how to get the SecureContextHandle_t instance on the current running function in the Secure side.

Thanks,

I don’t think there is currently a way to do this. Grateful if you can describe the use case so we can either help more or update the code if necessary.

I would like to measure the stack usage on the secure side.

We currently do not have support for calculating the secure stack usage but I do not think providing access to SecureContextHandle_t is the solution - Non-secure application cannot access secure memory and you will get a secure fault the moment you try to read/de-reference the secure context. We will look into adding this support. Thank you for your feedback.