How to use Threadx
zsjlovestudy opened this issue · comments
You need to allocate memory before calling tx_thread_create, e.g.
CHAR *pointer;
ret = tx_byte_allocate(byte_pool, (VOID **) &pointer, DEFAULT_STACK_SIZE, TX_NO_WAIT);
ret = tx_thread_create(&my_thread, "My Thread", my_thread_entry, 0, pointer, DEFAULT_STACK_SIZE, DEFAULT_THREAD_PRIO,
DEFAULT_PREEMPTION_THRESHOLD, TX_NO_TIME_SLICE, TX_AUTO_START);
You might want to check the value of ret
after each call
CHAR *pointer;
ret = tx_byte_allocate(byte_pool, (VOID **) &pointer, DEFAULT_STACK_SIZE, TX_NO_WAIT);
thank you very much! I was careless and tried Azure for the first time.
You need to allocate memory before calling tx_thread_create, e.g.
CHAR *pointer; ret = tx_byte_allocate(byte_pool, (VOID **) &pointer, DEFAULT_STACK_SIZE, TX_NO_WAIT); ret = tx_thread_create(&my_thread, "My Thread", my_thread_entry, 0, pointer, DEFAULT_STACK_SIZE, DEFAULT_THREAD_PRIO, DEFAULT_PREEMPTION_THRESHOLD, TX_NO_TIME_SLICE, TX_AUTO_START);
You might want to check the value of
ret
after each call
May I ask you another question, if I choose dynamic memory allocation, how should I allocate for it?
Hi @zsjlovestudy,
Your questions are more than welcome. However, the right channel to ask for support about such aspects is the ST Community via a post on the Azure RTOS dedicated section.
This channel is rather dedicated to report bugs or enhancements related to the firmware published within this repo.
Please allow me to close this issue. Thank you for your comprehension.
With regards,