Commit Graph

153 Commits

Author SHA1 Message Date
ryancw d23006ea4f [drivers][serial_v2] 修复dma下rx_flush的bug 2025-07-24 09:37:54 +08:00
ryancw 5c23485006 [components][serial_v2] 写满丢弃策略对dma_ping_buf的处理有误、细节调整 2025-05-22 21:32:21 +08:00
ryancw ac8fba0129 [drivers][serial_v2]允许阻塞接收超过rx缓冲区大小的数据、增加超时时间、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-05-16 09:42:11 +08:00
zhujiale 9c164882e8 fix when open samrt but using msh after run elf file the msh will down 2025-01-20 15:09:02 +08:00
zhujiale e4760364f1 [serial] add bypass testcase in utest 2024-12-17 11:08:14 +08:00
zhujiale 27cf024585 [serial] add bypass hook to direct processing char when uart irq coming 2024-12-17 11:08:14 +08:00
PermissionDenied7335 92f26b7ad2 [drivers] fixed a minor typo in the comments of dev_serial_v2.c 2024-11-24 12:48:19 -05:00
CXSforHPU bb91502465
[drivers] Specifies the name of the drivers driver file
https://github.com/RT-Thread/rt-thread/pull/9420
2024-09-13 17:40:40 -04:00
Shell 3f6960b7f5
[smart/tty] skip configure of rt_serial on tty open (#9152)
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 <smokewood@qq.com>
2024-07-09 13:28:24 +08:00
LaterComer 4d0b048c97
[fixed]serial_v2.c兼容DFS_V2接口 (#9153) 2024-07-09 12:10:08 +08:00
wdfk-prog 28c7522e26 [drivers][serial V1]poll tx 增加异常退出机制 2024-06-27 00:11:18 +08:00
sp-cai f1832fea24
[components] [drivers ] [Kconfig] 整理 components/drivers 的 Kconfig (#9054)
整理 components/drivers 的 Kconfig
2024-06-16 15:43:27 +08:00
zms123456 adf2b35ec6
[component][driver]init dm serial naming framework in a separate phase (#8971)
init dm serial naming framework in a phase
2024-05-21 22:36:20 +08:00
Shell f2d6325b43
[smart] select console device dynamically (#8949)
* [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 <smokewood@qq.com>

* fixup: remove useless codes

---------

Signed-off-by: Shell <smokewood@qq.com>
2024-05-17 13:19:00 +08:00
zms123456 ed002bb84a
[drivers][serial]fix error in getting serial_tty settings (#8953)
fix error in getting serial_tty settings
2024-05-16 15:36:16 +08:00
geniusgogo 79b3d5ec1e fix_serial_baudrate_set 2024-05-09 00:35:46 -04:00
geniusgogo 02e0334ac3 fix_serial_baudrate_set
Signed-off-by: geniusgogo <xpxyr@sina.com>
2024-05-07 19:03:14 -04:00
xiao-mang b586889216
fix baudrate error (#8873)
* 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-29 18:00:34 +08:00
Shell 9e1a816f06
[smart] fix tty serial ioctl (#8861)
Using param callback to reduce unnecessary call.

Signed-off-by: Shell <smokewood@qq.com>
2024-04-25 18:21:32 +08:00
Shell 732d32be09 [smart] fixup rt_hw_serial_unregister_tty of serial tty
Mutex lock should be taken before release the TTY device.

Signed-off-by: Shell <smokewood@qq.com>
2024-04-20 11:35:45 -04:00
zms123456 a68b4df4d8
[component][driver][serial/tty]using serial name to name tty
当使用新device model时,serial的名字由系统分配,id也由系统分配,此时应根据系统分配的serial id来作为serial-tty的id
2024-04-15 23:20:30 -04:00
zms123456 6ad0b2bd09
[components][drivers]fix workqueue bug
fix workqueue bug
2024-04-15 23:15:37 -04:00
Shell 4b0f42c24a
[drivers/serial] Introduce hooker for TTY (#8733)
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 <smokewood@qq.com>
2024-04-09 21:36:16 +08:00
zhao maosheng 687eb87a2b fix: code format of serial.c and compile error in aarch64 context_gcc 2024-04-02 08:07:21 -04:00
zms123456 d856f77a55
[components][drivers] fix posix tty, and add more baudrate (#8683)
* serial-tty fix

* v2
2024-04-01 21:23:04 +08:00
Shell 83e95bdff4
sync smart & dfs (#8672)
Signed-off-by: xqyjlj <xqyjlj@126.com>
Signed-off-by: Shell <smokewood@qq.com>
Co-authored-by: xqyjlj <xqyjlj@126.com>
2024-03-28 23:42:56 +08:00
Liu Yang 59dbebe6fc [components/driver] Fix issue for serial_V2 in no buffer bloking tx mode. 2024-03-20 02:28:35 -04:00
fangjianzhou 00c6800e4e
[components/driver] update serial (#8567) 2024-03-01 10:29:21 +08:00
LaterComer 82bb104f65
fix(serial_v2): tx_fifo->rb.buffer_ptr not init when RT_DEVICE_FLAG_DMA_TX and RT_SERIAL_TX_BLOCKING
为什么提交这份PR (why to submit this PR)
serial_v2驱动框架,rt_serial_tx_enable()函数,在 DMA阻塞发送(RT_DEVICE_FLAG_DMA_TX and RT_SERIAL_TX_BLOCKING) 的时候,使用rt_malloc分配了tx_fifo内存,但是并未对tx_fifo->rb.buffer_ptr指针进行初始化(rt_malloc不会自动初始化内存),因此可能导致buffer_ptr是一个随机指针。但是rt_serail_write()函数需要根据tx_fifo->rb.buffer_ptr是否为RT_NULL来判断是调用_serial_fifo_tx_blocking_nbuf()还是_serial_fifo_tx_blocking_buf()。

由于tx_fifo->rb.buffer_ptr可能是一个随机值(不一定为RT_NULL=0),导致RT_DEVICE_FLAG_DMA_TX and RT_SERIAL_TX_BLOCKING模式下调用了_serial_fifo_tx_blocking_buf(),但是rb没有真正开辟内存空间,导致内存异常

你的解决方案是什么 (what is your solution)
rt_serial_tx_enable(),在DMA阻塞发送分支下,对tx_fifo->rb.buffer_ptr进行初始化,赋值为RT_NULL。
2024-02-21 00:29:53 -05:00
xqyjlj 3283f54c7a
🎈 perf: perf rt_hw_interrupt_disable/enable (#8042)
Signed-off-by: Shell <smokewood@qq.com>
Co-authored-by: Shell <smokewood@qq.com>
2023-10-25 20:31:25 +08:00
zan319 fce83488ec
[serial_v2] 修复阻塞模式下中断发送的逻辑顺序问题与多线程下的竞态条件 (#7997) 2023-09-28 14:04:10 +08:00
xiao-mang befa951451
modify some function prototypes of the dfs_file_ops structure and the function declarations based on it (#7849) 2023-07-24 09:12:35 +08:00
sp-cai 75f65b6af6
[components][drivers][serial] serial.c 修复串口有时重复发送 '\r' 的问题 (#7767) 2023-07-07 23:52:32 -04:00
Bernard Xiong 99e80f8d33
[dfs] Add DFS v2.0 (#7606) 2023-06-10 21:35:25 +08:00
7YZ7 a5211c70b6
[components][drivers][HUST CSE]修复serial_v2.c中可能产生的死循环 (#7394) 2023-05-15 14:42:11 +08:00
Meco Man 4a7ef40dc7 [serial-v2]fix the data type error 2023-04-19 07:49:46 -04:00
7YZ7 501b22aabe
[HUST CSE] Fix many abnormal symbols in annotations and format code 2023-04-17 22:26:23 -04:00
lessone1 2638a2a90c [components] Wrong order of judgment 2023-04-14 22:51:06 -04:00
Bernard Xiong 9600b75b55
[DFS] prepare for dfs_v2.0 (#7200)
* [DFS] prepare for dfs_v2. dfs_fd -> dfs_file; dfs_fnode -> dfs_vnode.

* [BSP] fix code analysis warning

* [smart] fix the pointer overflow.

* code format

* [smart] fix the lwp->lwp_obj checking.
2023-04-08 22:25:51 +08:00
Meco Man deb40e8c0c [errno code][-RT_EBUSY] fix that use RT_EBUSY without - 2023-03-22 01:55:18 -04:00
jonas 6d4764ad69 serial_v2 rt_device_write/read return data type as rt_ssize_t 2023-02-23 09:50:39 -05:00
Meco Man f58d3c5200 rt_device_write/read return data type as rt_ssize_t
rt_ssize_t can give negative error code, which follows the unix style correctly
2023-02-07 21:43:57 -05:00
Shell b2402029b2
[rt-smart][fix/lwp] don't restore terminal for background lwp (#6847)
* [fix/lwp] don't restore term for background lwp
2023-01-13 09:48:43 +08:00
wdfk-prog 8f0cef3a87
[drivers][serial_v2]修复DMA+TX阻塞模式异常 (#6781)
* [drivers][serial_v2]修复DMA+TX阻塞模式异常
2023-01-05 01:25:16 -05:00
bernard 1f092da9e0 fix compiling warning. 2022-12-26 14:24:26 +08:00
guozhanxin b5d77bbf37 [rtsmart] fix uart can't input after userapp exited at rv64 platform. 2022-12-09 07:54:29 -05:00
guo ecf2d82159
sync branch rt-smart. (#6641)
* Synchronize the code of the rt mart branch to the master branch.
  * TTY device
  * Add lwP code from rt-smart
  * Add vnode in DFS, but DFS will be re-write for rt-smart
  * There are three libcpu for rt-smart:
    * arm/cortex-a, arm/aarch64
    * riscv64

Co-authored-by: Rbb666 <zhangbingru@rt-thread.com>
Co-authored-by: zhkag <zhkag@foxmail.com>
2022-12-03 12:07:44 +08:00
朱天龙 (Armink) 748f6afd5e [DeviceDriver][serialv2] Support configure when serial is open. 2022-10-12 14:21:41 +08:00
a1012112796 ab8c1418a6 tshell is the default value of FINSH_THREAD_NAME 2022-10-10 17:48:21 -04:00
Tangyuxin a4829b1c00
[fix] Fix simulator compilation warnings (#6438)
* [fix] Fix simulator compilation warnings

* Update bsp/simulator/rtconfig_project.h

Co-authored-by: Man, Jianting (Meco) <920369182@qq.com>
2022-09-20 10:31:11 -04:00