Part Number: CC3551E
I observed an abnormal phenomenon while testing continuous serial port transmission. After sending a few packets of data (each packet being 256 bytes during the test), there is an interval of approximately 7.5ms in the middle of one packet. This causes the transmission speed to slow down. I tried both UART2_Mode_BLOCKING and UART2_Mode_CALLBACK in writeMode, and the same phenomenon occurs. The testing method is as follows:
1. The serial port configuration is as follows:
- UART2_Params params;
- UART2_Params_init(¶ms);
- params.baudRate = 921600;
- params.writeMode = UART2_Mode_BLOCKING;
- params.readMode = UART2_Mode_CALLBACK;
- params.readCallback = readCallback;
- params.readReturnMode = UART2_ReadReturnMode_PARTIAL;
- theHUART.handle = UART2_open(CONFIG_UART2_1, ¶ms);
2. Send via the following method: Create a transmission task with each packet of 256 bytes. In this task, send continuously. Configure a GPIO pin to pull high before each transmission and pull low after completion, which facilitates convenient observation of this anomaly.
- static int host_control_uart_send(const uint8 *buffer, uint16 length)
- {
- size_t bytesWritten;
- SET_SEND_GPIO_HIGH;
- int_fast16_t status = UART2_write(theHUART.handle, buffer, length, &bytesWritten);
- if (status != UART2_STATUS_SUCCESS) {
- return 0;
- }
- SET_SEND_GPIO_LOW;
- return bytesWritten;
- }
- void uart_test_thread(void* arg )
- {
- uint8_t test_buf[256];
- for(int i=0; i<256; i++)
- {
- test_buf[i] = i;
- }
- while(1)
- {
- host_control_uart_send(test_buf, 256);
- vTaskDelay(1/portTICK_PERIOD_MS);
- }
- vTaskDelete(NULL);
- }
- void host_uart_test(void)
- {
- xTaskCreate(uart_test_thread, ((const char*)"uart_test_thread"), 1024, NULL, tskIDLE_PRIORITY + 3, NULL);
- }
3. The phenomenon captured by the logic analyzer is as follows: after sending a few packets of data, there is an interval of approximately 7.5ms in the middle of one packet transmission, which will result in a slower speed when sending data continuously.





