ESP32的串口使用队列接收256字节数据正常,但是将串口配置成485接收数据超过120字节后会自动分包,这是底层限制了485接收的数据长度还是配置上出现问题?
485配置如下:uart_config_t uart_config = {
.baud_rate = baudrate,
.data_bits = UART_DATA_8_BITS,
.parity = uartparity,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
//.rx_flow_ctrl_thresh = 127
.rx_flow_ctrl_thresh = 255
};
uart_param_config(EX_UART_NUM0, &uart_config);
uart_set_pin(EX_UART_NUM0, HAL_RS485_TX_0, HAL_RS485_RX_0, HAL_RS485_DE_0, UART_PIN_NO_CHANGE);
uart_driver_install(EX_UART_NUM0, BUF1_SIZE * 2, BUF1_SIZE * 2, 20, &uart_queue, 0);
uart_set_mode(EX_UART_NUM0, UART_MODE_RS485_HALF_DUPLEX);
//Set uart pattern detect function.
uart_enable_pattern_det_intr(EX_UART_NUM0, '+', PATTERN_CHR_NUM1, 10000, 10, 10);
//Reset the pattern queue length to record at most 20 pattern positions.
uart_pattern_queue_reset(EX_UART_NUM0, 20);
共5条
1/1 1 跳转至页
[求助]ESP32485对接接收会自动分包问题
关键词: 求助 ESP32 485 对接 接收 会自动 分包
共5条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |