eric2013 发表于 2023-5-17 06:02:10

H7-TOOL的RTOS Trace增加uCOS-II Trace支持,预计本周完成,同时更新FreeRTOS Trace用户手头添加变量地址玩法(2023-05-24)


当前Trace功能已经支持uCOS-III,RTX5和ThreadX,本周开始增加下uCOS-II的Trace支持,另外FreeRTOS也发布临时玩法会大家。

https://img.anfulai.cn/dz/attachment/forum/202302/27/172601mlyaks5bj8j98x9z.png

eric2013 发表于 2023-5-18 09:05:57


2023-05-18

先用最新的uCOS-II V2.93.00测试

eric2013 发表于 2023-5-21 01:25:24

2023-05-21

关键代码记录:

/*
*********************************************************************************************************
*                                              uC/OS-II
*                                        The Real-Time Kernel
*
*                  Copyright 1992-2020 Silicon Laboratories Inc. www.silabs.com
*
*                                 SPDX-License-Identifier: APACHE-2.0
*
*               This software is subject to an open source license and is distributed by
*                Silicon Laboratories Inc. pursuant to the terms of the Apache License,
*                  Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*
*                                          DEBUGGER CONSTANTS
*
* Filename : os_dbg_r.c
* Version: V2.93.00
*********************************************************************************************************
*/

#defineMICRIUM_SOURCE

#include <ucos_ii.h>

/*
*********************************************************************************************************
*                                             DEBUG DATA
*********************************************************************************************************
*/

INT16UconstOSDebugEn             = OS_DEBUG_EN;             /* Debug constants are defined below   */

#if OS_DEBUG_EN > 0u

INT32UconstOSEndiannessTest      = 0x12345678uL;            /* Variable to test CPU endianness   */

INT16UconstOSEventEn             = OS_EVENT_EN;
INT16UconstOSEventMax            = OS_MAX_EVENTS;         /* Number of event control blocks      */
INT16UconstOSEventNameEn         = OS_EVENT_NAME_EN;
#if (OS_EVENT_EN) && (OS_MAX_EVENTS > 0u)
INT16UconstOSEventSize         = sizeof(OS_EVENT);      /* Size in Bytes of OS_EVENT         */
INT16UconstOSEventTblSize      = sizeof(OSEventTbl);      /* Size of OSEventTbl[] in bytes       */
#else
INT16UconstOSEventSize         = 0u;
INT16UconstOSEventTblSize      = 0u;
#endif
INT16UconstOSEventMultiEn      = OS_EVENT_MULTI_EN;


INT16UconstOSFlagEn            = OS_FLAG_EN;
#if (OS_FLAG_EN > 0u) && (OS_MAX_FLAGS > 0u)
INT16UconstOSFlagGrpSize         = sizeof(OS_FLAG_GRP);   /* Size in Bytes of OS_FLAG_GRP      */
INT16UconstOSFlagNodeSize      = sizeof(OS_FLAG_NODE);    /* Size in Bytes of OS_FLAG_NODE       */
INT16UconstOSFlagWidth         = sizeof(OS_FLAGS);      /* Width (in bytes) of OS_FLAGS      */
#else
INT16UconstOSFlagGrpSize         = 0u;
INT16UconstOSFlagNodeSize      = 0u;
INT16UconstOSFlagWidth         = 0u;
#endif
INT16UconstOSFlagMax             = OS_MAX_FLAGS;
INT16UconstOSFlagNameEn          = OS_FLAG_NAME_EN;

INT16UconstOSLowestPrio          = OS_LOWEST_PRIO;

INT16UconstOSMboxEn            = OS_MBOX_EN;

INT16UconstOSMemEn               = OS_MEM_EN;
INT16UconstOSMemMax            = OS_MAX_MEM_PART;         /* Number of memory partitions         */
INT16UconstOSMemNameEn         = OS_MEM_NAME_EN;
#if (OS_MEM_EN > 0u) && (OS_MAX_MEM_PART > 0u)
INT16UconstOSMemSize             = sizeof(OS_MEM);          /* Mem. Partition header sine (bytes)*/
INT16UconstOSMemTblSize          = sizeof(OSMemTbl);
#else
INT16UconstOSMemSize             = 0u;
INT16UconstOSMemTblSize          = 0u;
#endif
INT16UconstOSMutexEn             = OS_MUTEX_EN;

