summaryrefslogtreecommitdiff
path: root/components/drivers/serial
AgeCommit message (Collapse)Author
2026-05-20[fix] components: serial_v2: preserve RT_DEVICE_FLAG_STREAM when reopening ↵Runcheng Lu
serial device - The serial_fops_open function closes and reopens the serial device,but the RT_DEVICE_FLAG_STREAM flag was not preserved across the close/open cycle. This change saves the STREAM flag before close and restores it during reopen to ensure consistent behavior. Signed-off-by: Runcheng Lu <[email protected]>
2026-05-19style: format code with clang-format [skip ci]kaidegit
2026-05-19[drivers][serial/v2] fix missing break after -RT_EPERM when buf size is 0kaidegit
When rx_bufsz or tx_bufsz is 0, the driver returns -RT_EPERM but falls through to RT_ASSERT(rx_fifo/tx_fifo != RT_NULL). Since serial_rx/serial_tx is NULL in non-buffered mode, this triggers an assertion failure. Add break after setting ret = -RT_EPERM in the four affected cases: - RT_SERIAL_CTRL_SET_RX_TIMEOUT - RT_SERIAL_CTRL_SET_TX_TIMEOUT - RT_SERIAL_CTRL_GET_RX_TIMEOUT - RT_SERIAL_CTRL_GET_TX_TIMEOUT
2026-02-27fix(serial): only apply CRLF translation in STREAM mode for poll txwdfk-prog
2026-02-25fix(drivers/ipc): correct rt_ringbuffer_peek to not consume dataShaun
2025-12-16[dm][serial] add new serial driver for DMGuEe-GUI
1. 8250 serila family (OFW, PCI, DWC, early) 2. Virtual serial (by graphic and input) 3. HVC early serial 4. ARM PL011 serial Signed-off-by: GuEe-GUI <[email protected]>
2025-12-16[dm][serial] Fixup serial tty checkGuEe-GUI
Just return if is not a tty device, don't assert Signed-off-by: GuEe-GUI <[email protected]>
2025-12-16[dm][serial] replace rt_hw_atomic_add to rt_atomic_add, clean codeGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2025-12-16[dm][serial] make DM Kconfig importGuEe-GUI
Signed-off-by: GuEe-GUI <[email protected]>
2025-12-13[dm][pinctrl] Set pinctrl default auto in platform bus. (#11052)GUI
Signed-off-by: GuEe-GUI <[email protected]>
2025-11-26[utest][serial bypass]:Add standardized documentation for Serial Bypass TestChuan
2025-11-15[docs][utest]:Add standardized utest documentation block for serialv2_tcCYFS
2025-11-07[serialv2]:Fixed the issue where the serialv2 terminal did not have the ↵CYFS
enable stream mode
2025-10-16utest: Improve the strings displayed in the menuChen Wang
Use "Test" instead of "Unit Testcases" to make string shorter. Use uppercase to make it look more eye-catching. Signed-off-by: Chen Wang <[email protected]>
2025-10-15utest: UTEST_SERIAL_POSIX_TC -> RT_UTEST_SERIAL_POSIXChen Wang
Signed-off-by: Chen Wang <[email protected]>
2025-10-15utest: UTEST_SERIAL_QEMU_TC -> RT_UTEST_SERIAL_QEMUChen Wang
Signed-off-by: Chen Wang <[email protected]>
2025-10-15utest: UTEST_SERIAL_TC -> RT_UTEST_SERIAL_V2Chen Wang
Signed-off-by: Chen Wang <[email protected]>
2025-10-15utest: UTEST_SERIAL_BYPASS -> RT_UTEST_SERIAL_BYPASSChen Wang
Signed-off-by: Chen Wang <[email protected]>
2025-10-11utest: serial: update case namesChen Wang
Follow the naming rules of utest-cases. Signed-off-by: Chen Wang <[email protected]>
2025-10-11utest: serial: move from examples to components/drivers/serialChen Wang
Signed-off-by: Chen Wang <[email protected]>
2025-09-06feat: Initialize local variables to prevent GCC compilation warningswdfk-prog
2025-09-01fix(ioctl): _IOR() overflows in switch (int) #10650Tang Haojin
2025-09-01fix: warnings generated by Kconfig.maosql
2025-08-16[component][drivers][serial_v2] 优化serial_v2 (#10603)RyanCW
* [bsp][stm32][drv_usart_v2] uart_isr不再使用链式调用,RXNE内循环读空,一些细节优化 * [componnents][drivers][serial_v2] 增加获取config接口,使用rt_tick_get_delta替代内部的时间绕回判断,写满丢弃策略rx接收数据错乱修复,clang-tidy和cppcheck审查优化 * [utest][drivers][serial_v2] 测试例程进行优化 * [bsp][stm32][drv_usart_v2] 撤回DMAMUX1修改 * [componnents][drivers][serial_v2] read和write不再返回-RT_ETIMEOUT改为已发送或读取的字节数,细节优化 * [utest][drivers][serial_v2] 增加单独的timeout测试,减少测试中的硬延时 * [utest][drivers][serial_v2] 漏提交的posix下标志位 * [utest][drivers][serial_v2] 优化测试例程 * [bsp][stm32][drv_usart_v2] transmit返回错误值,RXNE增加超时逻辑 * [componnents][drivers][serial_v2] 增加transmit错误处理,增加超时退出机制显式的避免死循环 * [componnents][drivers][serial_v2] 适配serial_v2和posix非libc标准库下的console和shell
2025-08-10[driver][serial] V1]: fix correct data loss logic when RX ring buffer is fullwdfk-prog
In the serial ISR (`rt_hw_serial_isr`), the previous logic for handling a full RX FIFO was flawed. When the buffer was filled, it would increment `get_index` (`get_index += 1`). This had two negative consequences: 1. It effectively discarded the oldest byte of data prematurely. 2. It reduced the usable capacity of a buffer of size N to N-1. For example, a 64-byte buffer could only ever hold 63 readable bytes after becoming full. This patch corrects the behavior by implementing a standard overwriting ring buffer strategy. When the buffer is full, the logic is changed to `get_index = put_index`. This ensures that: - When new data arrives, it correctly overwrites the oldest data. - The `get_index` is advanced along with the `put_index`, correctly marking the new start of the buffer. - The full N-byte capacity of the buffer is utilized, always storing the N most recent bytes. This change resolves the unexpected data loss and makes the buffer behavior correct and predictable.
2025-08-01【SMART】【BSP】【allwinner】Fix smart serial_v2 bypass compile error ↵rcitach
issue (#10524) * Modify the reference path of the header file in the middle section * format * Fix smart serial_v2 bypass compile error issue * add allwinner/d1s ci
2025-07-24[drivers][serial_v2] 修复dma下rx_flush的bugryancw
2025-05-22[components][serial_v2] ↵ryancw
写满丢弃策略对dma_ping_buf的处理有误、细节调整
2025-05-16[drivers][serial_v2]允许阻塞接收超过rx缓冲区大小的数据、增 ↵ryancw
加超时时间、flush、获取缓冲区数据长度命令、数据溢出逻辑修复、稳定性细节优化、添加更多serial_v2测试用例 [components][serial_v2] 优化txflush逻辑、对tx的activated做中断保护 [components][at] at_client适配新版serial_v2 [components][at] at_server适配新版serial_v2 [components][serial_v2] 测试用例增加循环调用,format测试用例 [components][serial_v2] poll模式判断逻辑错误 [components][serial_v2] 测试用例去掉一些非必要延时 [components][serial_v2] 测试例程使用menuconfig进行配置,更新readme [components][at_client] at_client_getchar返回值错误、at_client解析线程优先级错误设置 [components][at] 错误码应该返回负值 [components][serial_v2] TCFLSH和FIONREAD完善、control函数增加错误返回值 [components][serial_v2] RT_SERIAL_CTRL_GET_RX_DATA_LEN更改为RT_SERIAL_CTRL_GET_UNREAD_BYTES_COUNT [utest][serial_v2] TC_UART_SEND_TIMES替换为RT_SERIAL_TC_SEND_ITERATIONS [components][serial_v2] FIONREAD参数应该是无符号类型 [utest][serial_v2] 完善测试用例 [components][serial_v2] 避免使用三目运算符 [components][serial_v2] 使用clang-format格式化代码 [components][serial_v2] 添加get超时时间命令 [components][serial_v2] 完善posix接口 [components][serial_v2] 阻塞接口添加阻塞时间为0时的处理逻辑、优化RX阻塞接收逻辑 [components][serial_v2] 设置超时时间命令的参数改为指针形式 [components][serial_v2] nbuf发送添加超时时间为0时的逻辑 [components][serial_v2] 完善添加测试用例 [utest][serial_v2] 修复依赖关系 [components][serial_v2] 非阻塞模式下tx_flush错误修复 [components][serial_v2] activated使用原子API [components][serial_v2] 优化DMA逻辑、没使能DMA时屏蔽DMA逻辑节约资源 [components][serial_v2] 提供写满时丢弃新数据和覆盖旧数据策略,写满丢弃策略效率更高 [components][serial_v2] 部分平台适配写满时两种策略功能 [components][serial_v2] DMA模式暂不支持丢弃新数据策略 [utest][serial_v2] 优化测试代码 [components][serial_v2] DMA模式下使用乒乓缓冲、DMA模式支持丢弃新数据策略 [utest][serial_v2] 适配DMA乒乓缓冲 [bsp][serial_v2] 部分bsp适配DMA下乒乓缓冲 [components][serial_v2] 使用spinlock替换中断,对部分结构体变量使用原子操作 [utest][serial_v2] 更新测试用例 [components][at] 适配new serialv2不再判断RTT版本号 [components][at] 删除多余的中文注释 [utest][serial_v2] 添加交叉echo示例,qemu环境下专用 [bsp][qemu] 适配串口v2并开启fifo [components][at] 修复合并导致的错误 [bsp][n32] 适配serial_v2,没有经过测试 [components][serial_v2] 格式化代码 [utest][serial_v2] 删除无意义的打印
2025-01-20fix when open samrt but using msh after run elf file the msh will downzhujiale
2024-12-17[serial] add bypass testcase in utestzhujiale
2024-12-17[serial] add bypass hook to direct processing char when uart irq comingzhujiale
2024-11-24[drivers] fixed a minor typo in the comments of dev_serial_v2.cPermissionDenied7335
2024-09-13[drivers] Specifies the name of the drivers driver fileCXSforHPU
https://github.com/RT-Thread/rt-thread/pull/9420
2024-07-09[smart/tty] skip configure of rt_serial on tty open (#9152)Shell
Skip configure on open since all configs are copied from the current configuration on device. So we don't bother to set it back to device again. Changes: - test and skip configuration on open() of tty device Signed-off-by: Shell <[email protected]>
2024-07-09[fixed]serial_v2.c兼容DFS_V2接口 (#9153)LaterComer
2024-06-27[drivers][serial V1]poll tx 增加异常退出机制wdfk-prog
2024-06-16[components] [drivers ] [Kconfig] 整理 components/drivers 的 Kconfig (#9054)sp-cai
整理 components/drivers 的 Kconfig
2024-05-21[component][driver]init dm serial naming framework in a separate phase (#8971)zms123456
init dm serial naming framework in a phase
2024-05-17[smart] select console device dynamically (#8949)Shell
* [smart] select console device dynamically - Fixed compiler warning on terminal subsystem for `components/lwp/terminal/terminal.h` - Updated default console setup to dynamically select an appropriate tty device based on the configured console device name. Signed-off-by: Shell <[email protected]> * fixup: remove useless codes --------- Signed-off-by: Shell <[email protected]>
2024-05-16[drivers][serial]fix error in getting serial_tty settings (#8953)zms123456
fix error in getting serial_tty settings
2024-05-09fix_serial_baudrate_setgeniusgogo
2024-05-07fix_serial_baudrate_setgeniusgogo
Signed-off-by: geniusgogo <[email protected]>
2024-04-29fix baudrate error (#8873)xiao-mang
* fix baudrate error * fix baudrate error * fix baudrate error * fix baudrate error * fix baudrate error * fix baudrate error * fix baudrate error * fix baudrate error * fix baudrate error
2024-04-25[smart] fix tty serial ioctl (#8861)Shell
Using param callback to reduce unnecessary call. Signed-off-by: Shell <[email protected]>
2024-04-20[smart] fixup rt_hw_serial_unregister_tty of serial ttyShell
Mutex lock should be taken before release the TTY device. Signed-off-by: Shell <[email protected]>
2024-04-15[component][driver][serial/tty]using serial name to name ttyzms123456
当使用新device model时,serial的名字由系统分配,id也由系统分配,此时应根据系统分配的serial id来作为serial-tty的id
2024-04-15[components][drivers]fix workqueue bugzms123456
fix workqueue bug
2024-04-09[drivers/serial] Introduce hooker for TTY (#8733)Shell
In this patch, a hook list has been introduced to address the concerns regarding coupling issues arising from modifications to the serial code for integrating TTY logic. Signed-off-by: Shell <[email protected]>
2024-04-02fix: code format of serial.c and compile error in aarch64 context_gcczhao maosheng