This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2642R: Calling UART2_write for 2 tasks will cause a hardfault

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello,team

   SDK:C:\ti\simplelink_cc13xx_cc26xx_sdk_7_41_00_17.

   code:

int bsp_uart_open(uint32_t baudrate, UART_FNCT_RESPONSE respfnct)
{
    (void)baudrate;

    UART2_Params uartParams;
    /* Create a UART where the default read and write mode is BLOCKING */
    UART2_Params_init(&uartParams);
    uartParams.readMode     = UART2_Mode_NONBLOCKING;
    uartParams.writeMode    = UART2_Mode_BLOCKING;
    uartParams.baudRate     = UART_DEBUG_BAUDRATE;
    uart2_1_handle = UART2_open(CONFIG_UART_1_DEBUG, &uartParams);
    if (uart2_1_handle == NULL)
    {
        /* UART2_1_open() failed */
        DEBUG_ASSERT(0);
        return -1;
    }
    
    /* Create a UART in CALLBACK read mode */
    UART2_Params_init(&uartParams);
    uartParams.readMode     = UART2_Mode_NONBLOCKING;
    uartParams.writeMode    = UART2_Mode_BLOCKING;
    uartParams.baudRate     = UART_MCU_BAUDRATE;
    uart2_0_handle = UART2_open(CONFIG_UART_0_BLE, &uartParams);
    if (uart2_0_handle == NULL)
    {
        /* UART2_0_open() failed */
        DEBUG_ASSERT(0);
        return -1;
    }

    gBspUARTStat.respfnct  = respfnct;
    gBspUARTStat.open_flag = true;

    return 0;
}

After the previous task calls UART2_write, the next task calls this write interface function hardfault occurs. 

error code: