Skip to main content
Nitin
Associate III
December 12, 2023
Solved

Calling secure function from non secure area in TF-M threadx

  • December 12, 2023
  • 1 reply
  • 1543 views

Hi, need support. send_msg() is a secure area message of TF-M and I am calling it in non secure area via secure_nsc API.

What I am observing here is that I am not able to call this function in _tx_initialize_kernel_enter() function after the call to TX_PORT_SPECIFIC_PRE_INITIALIZATION. Just to mention this experiment is happening from STM32U585 board. Below is the code snippet for this.

 

 

 

VOID _tx_initialize_kernel_enter(VOID)

{

 

/* Determine if the compiler has pre-initialized ThreadX. */

if (_tx_thread_system_state != TX_INITIALIZE_ALMOST_DONE)

{

/* No, the initialization still needs to take place. */

 

/* Ensure that the system state variable is set to indicate

initialization is in progress. Note that this variable is

later used to represent interrupt nesting. */

_tx_thread_system_state = TX_INITIALIZE_IN_PROGRESS;

/* Call any port specific preprocessing. */

TX_PORT_SPECIFIC_PRE_INITIALIZATION

send_msg();

.

.

.

.

.

}

This topic has been closed for replies.
Best answer by Jocelyn RICARD

Hello @Nitin,

In context of TFM you must use an secure service that is know by TFM.

So, please use TFM documentation to see how to create such secure service

Best regards

Jocelyn

1 reply

Jocelyn RICARD
Jocelyn RICARDBest answer
ST Employee
December 21, 2023

Hello @Nitin,

In context of TFM you must use an secure service that is know by TFM.

So, please use TFM documentation to see how to create such secure service

Best regards

Jocelyn