K64 SDK 2.5 SerialManager hangs in SerialManager_Init

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K64 SDK 2.5 SerialManager hangs in SerialManager_Init

685 Views
jeff_rosen
Contributor II

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.    

Tags (2)
0 Kudos
2 Replies

545 Views
jeff_rosen
Contributor II

I tried to narrow this down to a minimal example. When I do that, there is no issue using both UARTs from SerialManager.  There must be a bug somewhere else in my code that is conflicting with SerialManager.  I will keep investigating and report if I discover anything.

0 Kudos

545 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jeffrey Rosen,

  Do you try to modify the function based on the official FRDM-K64 SDK code? Take an example, the hello_world, you can use BOARD_InitDebugConsole to configure your SerialManager.

  Take an example, if you want to use UART0, you can configure the UART0 directly, the default helloworld is using the UART0.

   You can test UART0 and UART1 independently, after both of the two interface works, then you can try to mix it together.


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos