Commit Graph

4971 Commits

Author SHA1 Message Date
RyanCW
e0243e87c0 [component][drivers][serial_v2] 优化serial_v2 (#10603)
* [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-16 11:51:57 +08:00
wdfk-prog
302370720e [driver][serial] V1]: fix correct data loss logic when RX ring buffer is full
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-10 12:10:16 +08:00
sakumisu
38499668bf update(cherryusb): update to v1.5.2
Signed-off-by: sakumisu <1203593632@qq.com>
2025-08-08 14:50:52 +08:00
cmbjxxiao
37d902537c [arm_compiler_v4/v5] define rt_packed as __packed #10553 2025-08-06 15:16:18 +08:00
liuyucai
236e830b65 [update] <components>:finsh/shell.c
添加以下功能(需要kconfig使能FINSH_USING_WORD_OPERATION)
1 ctrl+back 按单词删除
2 ctrl+左右箭头 按单词切换光标

Signed-off-by: Yucai Liu <1486344514@qq.com>
2025-08-06 11:26:55 +08:00
ligr
32e93ade4d [components/dfs]add doxygen comments for dfs sequence file in dfs_v2. 2025-08-04 09:55:01 +08:00
ligr
6015e149e7 [components/dfs]add doxygen comments for dfs_file.c in dfs_v2. 2025-08-04 09:49:45 +08:00
ligr
e143866eb8 [components/dfs]add doxygen comments for dfs_file_mmap.c in dfs_v2. 2025-08-04 09:48:12 +08:00
ligr
18c8c8b2f7 [components/dfs]add and optimize doxygen comments for dfs.c in dfs_v2. 2025-08-04 09:46:00 +08:00
Guorui Li
6a2dcd6a0b [components/dfs]add doxygen comments for dfs_fs.c in dfs_v2. #10538 2025-08-04 09:44:56 +08:00
ligr
8e18f354c5 [components/dfs]add doxygen comments for dfs pcache file in dfs_v2. 2025-08-03 10:53:26 +08:00
rcitach
ae50e406da 【SMART】【BSP】【allwinner】Fix smart serial_v2 bypass compile error 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-08-01 20:59:08 +08:00
Guorui Li
d82dd71aef [bugfix][component/dfs] fix bugs for function _get_parent_path(). (#10539)
* [bugfix][component/dfs]1.Skip the trailing slash character failed. 2. Scenario that parent path is root is not considered.

* replace strdup() by rt_strdup().

* free memory after strdup().

* fix issue of not appending '\0' at end when parent path is root.
2025-07-31 17:36:28 +08:00
Guorui Li
9f66b35874 [components/dfs]add doxygen comments for dfs_dentry.c in dfs_v2. (#10561) 2025-07-30 21:05:34 +08:00
Guorui Li
1662125a37 [components/dfs]add doxygen comments for dfs_vnode.c in dfs_v2. (#10563) 2025-07-30 21:03:42 +08:00
ligr
dc89417229 [components/dfs]add doxygen comments for dfs_mnt.c in dfs_v2. 2025-07-30 09:43:52 +08:00
liuyucai
a1c642aa3a [Fix] <components>:drivers/can/dev_can.c 修复CAN底层无法工作时导致调用 _can_int_tx 的线程一直挂起的问题
Solution: 使用 can->status.sndchange 的bit位来表示某个发送邮箱超时
如果超时 底层驱动再通知tx_done或者tx_fail事件时不予处理

Signed-off-by: Yucai Liu <1486344514@qq.com>
2025-07-29 20:18:14 +08:00
ChenRuiwei
f9564d4ee0 [pthreads] Fix pthread_cond_timedwait lacks timeout wakeup 2025-07-25 15:35:39 +08:00
ryancw
d23006ea4f [drivers][serial_v2] 修复dma下rx_flush的bug 2025-07-24 09:37:54 +08:00
Codeman-1999
7c0fed5d68 [components/libc] add comments for some pthread functions. #10423 2025-07-24 09:36:31 +08:00
Yulong Wang
ee1fe2024e [lwp][rv64] riscv: fix potential signal handler infinite loop 2025-07-23 09:39:17 +08:00
Yulong Wang
e7a40ae6ec [lwp][rv64] restore tp register in arch_thread_signal_enter to fix user-mode memory access 2025-07-23 09:38:35 +08:00
Chen Wang
895b272b69 doxygen: fix duplicated defgroup for clock
Problen:
Duplicated definition of group_clk in clk.c and clk.h.

Solution:
Delete the definition in clk.c and keep only the definition
in clk.h.

Also change the name of group_clk to group_driver_clock to
conform to the naming convention of other driver groups.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-07-22 16:00:33 +08:00
Chen Wang
2aebe694d9 doxygen: group name all in lowcase (part 2) (#10530)
* doxygen: fs: unify groupname to lowercase

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>

* doxygen: drivers: unify groupname to lowercase

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>

* doxygen: signal: unify groupname to lowercase

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>

---------

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-07-22 13:59:25 +08:00
ricky
9c5aeb75e2 [Fix] <components>:finsh/shell.c F: char rt_hw_console_getchar(void) (#10345)
[Fix] <components>:finsh/shell.c
When using char rt_hw_console_getchar(void),
some compilers may default to returning 255 instead of the expected -1,
causing the condition if(ch < 0) at F: shell.c L:519 to fail and enter an erroneous loop.

Solution: Use the signed char type return value as rt_hw_console_getchar

Signed-off-by: Yucai Liu <1486344514@qq.com>
2025-07-20 17:35:35 +08:00
jianbaoshan
542d65bc8a fix #4286,fifx memory leak when sal_socket failed 2025-07-17 13:24:30 +08:00
sakumisu
5e03e07c43 update(cherryusb): update to v1.5.1
Signed-off-by: sakumisu <1203593632@qq.com>
2025-07-15 16:35:20 +08:00
蒙蒙plus
926cbb31f6 修复DFS_USING_POSIX启用时 修正IARVersion导入路径 2025-07-14 13:09:08 +08:00
wdfk-prog
95b1d69e8c [serial_v2]modify the default configuration of the RT_SERIAL_CONFIG_DEFAULT structure to support parameters in the absence of DMA configuration. 2025-07-12 07:23:25 +08:00
GuEe-GUI
01e4caf60c [DM/PIC] Fixup the interrput info list format
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-07-12 07:16:25 +08:00
GuEe-GUI
30ab08c7c9 [DM/PIC] Config IPI by RT_MAX_IPI
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-07-12 07:16:25 +08:00
GuEe-GUI
5297c13ab0 [DM/PIC] Import DM Kconfig
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-07-12 07:16:25 +08:00
GuEe-GUI
bb9c7151bb [WDT] Intel 6300ESB Timer/Watchdog
Used for QEMU on PCI

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-07-10 17:33:40 +08:00
GuEe-GUI
2532450a83 [WDT] Add Synopsys DesignWare watchdog
This device is commonly used in SoCs.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-07-10 17:33:40 +08:00
GuEe-GUI
37818aa518 [WDT] Update for DM build
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-07-10 17:33:40 +08:00
GUI
8a7ef41c3c [SPI]Update and fixup the SPI
* Make a priv data read API for probed SPI device
* Fixup the SPI device pre-alloc
2025-07-10 13:28:16 +08:00
Kinte
29033ab500 [refact](netdev): Expose netdev_set_dns and netdev_set_if
[Descriptions]:
    1. Make these functions public to avoid code duplication and allow direct usage by other components.
    2. Fix ifdef's error note.
[Root Cause]:NA
[Side Effects]:NA
2025-07-10 08:26:43 +08:00
sakumisu
61a5710664 update(cherryusb): update framework and bugfix
* update cdc_acm device framework
* add host serial device framework
* fix dfs read write return type
* fix webusb desc len
* fix dwc2 h7rs gccfg

Signed-off-by: sakumisu <1203593632@qq.com>
2025-07-08 09:32:30 +08:00
bernard
e00143904f [smart] Optimize error handling after command execution 2025-07-07 09:44:37 +08:00
bernard
172676e115 [smart] rename the Group name to 'lwProcess' and optimize the error handling for vDSO building. 2025-07-07 09:44:37 +08:00
bernard
cb1a58cf37 [vdso] fix the arch/abi flag issue. 2025-06-30 09:52:09 +08:00
BernardXiong
a5359b7223 [vdso] use the default arch/abi flags in risc-v vDSO building. 2025-06-30 09:52:09 +08:00
Chen Wang
8e9872a554 doxygen: group name all in lowcase
This patch only updated the groups defined in documentation/0.doxygen.

Other groups will be moved into documentation/0.doxygen and updated at
that time.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-06-25 14:02:28 +08:00
sakumisu
2ac969b4ca update(cherryusb): update to v1.5.0 (#10409) 2025-06-20 16:19:38 +08:00
Chen Wang
01ca3911ec componnets: utest: fix case-name matching problem
There is a problem with the matching of case names
in the original code. Due to original code use memcmp
with len, if the input case name and the existing
case name have an inclusion relationship, for example,
if the actual case name is "gpip_irq", and run
`utest_run gpio` will also match successfully, but it's
not expected.

Modify the logic of exact matching and use strcmp instead.
Keep the original wildcard logic, that is,
`utest_run gpio*` can match both "gpio_irq" and "gpio".

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-06-10 19:22:25 +08:00
Chen Wang
60c6fc0e3a components: drivers: adc: fixed cppcheck error
[cpp_check.py 80 INFO] components/drivers/misc/adc.c:76:12:
error: Uninitialized variable: result [legacyUninitvar]
    return result;
           ^

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-06-10 14:21:46 +08:00
Chen Wang
ae86c6e8bb componnets: drivers: adc: remove build warnings
gcc build warnings:
cast from pointer to integer of different size [-Wpointer-to-int-cast]

For rt_adc_ops.enabled, the type of second param is rt_int8_t,
original _adc_control also called with wrong type casting.

Convert first to rt_base_t, then cast to rt_int8_t to remove the
build warnings.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-06-10 14:21:46 +08:00
Runcheng Lu
72c45043b5 components: drivers: rtc: add the alarm using local time for calculation
- add the alarm using local time for calculation

Signed-off-by: Runcheng Lu <runcheng.lu@hpmicro.com>
2025-06-09 13:31:16 +08:00
Chen Wang
a3339ca734 doxygen: change group_Drivers to group_device_driver
The originally defined "group_Drivers" should actually
be part of the device-driver component, so
"group_Drivers" is renamed to "group_device_driver".

In this way, the original "group_Device" and
"group_Drivers" are merged into "group_device_driver".

Adjusted the writing method of doxygen comments in the
driver code to be unified as follows:

```c
* @defgroup group_XXX XXX
* @brief xxxxxx
* @ingroup group_device_driver
```

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-05-29 13:47:46 +08:00
GuEe-GUI
99fc1bb72b [DM/PCI] Add /proc access in RT-Smart user.
1. Add ROM base info.
2. Save th PM status.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-05-23 13:22:25 +08:00