Commit Graph

34 Commits

Author SHA1 Message Date
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
Liu Yang 59dbebe6fc [components/driver] Fix issue for serial_V2 in no buffer bloking tx mode. 2024-03-20 02:28:35 -04: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
zan319 fce83488ec
[serial_v2] 修复阻塞模式下中断发送的逻辑顺序问题与多线程下的竞态条件 (#7997) 2023-09-28 14:04:10 +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
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
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
tfx2001 218cdbce4e add assert for serial v2 2022-08-13 17:04:08 -04:00
HubretXie 223bc17df9
[serial_v2] fixed bug (#6213)
* [kernel][timer] fixed bug serial_v2 驱动问题,导致所有写入都使用阻塞方式写入
2022-08-03 22:42:20 -04:00
Tangyuxin 7f1157e0de
[drivers][serial] ioctl add F_SETFL cmd (#5876) 2022-04-26 13:13:51 +08:00
朱天龙 (Armink) 039efbb075
完善 Serial V2 框架 (#5770)
* [stm32] fix h7 uart V2 driver unused code.

* [DeviceDriver][serialv2] fix the serialv2 when using for console device on DMA mode.

* [stm32][art-pi] using serial v2 by default

* [DeviceDriver][SerialV2] Add termios for serial@V2 .

* [BSP][STM32] Add hardware flow control for STM32 serial@V2 driver.

* [DeviceDriver][Serial@V2] Add hardware flow control for serial V2.
2022-04-04 17:25:04 +08:00
朱天龙 (Armink) bae1be0f45
完善串口 V2 框架 (#5720)
* [stm32] fix h7 uart V2 driver unused code.
* [DeviceDriver][serialv2] fix the serialv2 when using for console device on DMA mode.
* [stm32][art-pi] using serial v2 by default
2022-03-27 00:52:41 +08:00
打盹的消防车 0c82e033dc
Open RT_USING_POSIX_STDIO caused serial_v2 to compile failed (#5684)
* fix:Open RT_USING_POSIX_STDIO caused serial_v2 to compile failed
2022-03-20 10:29:16 +08:00
Meco Man 8213bbd92e update 2022-01-14 23:09:32 +08:00
liukangcc 3d2e23ec1c [update] move dfs_posix.h to legacy/dfs/dfs_posix.h 2022-01-14 23:09:32 +08:00
Meco Man 918ee6147c add RT_USING_POSIX_STDIO 2022-01-05 23:11:58 +08:00
guo fb7b9f4fb4
Merge pull request #5318 from enkiller/1201
[components][src] Optimize interrupt disable time
2021-12-21 17:40:59 +08:00
tangyuxin a77cc81876 [components][drivers] format file 2021-12-01 14:41:13 +08:00
Meco Man 7c789d4b11 revise some RT_USING_POSIX to RT_USING_POSIX_DEVIO 2021-11-24 09:47:55 -05:00
Meco Man c360688714 使用poll.h代替dfs_poll.h 2021-09-11 11:56:54 -04:00
chenjh 22139e66ca [serial_v2] Serial_v2 support device ops feature 2021-07-09 11:27:46 +08:00
chenjh 0613cf8ca2 [serial] 解决serial_close未清除回调接口的问题 2021-06-18 14:54:37 +08:00
chenjh 5ac5d92cbb [serial] 优化发送非阻塞时,serial_close未执行rt_completion_done的问题。 2021-06-16 16:55:33 +08:00
chenjh fac3c5cda1 [serial] 优化dma接收处理流程,解耦驱动调用串口框架的API接口 2021-06-08 09:38:43 +08:00
chenjh d94be14df5 [serial] 增加serial_v2版本的框架和基于stm32的串口驱动 2021-06-08 09:38:43 +08:00