MCUXpresso SDK API Reference Manual  Rev 2.15.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
debug console configuration

The configuration is used for debug console only. More...

Overview

 .

Please note, it is not sued for debug console lite.

Macros

#define DEBUG_CONSOLE_TRANSMIT_BUFFER_LEN   (512U)
 If Non-blocking mode is needed, please define it at project setting, otherwise blocking mode is the default transfer mode. More...
 
#define DEBUG_CONSOLE_RECEIVE_BUFFER_LEN   (1024U)
 define the receive buffer length which is used to store the user input, buffer is enabled automatically when non-blocking transfer is using, This value will affect the RAM's ultilization, should be set per paltform's capability and software requirement. More...
 
#define DEBUG_CONSOLE_TX_RELIABLE_ENABLE   (1U)
 Whether enable the reliable TX function If the macro is zero, the reliable TX function of the debug console is disabled. More...
 
#define DEBUG_CONSOLE_RX_ENABLE   (1U)
 Whether enable the RX function If the macro is zero, the receive function of the debug console is disabled.
 
#define DEBUG_CONSOLE_PRINTF_MAX_LOG_LEN   (128U)
 define the MAX log length debug console support , that is when you call printf("log", x);, the log length can not bigger than this value. More...
 
#define DEBUG_CONSOLE_SCANF_MAX_LOG_LEN   (20U)
 define the buffer support buffer scanf log length, that is when you call scanf("log", &x);, the log length can not bigger than this value. More...
 
#define DEBUG_CONSOLE_SYNCHRONIZATION_BM   0
 Debug console synchronization User should not change these macro for synchronization mode, but add the corresponding synchronization mechanism per different software environment. More...
 
#define DEBUG_CONSOLE_SYNCHRONIZATION_FREERTOS   1
 synchronization for freertos software
 
#define DEBUG_CONSOLE_SYNCHRONIZATION_MODE   DEBUG_CONSOLE_SYNCHRONIZATION_BM
 RTOS synchronization mechanism disable If not defined, default is enable, to avoid multitask log print mess. More...
 
#define DEBUG_CONSOLE_ENABLE_ECHO_FUNCTION   0
 echo function support If you want to use the echo function,please define DEBUG_CONSOLE_ENABLE_ECHO at your project setting.
 
#define BOARD_USE_VIRTUALCOM   0U
 Definition to select virtual com(USB CDC) as the debug console. More...
 

Macro Definition Documentation

#define DEBUG_CONSOLE_TRANSMIT_BUFFER_LEN   (512U)

Warning: If you want to use non-blocking transfer,please make sure the corresponding IO interrupt is enable, otherwise there is no output. And non-blocking is combine with buffer, no matter bare-metal or rtos. Below shows how to configure in your project if you want to use non-blocking mode. For IAR, right click project and select "Options", define it in "C/C++ Compiler->Preprocessor->Defined symbols". For KEIL, click "Options for Target…", define it in "C/C++->Preprocessor Symbols->Define". For ARMGCC, open CmakeLists.txt and add the following lines, "SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG_CONSOLE_TRANSFER_NON_BLOCKING")" for debug target. "SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDEBUG_CONSOLE_TRANSFER_NON_BLOCKING")" for release target. For MCUxpresso, right click project and select "Properties", define it in "C/C++ Build->Settings->MCU C Complier->Preprocessor".

define the transmit buffer length which is used to store the multi task log, buffer is enabled automatically when non-blocking transfer is using, This value will affect the RAM's ultilization, should be set per paltform's capability and software requirement. If it is configured too small, log maybe missed , because the log will not be buffered if the buffer is full, and the print will return immediately with -1. And this value should be multiple of 4 to meet memory alignment.

#define DEBUG_CONSOLE_RECEIVE_BUFFER_LEN   (1024U)

If it is configured too small, log maybe missed, because buffer will be overwrited if buffer is too small. And this value should be multiple of 4 to meet memory alignment.

#define DEBUG_CONSOLE_TX_RELIABLE_ENABLE   (1U)

When the macro is zero, the string of PRINTF will be thrown away after the transmit buffer is full.

#define DEBUG_CONSOLE_PRINTF_MAX_LOG_LEN   (128U)

This macro decide the local log buffer length, the buffer locate at stack, the stack maybe overflow if the buffer is too big and current task stack size not big enough.

#define DEBUG_CONSOLE_SCANF_MAX_LOG_LEN   (20U)

As same as the DEBUG_CONSOLE_BUFFER_PRINTF_MAX_LOG_LEN.

#define DEBUG_CONSOLE_SYNCHRONIZATION_BM   0

Such as, if another RTOS is used, add: #define DEBUG_CONSOLE_SYNCHRONIZATION_XXXX 3 in this configuration file and implement the synchronization in fsl.log.c.

synchronization for baremetal software

#define DEBUG_CONSOLE_SYNCHRONIZATION_MODE   DEBUG_CONSOLE_SYNCHRONIZATION_BM

If other RTOS is used, you can implement the RTOS's specific synchronization mechanism in fsl.log.c If synchronization is disabled, log maybe messed on terminal.

#define BOARD_USE_VIRTUALCOM   0U