Commit Graph

4896 Commits

Author SHA1 Message Date
GUI
39f5df440e [DM/Platform] Fixup the node will probe more than once
If a node request a new node or it's parent node. the  request's node will probe a double time.
So we check the device object of node in ofw probe entry and ofw probe child exit.
2025-03-19 11:43:00 +08:00
latercomer
47cd7b2e5b 解决bps/simulator无法在vs2019环境下编译
Signed-off-by: latercomer <latercomer@qq.com>
2025-03-17 16:46:35 +08:00
GUI
eeba8eaf8b [DM/DMA] DMA src and dst is wrong.
The first arg is src, then dst.
2025-03-17 16:44:33 +08:00
1078249029
76b1f6b80e [components][at] Add formatting message function for at client
It will be useful for quiting transmission mode of some chips like esp8266.

Signed-off-by: 1078249029 <1078249029@qq.com>
2025-03-17 16:42:35 +08:00
yixinghua121
8fa0c8ed9a 修复 MMCSD 宏拼写错误+内核开启LOG_D编译问题 2025-03-17 16:41:34 +08:00
lingfengPeng
a978ab49fd fix dangling pointer in component pthread and dfs_elm (#9976)
* [components/libc/posix][pthreads]fix the risk of dangling pointer

* [components][dfs][dfs_elm]:fix risk of dangling pointer, unmount the temp driver then free the temp FATFS in dfs_elm_mkfs.
2025-03-17 16:39:43 +08:00
heyuanjie87
93e20aa83e [mm]修复unmap内存时遗漏刷新地址转换表的问题,避免dcache(PIPT)出错 2025-03-10 22:50:01 +08:00
sakumisu
bc017751a6 fix(cherryusb): fix USBD_IRQHandler argument
Signed-off-by: sakumisu <1203593632@qq.com>
2025-03-10 22:50:00 +08:00
sakumisu
2756150da0 update(cherryusb): update to v1.4.3
Signed-off-by: sakumisu <1203593632@qq.com>
2025-03-10 22:50:00 +08:00
Yuqiang Wang
f9befaab97 feat: ci script associated with auto_utest. (#9933)
* feat: ci script associated with auto_utest.
2025-03-10 22:49:34 +08:00
GUI
3ae152866e [DM/THERMAL] fixup coefficients's offset lost
coefficients is double u32 data list.
2025-03-10 22:48:28 +08:00
Runcheng Lu
acd4a187e3 [components][drivers][spi]: fix: set message.parent.next to NULL for rt_qspi_send_then_recv API and rt_qspi_send API
- Ensure correct QSPI message chaining by setting next pointer to NULL, preventing unintended data transmission issues.

Signed-off-by: Runcheng Lu <runcheng.lu@hpmicro.com>
2025-03-10 22:48:28 +08:00
Runcheng Lu
5e41729ebf [components][drivers][spi] dev_spi_flash_sfud: fix: set message.parent.next to NULL for qspi_read API
- Ensure correct QSPI message chaining by setting next pointer to NULL, preventing unintended data transmission issues

Signed-off-by: Runcheng Lu <runcheng.lu@hpmicro.com>
2025-03-10 22:48:27 +08:00
GUI
acf2992adb [DM/OFW] check available in stub probe
device node should not probe in stub if device is not available.
2025-03-10 22:48:27 +08:00
wycwyhwyq
c6c47fadf8 [components][dfs_v2]: Fix cromfs bug (#10054) 2025-03-10 22:47:50 +08:00
CYFS
71fe8840bf fix:pwm msh err 2025-03-10 22:47:04 +08:00
GUI
4f4012aeba Fixup device rename by chip_select
`chip_select` is array now, should use index of value.
2025-03-10 22:47:03 +08:00
hydevcode
d31826c5e0 [bsp][nxp] add cherryusb config for mcxa156 (#10041)
[bsp][nxp] add cherryusb config for mcxa156 and add ci.attachconfig
2025-03-10 22:47:01 +08:00
Shell
595f9c691d feat: improve Kconfig structure on MM
Signed-off-by: Shell <smokewood@qq.com>
2025-03-10 22:45:28 +08:00
Shell
fafa745698 feat: mm: page poison debugging and assertion enhancements
This commit introduces a page poison debugging mechanism and additional
assertions for memory management, improving system maintainability and
debugging capabilities. The changes aim to detect illegal memory usage
early and provide better clarity in managing page allocations.

Changes:
- Added `RT_DEBUGGING_PAGE_POISON` option to enable memory usage tracing.
- Introduced a page poisoner for detecting illegal memory usage.
- Implemented region-based memory tracking using bitmaps.
- Enhanced spinlock protection for memory management operations.
- Fixed several assertion checks for memory safety.
- Renamed macros for consistency (`FLOOR` to `CEIL`).
- Refined memory allocation and deallocation logic to include poisoning.
- Updated Kconfig to add configurable `RT_PAGE_MAX_ORDER` and poison debugging.
- Improved debugging outputs for page regions and memory operations.

Signed-off-by: Shell <smokewood@qq.com>
2025-03-10 22:45:28 +08:00
Shell
d54a457b04 feat: mm: install page in a discrete method
This patch refactors the `rt_page_install` function by delegating specific
operations to new helper functions. Besides, the contiguous page regions
are now separated to segments of fixed size. The goal is to improve the
overall code readability, enhance modularity, and ensure better handling
of page installation logic through clearer separation of concerns.

Changes:
- Introduced `_get_mpr_ready_n_install` to encapsulate memory preparation
  and page installation logic.
- Added `_update_region_list` for updating the installed page registry.
- Defined `_PAGE_STRIPE` for optimized region processing.
- Modified `rt_page_install` to handle regions in smaller chunks using
  helper functions for better maintainability.
- Improved locking mechanisms with `rt_spin_lock` for thread safety.
- Reduced code duplication and clarified shadow region calculations.

Signed-off-by: Shell <smokewood@qq.com>
2025-03-10 22:45:27 +08:00
Shell
c188ef2b4d feat: mm: added affinity pages allocator
This patch introduces a tagged pages allocator to address the existing problems
of page aliasing on specific platforms and the requirement of page coloring.
It implements an affinity-id aware page manager by separating the runtime page
list into two types: a normal single linked-list and a multi-dimensional affinity-list.

Changes:
- Introduced tagged pages allocator and managing algorithm for affinity pages list
- Modified components to support affinity-id list management
- Updated page allocation and freeing functions to handle tagged pages
- Added configuration options for page affinity block size and debugging
- Modified mmap and elf loading to respect affinity settings
- Enhanced page list management to support multi-dimensional affinity-list

Signed-off-by: Shell <smokewood@qq.com>
2025-03-10 22:45:27 +08:00
heyuanjie87
aa928032b9 [lwp/riscv]修正用户态参数空间占用堆地址空间的问题 (#10014)
* [lwp/riscv]修正用户态参数空间占用堆空间的问题
2025-03-10 22:45:26 +08:00
kenneth.liu
e0e489a905 components: libc: fix pointer-to-integer cast warnings and address truncation
[Problem Description]
1. When enabling RT_USING_MODULE=y, compilation warnings occur:
   dlelf.c:386:27: warning: cast from pointer to integer of different size
   dlelf.c:398:25: warning: cast from pointer to integer of different size
   dlelf.c:408:24: warning: cast from pointer to integer of different size

2. On RV64 architectures (e.g. Sophgo SG2042 with RISC-V Sv39 and 40-bit physical addressing),
   dlsym may fail when accessing addresses beyond 32-bit range.

[Root Cause]
In dlmodule_load_relocated_object() and dlmodule_symbol_find(),
pointer is cast to rt_uint32_t which truncates:
| rt_ubase_t rodata_addr = (rt_uint32_t)ptr;
This causes:
- Warnings on 64-bit systems (pointer width > 32-bit)
- Actual address truncation on RV64 when physical address exceeds 32-bit

[Solution]
Replace rt_uint32_t with architecture-adaptive rt_ubase_t:
| rt_ubase_t rodata_addr = (rt_ubase_t)ptr;
The rt_ubase_t is defined in include/rttypes.h as:
| #ifdef ARCH_CPU_64BIT
|   typedef rt_uint64_t rt_ubase_t;
| #else
|   typedef rt_uint32_t rt_ubase_t;
| #endif
This ensures correct width casting for both 32/64-bit architectures.

Signed-off-by: Liu Gui <kenneth.liu@sophgo.com>
2025-03-10 22:44:18 +08:00
kenneth.liu
6a1e17498a components: libc: fix array overflow in rt_object name assignment
[Problem Description]
When assigning name to rt_object, strncpy() uses size equal to RT_NAME_MAX,
which causes missing null-terminator and overflows into adjacent 'type' field.
This corruption leads to unexpected system behavior.

[Problem Analysis]
The rt_object structure defines:
| char name[RT_NAME_MAX] | -> buffer
| rt_uint8_t type        | -> adjacent field

Original code calculates size as:
size = end - first + 1;
if (size > RT_NAME_MAX) size = RT_NAME_MAX;

When size equals RT_NAME_MAX, strncpy() will copy exactly RT_NAME_MAX bytes
without adding terminating '\0', causing two issues:
1. name buffer is not null-terminated
2. The implicit null-byte writes beyond name[] into type field

[Solution]
Change boundary check from:
if (size > RT_NAME_MAX) size = RT_NAME_MAX;
to:
if (size >= RT_NAME_MAX) size = RT_NAME_MAX - 1;

This ensures:
1. Always leaves space for null-terminator
2. Prevents overflow into type field
3. Maintains maximum valid name length (RT_NAME_MAX-1 + '\0')

Signed-off-by: Liu Gui <kenneth.liu@sophgo.com>
2025-03-10 22:43:06 +08:00
Guorui Li
2b26a1b12a [lwp]add comments for lwp system calls. (#9934) 2025-03-10 22:39:31 +08:00
heyuanjie87
0dc3794990 [lwp]检查killpg的signo参数的有效性 (#9981)
* [lwp]对检查killpg的signo参数的有效性
2025-03-10 22:39:09 +08:00
Rbb666
7d289923e9 [ulog]Fix the problem of file_buf being released incorrectly 2025-03-10 22:38:42 +08:00
Supper Thomas
5b3320624d [src/ktime] fix the bug when use keil AC6 and open RT_USING_HOOKLIST … (#9993)
* [src/ktime] fix the bug when use keil AC6 and open RT_USING_HOOKLIST and RT_USING_KTIME
2025-02-16 22:02:42 +08:00
Chen Wang
c40b79037c doxygen: add prefix for groups (#9991)
* doxygen: add prefix for groups

Add "group_" prefix to doxygen group names. This makes
it easier to grep with group name later.

This patch only modifies the groups defined in the pathes
of INPUT of documentation/Doxyfile:

INPUT = . \
        ../src \
        ../include \
        ../components/finsh \
        ../components/drivers/include/drivers \
        ../components/drivers/clk \
        ../components/dfs/dfs_v2/src \
        ../components/dfs/dfs_v2/include

Other groups are not touched.

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

* ci: fixed error report when run file_check.py

Such as:
- "please delete extra space at the end of this line."
- "the RT-Thread error code should return negative value. e.g. return
  -RT_ERROR"

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

---------

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-02-15 12:15:19 +08:00
GuEe-GUI
74f43edd6c [DM/THERMAL] Remove unused code in update poll
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GuEe-GUI
aaf18e497c [DM/LED] Rename LED register/unregister
rt_hw_* is use for DM and not DM, but LED only use in DM.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GuEe-GUI
f506076281 [DM] Replace spinlock static init by RT_DEFINE_SPINLOCK
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GuEe-GUI
f20e8973be [DFS/ISO9660] Remove warning for ops
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GuEe-GUI
5a455cb615 [DM/PIN] Reset the value of PIN_NONE
PIN_NONE is '-1', is similar to '-RT_ERROR',
'-RT_EEMPTY' is better.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GuEe-GUI
578cfc0b2a [DM/CORE] Add IDA init in runtime
Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:58:18 +08:00
GUI
1564735b5c [DM/SPI] Make CS pin config fixed in system (#9977)
Make a max CS pin value (16) for SPI, that will not
alloc `*cs_pins` by malloc, because drivers call
`rt_device_unregister` may not free item.

Fixup the QSPI init configure member in DM mode.

Make SoC Kconfig import easy.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-11 14:54:59 +08:00
Rbb666
f820c1948a [drivers/spi]修复spi configure会执行两次的问题 (#9972)
* [drivers/spi]修复spi configure会执行两次的问题
2025-02-11 13:04:31 +08:00
GuEe-GUI
12fded19f5 [DM/FDT] Fixup earlycon loss old messages.
The `rt_fdt_scan_chosen_stdout` will init fdt_earlycon data
without `msg` only, the `msg_idx` should not clean, too.
Because we check if have old messages by `msg_idx`

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2025-02-10 15:55:54 +08:00
heyuanjie87
d3d33ff983 [dfs]mmap的文件在关闭后释放file指针 (#9917)
* [dfs]mmap的文件在关闭后释放file指针
2025-02-09 15:55:30 +08:00
Rbb666
d83d71cc05 [drivers/spi]统一软件SPI配置 2025-02-09 15:48:49 +08:00
heyuanjie87
6e3c9acd39 [lwp]修正kill(pid < -1)时的返回值错误 2025-02-08 14:32:20 +08:00
Supper Thomas
0cc4dc4a3d [action] add ci menuconfig check (#9961) 2025-02-01 12:39:22 +08:00
wumingzi
6481633ec6 [doxygen] add doxygen comment for clk.c and clk.h (#9950)
Accroding to #9947 and #9424, adding doxygen comment for function in .c files and data structure, macro in .h file is a solution.For this pr, I encountered problem following situations.
    - rt_clk_unprepare function return value type is different from rt_clk_ops so I change type of rt_clk_unprepare and its dependencies.
    - clk_get function may be similar as rt_clk_unprepare but I'm not sure so not modify.
    - clk_release implements may be incomplete, so I just marked in comment.

Signed-off-by: 1078249029 <1078249029@qq.com>
2025-01-27 15:54:13 +08:00
CYFS
599cefe834 [components][drivers]:fix spi bug and add software spi (#9944)
* fix:spi bus issue

* [components][drivers]add software SPI bus support
2025-01-27 08:35:11 +08:00
hydevcode
2a18d6873b [bsp][nrf5x]added the cherryusb adapter for nrf52840 (#9939) 2025-01-24 23:12:25 +08:00
wumingzi
4d4c9660ce [doxygen] add doxygen comment for blk.h (#9947)
Signed-off-by: 1078249029 <1078249029@qq.com>
2025-01-24 14:14:43 +08:00
heyuanjie87
ed3222c2f8 [lwp]修正无法通过文件名查找pid的问题 (#9935) 2025-01-21 13:01:58 +08:00
Evlers
45bb1ddac9 [components][netdev] add statistics and more inupt parameters to ping command 2025-01-20 16:55:40 +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