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.

CC1352 launched Pad EVK开发板 串口初始化及GPIO中断问题



使用CC1352P1 EVK,开启GPIO中断功能,开启串口功能,但是不知道初始化代码是否哪里编写不正确,导致两个功能不能同时创建成功:代码如下:

1、当屏蔽GPIO_init(),那么串口初始化正常,PIN_GPIO的返回值为0,GPIO初始化失败,

2、当屏蔽UART_init(),那么GPIO正常,但是串口OPEN失败,后面发现OPEN的返回值shi NULL,进入while(1),

3、当两个init函数都开启,那么GPIO初始化失败,串口成功。

int main(void)
{
    /* Call driver init functions. */
    Board_initGeneral();
    GPIO_init();
    UART_init();

    /* Open LED pins */
    pinHandle = PIN_open(&pinState, pinTable);
    Assert_isTrue(pinHandle != NULL, NULL);
    /* Setup callback for button pins */
    PIN_Status status = PIN_registerIntCb(pinHandle, &buttonCallbackFunction);
    Assert_isTrue(status == PIN_SUCCESS, NULL);
    
    UART_Params_init(&uartParams);
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.readDataMode = UART_DATA_BINARY;
    uartParams.readReturnMode = UART_RETURN_FULL;
    uartParams.baudRate = 115200;

    uart = UART_open(CONFIG_UART_0, &uartParams);

    if (uart == NULL) {
    /* UART_open() failed */
    while (1);
    }