lhaoyue 发表于 2020-9-30 10:40:42

问下RTX5怎么得到thread stack 的起始地址?

查看了CMSIS-OS2的API,只有uint32_t osThreadGetStackSize(osThreadId_t thread_id) 和 uint32_t osThreadGetStackSpace(osThreadId_t thread_id) 这两个API,
想得到Stack start addr 不知道怎么做?有知道的还请赐教,感谢!


lhaoyue 发表于 2020-9-30 17:03:19

:'(有人知道吗?

eric2013 发表于 2020-10-1 09:36:12

直接用MDK自带调试组件比较省事。

lhaoyue 发表于 2020-10-10 09:22:34

eric2013 发表于 2020-10-1 09:36
直接用MDK自带调试组件比较省事。

硬汉,我是想在程序中得到地址,想请教下怎么做?

eric2013 发表于 2020-10-10 14:06:51

lhaoyue 发表于 2020-10-10 09:22
硬汉,我是想在程序中得到地址,想请教下怎么做?
任务控制块
/// Thread Control Block
typedef struct osRtxThread_s {
uint8_t                        id;///< Object Identifier
uint8_t                     state;///< Object State
uint8_t                     flags;///< Object Flags
uint8_t                        attr;///< Object Attributes
const char                  *name;///< Object Name
struct osRtxThread_s   *thread_next;///< Link pointer to next Thread in Object list
struct osRtxThread_s   *thread_prev;///< Link pointer to previous Thread in Object list
struct osRtxThread_s    *delay_next;///< Link pointer to next Thread in Delay list
struct osRtxThread_s    *delay_prev;///< Link pointer to previous Thread in Delay list
struct osRtxThread_s   *thread_join;///< Thread waiting to Join
uint32_t                      delay;///< Delay Time
int8_t                     priority;///< Thread Priority
int8_t                priority_base;///< Base Priority
uint8_t               stack_frame;///< Stack Frame (EXC_RETURN)
uint8_t               flags_options;///< Thread/Event Flags Options
uint32_t               wait_flags;///< Waiting Thread/Event Flags
uint32_t               thread_flags;///< Thread Flags
struct osRtxMutex_s   *mutex_list;///< Link pointer to list of owned Mutexes
void                     *stack_mem;///< Stack Memory
uint32_t               stack_size;///< Stack Size
uint32_t                         sp;///< Current Stack Pointer
uint32_t                thread_addr;///< Thread entry address
uint32_t                  tz_memory;///< TrustZone Memory Identifier
#ifdef RTX_TF_M_EXTENSION
uint32_t                  tz_module;///< TrustZone Module Identifier
#endif
} osRtxThread_t;

页: [1]
查看完整版本: 问下RTX5怎么得到thread stack 的起始地址?