1 /* 2 * Copyright (c) 2016, Freescale Semiconductor, Inc. 3 * Copyright 2016-2017 NXP 4 * All rights reserved. 5 * 6 * SPDX-License-Identifier: BSD-3-Clause 7 */ 8 9 #include <stdint.h> 10 #include "fsl_common.h" 11 #include "clock_config.h" 12 #include "board.h" 13 #include "fsl_debug_console.h" 14 15 /******************************************************************************* 16 * Variables 17 ******************************************************************************/ 18 19 /* Clock rate on the CLKIN pin */ 20 const uint32_t ExtClockIn = BOARD_EXTCLKINRATE; 21 22 /******************************************************************************* 23 * Code 24 ******************************************************************************/ 25 /* Initialize debug console. */ BOARD_InitDebugConsole(void)26status_t BOARD_InitDebugConsole(void) 27 { 28 #if ((SDK_DEBUGCONSOLE == DEBUGCONSOLE_REDIRECT_TO_SDK) || defined(SDK_DEBUGCONSOLE_UART)) 29 status_t result; 30 /* attach 12 MHz clock to FLEXCOMM0 (debug console) */ 31 CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH); 32 RESET_PeripheralReset(BOARD_DEBUG_UART_RST); 33 result = DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, BOARD_DEBUG_UART_BAUDRATE, BOARD_DEBUG_UART_TYPE, 34 BOARD_DEBUG_UART_CLK_FREQ); 35 assert(kStatus_Success == result); 36 return result; 37 #else 38 return kStatus_Success; 39 #endif 40 } 41