INT16UconstOSPtrSize             = sizeof(void *);          /* Size in Bytes of a pointer          */

INT16UconstOSQEn               = OS_Q_EN;
INT16UconstOSQMax                = OS_MAX_QS;               /* Number of queues                  */
#if (OS_Q_EN > 0u) && (OS_MAX_QS > 0u)
INT16UconstOSQSize               = sizeof(OS_Q);            /* Size in bytes of OS_Q structure   */
#else
INT16UconstOSQSize               = 0u;
#endif

INT16UconstOSRdyTblSize          = OS_RDY_TBL_SIZE;         /* Number of bytes in the ready table*/

INT16UconstOSSemEn               = OS_SEM_EN;

INT16UconstOSStkWidth            = sizeof(OS_STK);          /* Size in Bytes of a stack entry      */

INT16UconstOSTaskCreateEn      = OS_TASK_CREATE_EN;
INT16UconstOSTaskCreateExtEn   = OS_TASK_CREATE_EXT_EN;
INT16UconstOSTaskDelEn         = OS_TASK_DEL_EN;
INT16UconstOSTaskIdleStkSize   = OS_TASK_IDLE_STK_SIZE;
INT16UconstOSTaskProfileEn       = OS_TASK_PROFILE_EN;
INT16UconstOSTaskMax             = OS_MAX_TASKS + OS_N_SYS_TASKS; /* Total max. number of tasks    */
INT16UconstOSTaskNameEn          = OS_TASK_NAME_EN;
INT16UconstOSTaskStatEn          = OS_TASK_STAT_EN;
INT16UconstOSTaskStatStkSize   = OS_TASK_STAT_STK_SIZE;
INT16UconstOSTaskStatStkChkEn    = OS_TASK_STAT_STK_CHK_EN;
INT16UconstOSTaskSwHookEn      = OS_TASK_SW_HOOK_EN;
INT16UconstOSTaskRegTblSize      = OS_TASK_REG_TBL_SIZE;

INT16UconstOSTCBPrioTblMax       = OS_LOWEST_PRIO + 1u;   /* Number of entries in OSTCBPrioTbl[] */
INT16UconstOSTCBSize             = sizeof(OS_TCB);          /* Size in Bytes of OS_TCB             */
INT16UconstOSTicksPerSec         = OS_TICKS_PER_SEC;
INT16UconstOSTimeTickHookEn      = OS_TIME_TICK_HOOK_EN;
INT16UconstOSVersionNbr          = OS_VERSION;

#if OS_TASK_CREATE_EXT_EN > 0u
#if defined(OS_TLS_TBL_SIZE) && (OS_TLS_TBL_SIZE > 0u)
INT16UconstOS_TLS_TblSize      = OS_TLS_TBL_SIZE * sizeof(OS_TLS);
#else
INT16UconstOS_TLS_TblSize      = 0u;
#endif
#endif

INT16UconstOSTmrEn               = OS_TMR_EN;
INT16UconstOSTmrCfgMax         = OS_TMR_CFG_MAX;
INT16UconstOSTmrCfgNameEn      = OS_TMR_CFG_NAME_EN;
INT16UconstOSTmrCfgWheelSize   = OS_TMR_CFG_WHEEL_SIZE;
INT16UconstOSTmrCfgTicksPerSec   = OS_TMR_CFG_TICKS_PER_SEC;

#if (OS_TMR_EN > 0u) && (OS_TMR_CFG_MAX > 0u)
INT16UconstOSTmrSize             = sizeof(OS_TMR);
INT16UconstOSTmrTblSize          = sizeof(OSTmrTbl);
INT16UconstOSTmrWheelSize      = sizeof(OS_TMR_WHEEL);
INT16UconstOSTmrWheelTblSize   = sizeof(OSTmrWheelTbl);
#else
INT16UconstOSTmrSize             = 0u;
INT16UconstOSTmrTblSize          = 0u;
INT16UconstOSTmrWheelSize      = 0u;
INT16UconstOSTmrWheelTblSize   = 0u;
#endif

