os_dbg.c Static

os_dbg.c Static

os_dbg.c is provided in µC/OS-III as some debuggers are not able to read the values of #define constants. Specifically, os_dbg.c contains ROM variables initialized to #define constants so that users can read them with any debugger.

Below is a list of ROM variables provided in os_dbg.c, along with their descriptions. These variables use approximately 100 bytes of code space.

The application code can examine these variables and you do not need to access them in a critical region as they reside in code space and are therefore not changeable.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_DbgEn

CPU_INT08U

OS_CFG_DBG_EN

When 1, this variable indicates that ROM variables in os_dbg.c will be compiled. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_ArgChkEn

CPU_INT08U

OS_CFG_ARG_CHK_EN

When 1, this variable indicates that run-time argument checking is enabled. This means that µC/OS-III will check the validity of the values of arguments passed to functions. The feature is enabled in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_AppHooksEn

CPU_INT08U

OS_CFG_APP_HOOKS_EN

When 1, the variable indicates whether application hooks will be available to the application programmer, and the pointers listed below are declared. This value is set in os_cfg.h.

OS_AppTaskCreateHookPtr;

OS_AppTaskDelHookPtr;

OS_AppTaskReturnHookPtr;

OS_AppIdleTaskHookPtr;

OS_AppStatTaskHookPtr;

OS_AppTaskSwHookPtr;

OS_AppTimeTickHookPtr;

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_EndiannessTest

CPU_INT32U

0x12345678

This variable allows a kernel awareness debugger or µC/Probe to determine the endianness of the CPU. This is easily done by looking at the lowest address in memory where this variable is saved. If the value is 0x78 then the CPU is a little endian machine. If it’s 0x12, it is a big endian machine.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_CalledFromISRChkEn

CPU_INT08U

OS_CFG_CALLED_FROM_ISR_CHK_EN

When 1, this variable indicates that µC/OS-III will perform run-time checking to see if a function that is not supposed to be called from an ISR, is called from an ISR. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_FlagEn

CPU_INT08U

OS_CFG_FLAG_EN

When 1, this variable indicates that µC/OS-III’s event flag services are available to the application programmer. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_FlagDelEn

CPU_INT08U

OS_CFG_FLAG_DEL_EN

When 1, this variable indicates that the OSFlagDel() function is available to the application programmer. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_FlagModeClrEn

CPU_INT08U

OS_CFG_FLAG_MODE_CLR_EN

When 1, this variable indicates that you can either clear or set flags when posting and pending on event flags. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_FlagPendAbortEn

CPU_INT08U

OS_CFG_FLAG_PEND_ABORT_EN

When 1, this variable indicates that the OSFlagPendAbort() function is available to the application programmer. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_FlagGrpSize

CPU_INT16U

sizeof(OS_FLAG_GRP)

This variable indicates the memory footprint (in RAM) of an event flag group (in bytes). This data type is declared in os.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_FlagWidth

CPU_INT16U

sizeof(OS_FLAGS)

This variable indicates the word width (in bytes) of event flags. If event flags are declared as CPU_INT08U, this variable will be 1, if declared as a CPU_INT16U, this variable will be 2, etc. This OS_FLAGS data type is declared in os_type.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_MemEn

CPU_INT08U

OS_CFG_MEM_EN

When 1, this variable indicates that µC/OS-III’s memory management services are available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_MemSize

CPU_INT16U

sizeof(OS_MEM)

This variable indicates the RAM footprint (in bytes) of a memory partition control block, OS_MEM.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_MsgEn

CPU_INT08U

OS_MSG_EN

When 1, this variable indicates that the application either enabled message queues, or task message queues, or both. This value is set in os_cfg.h by ORing the value of OS_CFG_Q_EN and OS_CFG_TASK_Q_EN.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_MsgSize

CPU_INT16U

sizeof(OS_MSG)

This variable indicates the RAM footprint (in bytes) of an OS_MSG data structure.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_MsgPoolSize

CPU_INT16U

sizeof(OS_MSG_POOL)

This variable indicates the RAM footprint (in bytes) of an OS_MSG_POOL data structure.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_MsgQSize

CPU_INT16U

sizeof(OS_MSG_Q)

This variable indicates the RAM footprint (in number of bytes) of an OS_MSG_Q data type.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_MutexEn

CPU_INT08U

OS_CFG_MUTEX_EN

When 1, this variable indicates that µC/OS-III’s mutual exclusion semaphore management services are available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_MutexDelEn

CPU_INT08U

OS_CFG_MUTEX_DEL_EN

When 1, this variable indicates that the function OSMutexDel() is available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_MutexPendAbortEn

CPU_INT08U

OS_CFG_MUTEX_PEND_ABORT_EN

When 1, the variable indicates that the function OSMutexPendAbort() is available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_MutexSize

CPU_INT16U

sizeof(OS_MUTEX)

This variable indicates the RAM footprint (in number of bytes) of an OS_MUTEX data type.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_ObjTypeChkEn

CPU_INT08U

OS_CFG_OBJ_TYPE_CHK_EN

When 1, this variable indicates that µC/OS-III will check for valid object types at run time. µC/OS-III will make sure the application is accessing a semaphore if calling OSSem???() functions, accessing a message queue when calling OSQ???() functions, etc. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_PendListSize

CPU_INT16U

sizeof(OS_PEND_LIST)

This variable indicates the RAM footprint (in bytes) of an OS_PEND_LIST data type.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_PendObjSize

CPU_INT16U

sizeof(OS_PEND_OBJ)

This variable indicates the RAM footprint (in bytes) of an OS_PEND_OBJ data type.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_PrioMax

CPU_INT16U

OS_CFG_PRIO_MAX

This variable indicates the maximum number of priorities that the application will support.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_PtrSize

CPU_INT16U

sizeof(void *)

This variable indicates the size (in bytes) of a pointer.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_QEn

CPU_INT08U

OS_CFG_Q_EN

When 1, this variable indicates that µC/OS-III’s message queue services are available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_QDelEn

CPU_INT08U

OS_CFG_Q_DEL_EN

When 1, this variable indicates that the function OSQDel() is available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_QFlushEn

CPU_INT08U

OS_CFG_Q_FLUSH_EN

When 1, this variable indicates that the function OSQFlush() is available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_QPendAbortEn

CPU_INT08U

OS_CFG_Q_PEND_ABORT_EN

When 1, this variable indicates that the function OSQPendAbort() is available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_QSize

CPU_INT16U

 

This variable indicates the RAM footprint (in number of bytes) of an OS_Q data type.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_SchedRoundRobinEn

CPU_INT08U

OS_CFG_SCHED_ROUND_ROBIN_EN

When 1, this variable indicates that the µC/OS-III round-robin scheduling feature is available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_SemEn

CPU_INT08U

OS_CFG_SEM_EN

When 1, this variable indicates that µC/OS-III’s semaphore management services are available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_SemDelEn

CPU_INT08U

OS_CFG_SEM_DEL_EN

When 1, this variable indicates that the function OSSemDel() is available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_SemPendAbortEn

CPU_INT08U

OS_CFG_SEM_PEND_ABORT_EN

When 1, this variable indicates that the function OSSemPendAbort() is available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_SemSetEn

CPU_INT08U

OS_CFG_SEM_SET_EN

When 1, this variable indicates that the function OSSemSet() is available to the application. This value is set in os_cfg.h.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value

OSDbg_SemSize

CPU_INT16U

sizeof(OS_SEM)

This variable indicates the RAM footprint (in bytes) of an OS_SEM data type.

ROM Variable

Data Type

Value

ROM Variable

Data Type

Value