Calling secure function from non secure area in TF-M threadx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-12 9:26 AM - edited ‎2023-12-12 9:27 AM
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();
.
.
.
.
.
}
Solved! Go to Solution.
- Labels:
-
TFM
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-21 8:59 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-21 8:59 AM
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
