I have just installed MCUXpresso V11.1.1 and with it the prebuilt SDK V2.7.0 for the RT1062 CPU. I then imported the SDK example for hello world. I am using the onboard UART to for the debug output. This did not work. Upon investigation I found in board.c/h the following:
/* The UART to use for debug messages. */
#define BOARD_DEBUG_UART_TYPE DEBUG_CONSOLE_DEVICE_TYPE_UART
#define BOARD_DEBUG_UART_BASEADDR (uint32_t) LPUART1
#define BOARD_DEBUG_UART_INSTANCE 1U
/* Initialize debug console. */
void BOARD_InitDebugConsole(void)
{
uint32_t uartClkSrcFreq = BOARD_DebugConsoleSrcFreq();
DbgConsole_Init(BOARD_DEBUG_UART_BASEADDR, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, uartClkSrcFreq);
}
The call to DbgConsole_Init() is inconsistant with the prototype in fsl_debug_console.h:
status_t DbgConsole_Init(uint8_t instance, uint32_t baudRate, serial_port_type_t device, uint32_t clkSrcFreq);
I changed to code in board.c to the following:
/* Initialize debug console. */
void BOARD_InitDebugConsole(void)
{
uint32_t uartClkSrcFreq = BOARD_DebugConsoleSrcFreq();
DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE , BOARD_DEBUG_UART_BAUDRATE, kSerialPort_Uart, uartClkSrcFreq);
}
And the example now works.
There seems to be a mix up with the way that the debug console was defined in earlier versions of the SDK. I havent looked at other examples but the board.c/board.h module is common toi a lot of these examples so I am guessing they wioll all have a similar problem.
I love the fact that NXP provides so much example code, but it is less than useful when one of the more elementary examples designed to check that your build and debug enviroment is running ok does not work!!
Martin