#endif


/*
*********************************************************************************************************
*                                             DEBUG DATA
*                            TOTAL DATA SPACE (i.e. RAM) USED BY uC/OS-II
*********************************************************************************************************
*/
#if OS_DEBUG_EN > 0u

INT16UconstOSDataSize = sizeof(OSCtxSwCtr)
#if (OS_EVENT_EN) && (OS_MAX_EVENTS > 0u)
                        + sizeof(OSEventFreeList)
                        + sizeof(OSEventTbl)
#endif

#if (OS_FLAG_EN > 0u) && (OS_MAX_FLAGS > 0u)
                        + sizeof(OSFlagTbl)
                        + sizeof(OSFlagFreeList)
#endif

#if OS_TASK_STAT_EN > 0u
                        + sizeof(OSCPUUsage)
                        + sizeof(OSIdleCtrMax)
                        + sizeof(OSIdleCtrRun)
                        + sizeof(OSStatRdy)
                        + sizeof(OSTaskStatStk)
#endif

#if OS_TICK_STEP_EN > 0u
                        + sizeof(OSTickStepState)
#endif

#if (OS_MEM_EN > 0u) && (OS_MAX_MEM_PART > 0u)
                        + sizeof(OSMemFreeList)
                        + sizeof(OSMemTbl)
#endif

#ifdef OS_SAFETY_CRITICAL_IEC61508
                        + sizeof(OSSafetyCriticalStartFlag)
#endif

#if (OS_Q_EN > 0u) && (OS_MAX_QS > 0u)
                        + sizeof(OSQFreeList)
                        + sizeof(OSQTbl)
#endif

#if OS_TASK_REG_TBL_SIZE > 0u
                        + sizeof(OSTaskRegNextAvailID)
#endif

#if OS_TIME_GET_SET_EN > 0u
                        + sizeof(OSTime)
#endif

#if (OS_TMR_EN > 0u) && (OS_TMR_CFG_MAX > 0u)
                        + sizeof(OSTmrFree)
                        + sizeof(OSTmrUsed)
                        + sizeof(OSTmrTime)
                        + sizeof(OSTmrSem)
                        + sizeof(OSTmrSemSignal)
                        + sizeof(OSTmrTbl)
                        + sizeof(OSTmrFreeList)
                        + sizeof(OSTmrTaskStk)
                        + sizeof(OSTmrWheelTbl)
#endif
                        + sizeof(OSIntNesting)
                        + sizeof(OSLockNesting)
                        + sizeof(OSPrioCur)
                        + sizeof(OSPrioHighRdy)
                        + sizeof(OSRdyGrp)
                        + sizeof(OSRdyTbl)
                        + sizeof(OSRunning)
                        + sizeof(OSTaskCtr)
                        + sizeof(OSIdleCtr)
                        + sizeof(OSTaskIdleStk)
                        + sizeof(OSTCBCur)
                        + sizeof(OSTCBFreeList)
                        + sizeof(OSTCBHighRdy)
                        + sizeof(OSTCBList)
                        + sizeof(OSTCBPrioTbl)
                        + sizeof(OSTCBTbl);

#endif


/*
*********************************************************************************************************
*                                       OS DEBUG INITIALIZATION
*
* Description: This function is used to make sure that debug variables that are unused in the application
*            are not optimized away.This function might not be necessary for all compilers.In this
*            case, you should simply DELETE the code in this function while still leaving the declaration
*            of the function itself.
*
* Arguments: none
*
* Returns    : none
*
* Note(s)    : (1) This code doesn't do anything, it simply prevents the compiler from optimizing out
*                  the 'const' variables which are declared in this file.
*            (2) You may decide to 'compile out' the code (by using #if 0/#endif) INSIDE the function
*                  if your compiler DOES NOT optimize out the 'const' variables above.
*********************************************************************************************************
*/

