cancel
Showing results for 
Search instead for 
Did you mean: 

STM32N6 – HardFault (INVPC) when calling tx_thread_schedule() in Non-Secure

LisaB
Associate III

Hi everyone,

I’m working on an STM32N6 project configured with:

  • ThreadX running in Non-Secure

  • SAU configured

  • RISAF configured

  • External Memory Manager enabled(Load and Run mode)

The project is very simple. However, when debugging the Non-Secure application, as soon as tx_thread_schedule() is called, execution jumps to HardFault.
The Fault Analyzer reports: “Attempt to do exception with bad value in EXEC_RETURN number (INVPC)”.

The code is loaded in external flash memory using Load and Run mode, the signed bin files are uploaded in the external flash using STM32CubeProg and then debugged using STM32CubeIDE.
Has anyone experienced INVPC errors on STM32N6 with ThreadX in Non-Secure?
Any suggestions would be greatly appreciated.

1 REPLY 1
Saket_Om
ST Employee

Hello @LisaB 

Please refer to the article below to debug your HardFauld.

How to debug a HardFault on an Arm® Cortex®-M STM3... - STMicroelectronics Community

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om