eclipse-threadx / threadx

Eclipse ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/index.md
MIT License
2.93k stars 794 forks source link

Documentation: issue with FPU enabled thread stack frame in readme_threadx.txt #70

Closed newbrain closed 3 years ago

newbrain commented 3 years ago

In all the readme_threadx.txt for cortex-m with an FPU the interrupted stack frame with FPU enabled looks like this: https://github.com/azure-rtos/threadx/blob/32e3b3b25f4b17ff51ce8a6bad8d9eb32729a0f6/ports/cortex_m33/gnu/readme_threadx.txt#L66-L115

Looking at the PendSV_Handler implementation in tx_thread_schedule.S for e.g. the M33 port (same code as for M7 and M4): https://github.com/azure-rtos/threadx/blob/32e3b3b25f4b17ff51ce8a6bad8d9eb32729a0f6/ports/cortex_m33/gnu/src/tx_thread_schedule.S#L143-L150

The correct stack order should be as follows, from lower offsets to higher ones:

goldscott commented 3 years ago

Hi @newbrain - you're absolutely correct - we'll update the readmes with the correct stack layout. Thanks for bringing this up! I think the readmes are from before we started using the hardware lazy stacking.

newbrain commented 3 years ago

Thanks! I needed to make sure, since I'm developing a pyocd plug-in for Azure RTOS ThreadX and need to unwind the stack frame.

goldscott commented 3 years ago

Fixed in https://github.com/azure-rtos/threadx/releases/tag/v6.1.5_rel