Requirement to call _tx_thread_context_save/restore for various Cortex architectures
I use ThreadX (in addition to other X series middlewares) on nearly all of my projects. I have been in the habit of adding calls to _tx_thread_context_save/restore in all interrupt handlers inside stm32<xx>xx_it.c, per the guidance in ThreadX documentation.
Today I was reworking an old project and pulled up the assembly for _tx_thread_context_save to see a note that states:
/* DESCRIPTION */
/* */
/* This function is not needed for Cortex-M. */
Referencing https://community.st.com/t5/stm32-mcus/part-1-how-to-create-a-threadx-low-power-project-from-scratch/ta-p/571446, I see no step outlined to add the calls for context save/restore. I've read various Issues on the official ThreadX github account and the old Microsoft Azure ThreadX Q&A board that go back and forth on whether these calls are necessary or recommended (https://github.com/eclipse-threadx/threadx/issues/381 , https://learn.microsoft.com/en-us/answers/questions/994826/azure-rtos-execution-profile-kit-with-stm32u5-b-u5). I've also found threads here on the ST forums that do the same (https://community.st.com/t5/stm32-mcus-embedded-software/mx-generated-code-for-irq-handlers-doesn-t-address-threadx/td-p/718368).
So, what's the consensus on these context save/restore calls? I most often develop on STM32U5 and H7 series, if that makes any difference, though at my organization, any family is possible depending on the project.
