How to set up stacks for ThreadX in LP-AM243X platform?

Sulav Lal Shrestha 361 Reputation points
2023-02-08T22:59:47.9166667+00:00

I am trying to integrate ThreadX to Cortex-R5 based LP-AM243x microcontroller. I have started with a hello world project which just prints to serial terminal. My question is as follows:

In the hello-world project, it already sets up stacks for different modes like SYSTEM, SUPERVISOR, IRQ,FIQ, etc. A similar stuff is done in tx_low_level_initialize function. Can we just remove the stack setup code from the tx_low_level_initialize function and do the stack set up during boot time before it hits main(). And if we can do that, which stack should the _tx_thread_system_stack_ptr variable point to in tx_low_level_initialize ? Currently there's stack for main(), irq, fiq, svc, abort, and undefined.

Thank you.

Regards,

Sulav

Azure RTOS
Azure RTOS
An Azure embedded development suite including a small but powerful operating system for resource-constrained devices.
331 questions
{count} votes

Accepted answer
  1. Scott Azure RTOS 4,051 Reputation points
    2023-02-08T23:30:53.3333333+00:00

    Hi @Sulav Lal Shrestha - yes, you can remove the stack setup from the tx_low_level_initialize function. The _tx_thread_system_stack_ptr variable should be set to the SVC stack.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.