question

fei-1508 avatar image
0 Votes"
fei-1508 asked fei-1508 commented

How to calculate stack usage in threadx WIN32?

In Threadx Win32 environment, tx_thread_stack_ptr and tx_thread_stack_highest_ptr(with TX_ENABLE_STACK_CHECKING enabled) are not updated during task scheduling, so how to calculate the task stack usage?
Thanks!

azure-rtos
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ScottAzureRTOS avatar image
0 Votes"
ScottAzureRTOS answered fei-1508 commented

The stack supplied in the tx_thread_create call is not used in the win32 port. I believe the underlying win32 thread stack is actually used. The win32 port is more for simulating behavior before you have an actual target. Are you intending to deploy applications on win32 or will you be using a microcontroller?

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

We plan to deploy applications on ARM platform, but now our platform has not been ready.
So, we are debugging the application in win32 environment first, and want to estimate stack usage in advance, and to optimize our code size.

Is it feasible to simulate the stack statistics in WIN32 port as the behavior in ARM port?

0 Votes 0 ·

No, you won't be able to get stack statistics in win32. Why don't you use an ARM simulator? The ARM FVPs are here: https://developer.arm.com/tools-and-software/simulation-models/fixed-virtual-platforms

0 Votes 0 ·
fei-1508 avatar image fei-1508 ScottAzureRTOS ·

Thanks for your suggestion!

0 Votes 0 ·