ThreadX Examp[le #117
-
Is there an STM32 / ThreadX example available? Best Regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Not public for the moment - I have it on my private project hence you see some drivers here. |
Beta Was this translation helpful? Give feedback.
-
LwESP lib has some sort of ThreadX port. It has system functions (OS) and memory functions. See here for instance: https://github.com/MaJerle/lwesp/blob/develop/lwesp/src/system/lwesp_mem_threadx.c You will find "extern" variable for memory pool. Idea is that LwESP port part for THreadX uses memory pool defined by user from the application level. Init sequence would be then: /* Init your TX memory pool */
/* Set byte pool for memory operations */
lwesp_sys_preinit_threadx_set_bytepool_handle(&tx_app_byte_pool);
/* Init stack, and send reset/restore commands in non-blocking mode */
if (lwesp_init(lwesp_main_evt_fn, 0) != lwespOK) {
debug_printf("[LwESP] Could not initialize stack\r\n");
return 0;
}
debug_printf("[LwESP] Stack initialized\r\n");
Second problem of ThreadX is that you cannot terminate yourself (cleanup self thread, like in FreeRTOS). For that sense you need to have another thread that does it for you - usually called Idle Thread. Not having idle thread is OK for core LwESP threads to run, but you cannot have multiple application threads that are started and terminated on the fly, several times. That's the only drawback. |
Beta Was this translation helpful? Give feedback.
Not public for the moment - I have it on my private project hence you see some drivers here.
Will plan to make it. Could you please open an issue?