1
0
mirror of https://github.com/armink/CmBacktrace.git synced 2025-01-25 00:22:53 +08:00

Merge pull request #84 from andeyqi/master

添加THREADX系统支持
This commit is contained in:
朱天龙 (Armink) 2024-07-03 14:25:10 +08:00 committed by GitHub
commit 73714489f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 1 deletions

View File

@ -214,6 +214,11 @@ static void get_cur_thread_stack_info(uint32_t *sp, uint32_t *start_addr, size_t
osRtxThread_t *thread = osRtxInfo.thread.run.curr;
*start_addr = (uint32_t)thread->stack_mem;
*size = thread->stack_size;
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_THREADX)
TX_THREAD * ptThread = NULL;
TX_THREAD_GET_CURRENT(ptThread);
*start_addr = (uint32_t)ptThread->tx_thread_stack_start;
*size = ptThread->tx_thread_stack_size;
#endif
}
@ -244,6 +249,10 @@ static const char *get_cur_thread_name(void) {
return vTaskName();
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_RTX5)
return osRtxInfo.thread.run.curr->name;
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_THREADX)
TX_THREAD * ptThread = NULL;
TX_THREAD_GET_CURRENT(ptThread);
return ptThread->tx_thread_name;
#endif
}

View File

@ -39,7 +39,7 @@
/* enable OS platform */
/* #define CMB_USING_OS_PLATFORM */
/* OS platform type, must config when CMB_USING_OS_PLATFORM is enable */
/* #define CMB_OS_PLATFORM_TYPE CMB_OS_PLATFORM_RTT or CMB_OS_PLATFORM_UCOSII or CMB_OS_PLATFORM_UCOSIII or CMB_OS_PLATFORM_FREERTOS or CMB_OS_PLATFORM_RTX5 */
/* #define CMB_OS_PLATFORM_TYPE CMB_OS_PLATFORM_RTT or CMB_OS_PLATFORM_UCOSII or CMB_OS_PLATFORM_UCOSIII or CMB_OS_PLATFORM_FREERTOS or CMB_OS_PLATFORM_RTX5 or CMB_OS_PLATFORM_THREADX */
/* cpu platform type, must config by user */
#define CMB_CPU_PLATFORM_TYPE /* CMB_CPU_ARM_CORTEX_M0 or CMB_CPU_ARM_CORTEX_M3 or CMB_CPU_ARM_CORTEX_M4 or CMB_CPU_ARM_CORTEX_M7 or CMB_CPU_ARM_CORTEX_M33 */
/* enable dump stack information */

View File

@ -47,6 +47,7 @@
#define CMB_OS_PLATFORM_UCOSIII 2
#define CMB_OS_PLATFORM_FREERTOS 3
#define CMB_OS_PLATFORM_RTX5 4
#define CMB_OS_PLATFORM_THREADX 5
#define CMB_PRINT_LANGUAGE_ENGLISH 0
#define CMB_PRINT_LANGUAGE_CHINESE 1
@ -348,6 +349,9 @@ if (!(EXPR)) \
extern char * vTaskName(void);
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_RTX5)
#include "rtx_os.h"
#elif (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_THREADX)
#include "tx_api.h"
#include "tx_thread.h"
#else
#error "not supported OS type"
#endif /* (CMB_OS_PLATFORM_TYPE == CMB_OS_PLATFORM_RTT) */