#if OS_DEBUG_EN > 0u
voidOSDebugInit (void)
{
    voidconst*ptemp;


    ptemp = (void const *)&OSDebugEn;

    ptemp = (void const *)&OSEndiannessTest;

    ptemp = (void const *)&OSEventMax;
    ptemp = (void const *)&OSEventNameEn;
    ptemp = (void const *)&OSEventEn;
    ptemp = (void const *)&OSEventSize;
    ptemp = (void const *)&OSEventTblSize;
    ptemp = (void const *)&OSEventMultiEn;

    ptemp = (void const *)&OSFlagEn;
    ptemp = (void const *)&OSFlagGrpSize;
    ptemp = (void const *)&OSFlagNodeSize;
    ptemp = (void const *)&OSFlagWidth;
    ptemp = (void const *)&OSFlagMax;
    ptemp = (void const *)&OSFlagNameEn;

    ptemp = (void const *)&OSLowestPrio;

    ptemp = (void const *)&OSMboxEn;

    ptemp = (void const *)&OSMemEn;
    ptemp = (void const *)&OSMemMax;
    ptemp = (void const *)&OSMemNameEn;
    ptemp = (void const *)&OSMemSize;
    ptemp = (void const *)&OSMemTblSize;

    ptemp = (void const *)&OSMutexEn;

    ptemp = (void const *)&OSPtrSize;

    ptemp = (void const *)&OSQEn;
    ptemp = (void const *)&OSQMax;
    ptemp = (void const *)&OSQSize;

    ptemp = (void const *)&OSRdyTblSize;

    ptemp = (void const *)&OSSemEn;

    ptemp = (void const *)&OSStkWidth;

    ptemp = (void const *)&OSTaskCreateEn;
    ptemp = (void const *)&OSTaskCreateExtEn;
    ptemp = (void const *)&OSTaskDelEn;
    ptemp = (void const *)&OSTaskIdleStkSize;
    ptemp = (void const *)&OSTaskProfileEn;
    ptemp = (void const *)&OSTaskMax;
    ptemp = (void const *)&OSTaskNameEn;
    ptemp = (void const *)&OSTaskStatEn;
    ptemp = (void const *)&OSTaskStatStkSize;
    ptemp = (void const *)&OSTaskStatStkChkEn;
    ptemp = (void const *)&OSTaskSwHookEn;

    ptemp = (void const *)&OSTCBPrioTblMax;
    ptemp = (void const *)&OSTCBSize;

    ptemp = (void const *)&OSTicksPerSec;
    ptemp = (void const *)&OSTimeTickHookEn;

#if OS_TMR_EN > 0u
    ptemp = (void const *)&OSTmrTbl;
    ptemp = (void const *)&OSTmrWheelTbl;

    ptemp = (void const *)&OSTmrEn;
    ptemp = (void const *)&OSTmrCfgMax;
    ptemp = (void const *)&OSTmrCfgNameEn;
    ptemp = (void const *)&OSTmrCfgWheelSize;
    ptemp = (void const *)&OSTmrCfgTicksPerSec;
    ptemp = (void const *)&OSTmrSize;
    ptemp = (void const *)&OSTmrTblSize;

    ptemp = (void const *)&OSTmrWheelSize;
    ptemp = (void const *)&OSTmrWheelTblSize;
#endif

    ptemp = (void const *)&OSVersionNbr;

    ptemp = (void const *)&OSDataSize;

    ptemp = ptemp;                           /* Prevent compiler warning for 'ptemp' not being used! */
}
#endif

eric2013 发表于 2023-5-22 02:53:48

2023-05-22

可以识别了



eric2013 发表于 2023-5-24 01:22:25

2023-05-24


页: [1]
查看完整版本: H7-TOOL的RTOS Trace增加uCOS-II Trace支持,预计本周完成,同时更新FreeRTOS Trace用户手头添加变量地址玩法(2023-05-24)