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.

CC3235SF 上电初始化时串口接收异常

Other Parts Discussed in Thread: CC3235SF

 在使用CC3235SF的过程中,使用DMA做串口数据的收发。若先开启串口的DMA接收使能,在初始化wifi的sl_Task过程中出现异常,串口会收到大量的异常数据,最终可能会导致wifi启动失败即sl_Start返回错误状态,致使模块不能正常工作。只有在启动wifi的sl_Task之后的一段时间开启串口DMA接收使能才能正常收到数据。大致过程如下面所示:

若按照第一段代码会出现异常,主要表现形式就是串口会收到大量的异常数据,或者RX不能接收数据,或者模块重启

freertos task1

{

dma_uart_init();

MAP_UARTDMAEnable(UARTA0_BASE, UART_DMA_RX);

uart_recv();

}

freertos task2

{

pthread_create(&spawn_thread, &pAttrs_spawn, sl_Task, NULL);

ret= sl_Start(NULL, NULL, NULL);

wifi_recv();

}

若在使能DMA串口的时候加入大于3秒的延时,模块就能正常工作

freertos task1

{

dma_uart_init();

vTaskDelay(3000);//

MAP_UARTDMAEnable(UARTA0_BASE, UART_DMA_RX);

uart_recv();

}

freertos task2

{

pthread_create(&spawn_thread, &pAttrs_spawn, sl_Task, NULL);

ret= sl_Start(NULL, NULL, NULL);

wifi_recv();

}

我猜测是否在初始化wifi协议栈期间模块的串口或者DMA通道出现异常所致?

我已经测试过很多次,若是在初始化期间不使能串口DMA或者延迟使能,就不会异常