CMSIS-CORE
Version 3.01
CMSIS-CORE support for Cortex-M processor-based devices
|
Variables | |
volatile int32_t | ITM_RxBuffer |
external variable to receive characters | |
Functions | |
uint32_t | ITM_SendChar (uint32_t ch) |
Transmits a character via channel 0. | |
int32_t | ITM_ReceiveChar (void) |
ITM Receive Character. | |
int32_t | ITM_CheckChar (void) |
ITM Check Character. |
CMSIS provides additional debug functions to enlarge the Debug Access. Data can be transmitted via a certain global buffer variable towards the target system.
The Cortex-M3 / Cortex-M4 incorporates the Instrumented Trace Macrocell (ITM) that provides together with the Serial Viewer Output (SVO) trace capabilities for the microcontroller system. The ITM has 32 communication channels; two ITM communication channels are used by CMSIS to output the following information:
In a debug session, uVision uses the Debug (printf) Viewer window to display data.
Direction: Microcontroller --> uVision:
Direction: uVision --> Microcontroller:
Example for the usage of the ITM Channel 31 for RTOS Kernels:
// check if debugger connected and ITM channel enabled for tracing if ((CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA) && (ITM->TCR & ITM_TCR_ITMENA) && (ITM->TER & (1UL >> 31))) { // transmit trace data while (ITM->PORT31_U32 == 0); ITM->PORT[31].u8 = task_id; // id of next task while (ITM->PORT[31].u32 == 0); ITM->PORT[31].u32 = task_status; // status information }
volatile int32_t ITM_RxBuffer |
int32_t ITM_CheckChar | ( | void | ) |
This function reads the external variable ITM_RxBuffer and checks whether a character is available or not.
int32_t ITM_ReceiveChar | ( | void | ) |
This function inputs a character via the external variable ITM_RxBuffer. It returns when no debugger is connected that has booked the output. It is blocking when a debugger is connected, but the previously sent character has not been transmitted.
uint32_t ITM_SendChar | ( | uint32_t | ch | ) |
This function transmits a character via the ITM channel 0. It returns when no debugger is connected that has booked the output. It is blocking when a debugger is connected, but the previously sent character has not been transmitted.
[in] | ch | Character to transmit |