AnsweredAssumed Answered

K64 SDK 2.5 SerialManager hangs in SerialManager_Init

Question asked by Jeffrey Rosen on Jun 9, 2019
Latest reply on Jun 10, 2019 by Kerry Zhou

Unfortunately, I don't have JTAG or SWD debugging capability.  The hardware is the Teensy 3.5 (MK64FX512VMD12) and I am able to successfully configure the debug console to use UART1.

    DbgConsole_Init(1, 115200, kSerialPort_Uart, CLOCK_GetFreq(UART1_CLK_SRC));

When I try and open a second UART, say UART0 as follows:

    serial_manager_config_t config;
    serial_port_uart_config_t uartConfig;
    config.type = kSerialPort_Uart;
    config.ringBuffer = &gps_ringBuffer[0];
    config.ringBufferSize = GPS_UART_BUFFER_SIZE;
    uartConfig.instance = 0;
    uartConfig.clockRate = CLOCK_GetFreq(UART0_CLK_SRC);
    uartConfig.baudRate = 115200;
    uartConfig.parityMode = kSerialManager_UartParityDisabled;
    uartConfig.stopBitCount = kSerialManager_UartOneStopBit;
    uartConfig.enableRx = 1;
    uartConfig.enableTx = 1;
    config.portConfig = &uartConfig;
    PRINTF("Calling SerialManager_Init\r\n");
    serial_manager_status_t status = SerialManager_Init(gps_serialHandle, &config);
    PRINTF("SerialManager_Init returned: %d\r\n", status);
    if (status == kStatus_SerialManager_Success) {
        PRINTF("Calling SerialManager_OpenReadHandle\r\n");
        status = SerialManager_OpenReadHandle(gps_serialHandle, gps_serialReadHandle);
        PRINTF("SerialManager_OpenReadHandle returned: %d\r\n", status);
    }

The code hangs somewhere in SerialManager_Init.  Since I'm limited to debug console debugging and that depends on SerialManager it is tricky to try and debug.  

 

First, I would just like to confirm that my understanding of SerialManager is correct. If the debug console is already using UART1, does the approach above look correct in order to use SerialManager for the new port (UART0)?  Any suggestions on what to try would be appreciated.    

Outcomes