4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-03-01 17:05:29 +08:00

16923 Commits

Author SHA1 Message Date
Kai
78f95ab80a
[bsp][wch] move ch32v20x sdk to package (#10023)
* [bsp][wch]to clear the serial of ch32v20x

* [bsp][wch] move ch32v20x sdk to pkg

* [ci] add ch32v208 bsp

* [bsp][wch] update readme
2025-02-25 19:41:21 +08:00
Chen Wang
75722c4998 doxygen: reorganize directory structure
The original directory structure was too flat and
inconvenient to view.

The directory is now reorganized according to the
first-level chapters, and some sub-chapters are
moved to the second-level directory.

Note: documentation/env is not moved to
documentation/4.tool because there are too many
external places that reference this path,
especially in bsp, so this directory path remains
as it is.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-02-25 11:27:58 +08:00
Shell
d9b36c8d18 feat: improve Kconfig structure on MM
Signed-off-by: Shell <smokewood@qq.com>
2025-02-25 11:26:30 +08:00
Shell
60f7b3affc 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-02-25 11:26:30 +08:00
Shell
269d28ac3b 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-02-25 11:26:30 +08:00
Shell
9386411d13 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-02-25 11:26:30 +08:00
JOONH0o
3fdb940967
fix - 1 优化中断中打印日志问题;2 优化SPI写外部FLASH慢的问题 (#10009)
* 1. 优化中断中打印日志问题;2 优化SPI写外部FLASH慢的问题
* 2. 在spi驱动中有在中断中打印调试信息的问题,增加ISR log判断进行
* 3. spi+DMA 写外部flash,由于spi速度很快,不进行delay就可以;同时,仿照Linux的驱动框架进行优化,数据小不使用DMA
2025-02-24 09:25:15 +08:00
heyuanjie87
5206b3ae2d
[lwp/riscv]修正用户态参数空间占用堆地址空间的问题 (#10014)
* [lwp/riscv]修正用户态参数空间占用堆空间的问题
2025-02-24 09:17:22 +08:00
oxlm
a7ba86ef38 模板工程从mcxa153更新成mcxa156,且默认调试器改为cmsisdap,因为板载调试器为cmsisdap 2025-02-24 08:04:41 +08:00
CYFS
0e9b7d9553
[bsp][nxp]:fix frdm-mcxa156 scons --dist err (#10024)
fix:frdm-mcxa156 scons --dist err
2025-02-23 14:52:12 +08:00
kaidegit
62cfa8c610 fix missing some flags added in Sconscript 2025-02-22 14:19:15 -05:00
kenneth.liu
2be83d5cad libcpu: riscv: fixed ARCH_RISCV_VECTOR issue
description: Using the vector instruction set to trigger
an illegal instruction exception when ARCH_SISCV_VECTOR=y.

analysis: When initializing the thread stack,
the rt_cw_stack_init function did not enable VS for SSTATUS.

Solution: When ARCH_SISCV_VECTOR=y,
increment the initial value of sstatus by 0x600(SSTATUS_VS).

Signed-off-by: Liu Gui <kenneth.liu@sophgo.com>
2025-02-22 14:17:54 -05:00
kurisaw
b3225ec81a fix: clear error compilation of signal in qemu-a9 smp mode 2025-02-22 14:17:35 -05:00
kenneth.liu
4940bb1051 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-02-22 14:16:00 -05:00
Chen Wang
aa3328f35d doxygen: Improve the text description of the introduction section
Adjust the paragraph format and correct some inaccurate statements.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-02-21 21:58:19 -05:00
Chen Wang
9dd309df26 doxygen: support running from the root directory
Previously, you had to enter the documentation directory
before executing the run.sh script, which was not very
convenient during development, especially when you needed
to execute other commands in the source code root directory
at the same time, such as git commands.

Now you can directly run script in the source code root
directory as below:

```shell
$ cd $RTT
$ ./documentation/run.sh
```

No need to switch the working path any more after entering
the source code root directory.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-02-21 21:58:01 -05:00
Yilin Sun
4e5f95e4f9 bsp: nxp/mcx/mcxa/frdm-mcxa156: Enable SPI driver support.
This patch:
* Enables SPI support
* Adds RW001 driver example
* Increases heap size to 32kB.

Signed-off-by: Yilin Sun <imi415@imi.moe>
2025-02-21 20:16:08 +08:00
Fan Yang
59feb97ced
[bsp][hpmicro] fix 'scons -dist' issue in the hpmicro bsps. (#10013)
- added tools and dist_handle function

Signed-off-by: Fan YANG <fan.yang@hpmicro.com>
2025-02-21 16:45:38 +08:00
kenneth.liu
a5b26bb588 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-02-20 22:38:06 -05:00
Yilin Sun
2e332d3463 bsp: nxp/mcx/mcxa/frdm-mcxa153: Kconfig: Remove ARCH_ARM_CORTEX_SECURE
MCXA153 does not support CMSE (Secure Extension). Remove it from Kconfig.

Minor: Fixed a typo in Kconfig which makes Kconfig fail on
case-sensitive operating system.

Minor: Fixed a Kconfig defined incorrect SOC name
(SOC_MCXN947 -> SOC_MCXA156)

Signed-off-by: Yilin Sun <imi415@imi.moe>
2025-02-20 20:39:34 +08:00
Yilin Sun
27f3c4bab1 bsp: nxp/mcx/mcxa/frdm-mcxa156: Kconfig: Remove ARCH_ARM_CORTEX_SECURE
MCXA156 does not support CMSE (Secure Extension). Remove it from Kconfig.
Minor: Fixed a typo in Kconfig which makes Kconfig fail on
case-sensitive operating system.

Signed-off-by: Yilin Sun <imi415@imi.moe>
2025-02-20 20:39:34 +08:00
Yilin Sun
a162815129 bsp: nxp/mcx/mcxa/frdm-mcxa156: Added FPU support.
MCXA156 series supports FPU and DSP, adding corresponding compiler
flags.

Signed-off-by: Yilin Sun <imi415@imi.moe>
2025-02-20 20:39:34 +08:00
kurisaw
ea31985b32 fix: fixed an issue where rt_typeof was not supported in the MDK toolchain 2025-02-19 20:24:59 -05:00
ZhaoCake
f8171f5c0b fix: without KConfig in rsource and without command help. 2025-02-19 22:53:26 +08:00
ZhaoCake
71b6d42181 [fix]Some components do not have explicit Kconfig 2025-02-19 22:53:26 +08:00
ZhaoCake
ad6ea0fb59 [fix] not ignore notes in 2025-02-19 22:53:26 +08:00
ZhaoCake
21414e8b8e [feat][tools]Only add used components to distubution package. 2025-02-19 22:53:26 +08:00
Yilin Sun
8b482aec54 bsp: nxp/mcx/mcxa/frdm-mcxa156: Add LED blinking demo.
Add LED blinking demo to align with other BSPs.

Signed-off-by: Yilin Sun <imi415@imi.moe>
2025-02-19 22:48:03 +08:00
Yilin Sun
f7feea17a4 bsp: nxp/mcx/mcxa/frdm-mcxa156: Enable PORT and GPIO clocks.
Enable PORT and GPIO peripheral clocks and release resets for all
ports.

Signed-off-by: Yilin Sun <imi415@imi.moe>
2025-02-19 22:48:03 +08:00
Chen Wang
5b6944f7fa
doxygen: More strict checks on build results (#10007)
Github CI doc_doxygen is very strict in checking the
build results, and will output failure even if there
are warnings.

In order to match CI's checks, local build scripts
are also checked more strictly to detect potential
errors and even warnings as early as possible.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-02-19 21:21:04 +08:00
Chen Wang
14cfc72fb8
doxygen: finsh: Normalize macro definitions (#10006)
Regular macro definitions according to [1].

Note: for variadic macros such as MSH_CMD_EXPORT, we can
not use normal @param command, otherwise doxygen will
report "@param is not found in the argument list of ...".
So I just write the parameters by manual.

Link: https://rt-thread.github.io/rt-thread/page_howto_macro.html [1]

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-02-19 21:06:45 +08:00
Yilin Sun
6a0909ac1a ports: nxp/mcx/mcxa/frdm-mcxa156: Fix GNU toolchain builds.
This patch modifies the original linker script provided by NXP by
adding RT-Thread related constant tables to flash.

Signed-off-by: Yilin Sun <imi415@imi.moe>
2025-02-19 15:18:02 +08:00
kurisaw
96772832f8 [drivers][bsp][reness] Add Etherkit bsp and RZ series driver compatibility adaptation 2025-02-19 13:07:20 +08:00
wumingzi
600e4ab517
Add recommanded script and extension for writing doxygen comments on … (#10001)
Add recommanded script and extension for writing doxygen comments on vscode

Signed-off-by: 1078249029 <1078249029@qq.com>
2025-02-19 09:06:15 +08:00
Kai
3251a126c1
[bsp][wch] move ch32v307 sdk to package (#9983)
* [bsp][wch] move ch32v307 sdk to package

* [bsp][wch] move ch32v307 sdk to package

* [bsp][wch] use a fixed version

* [bsp][wch]fix: ch32v307v-r1 build

* [bsp][wch] add yd board to ci

* [bsp][wch] revert toolchain path
2025-02-19 09:02:42 +08:00
Guorui Li
6a792c9df2
[lwp]add comments for lwp system calls. (#9934) 2025-02-18 19:51:10 +08:00
heyuanjie87
4b25b5ed9a
[lwp]检查killpg的signo参数的有效性 (#9981)
* [lwp]对检查killpg的signo参数的有效性
2025-02-18 14:33:56 +08:00
Rbb666
91beec4239 [ulog]Fix the problem of file_buf being released incorrectly 2025-02-18 14:31:03 +08:00
蒙蒙plus
a313d12ea0
[tools/iar] iar.py fix scons --target=iar --dist (#9997)
#9996
2025-02-18 09:16:18 +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
Chen Wang
f6f7d91a61
doxygen: add prefix for page name (#9989)
Add prefix "page_" to the name of pages.

Add this as a rule in guide of writing doxygen documents.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-02-13 23:28:19 +08:00
Chasel
d8079e3843
[bsp][mm32f526x] 1.fix adc device; (#9978) 2025-02-12 14:26:35 +08:00
cxs
70982aea87 [bsp][stm32f103c8t6 bule pill] fix the problem that is The linked list obtained by calling rt_object_get_information is empty, so the system cannot get up. 2025-02-11 18:59:46 -05:00
Li-Dongze
3a9a24fabf
ci: add qemua9 yml file (#9986) 2025-02-11 19:51:54 +08:00
Chen Wang
761bb89f27 doxygen: add documentation for doxygen
Documentation is provided to clarify how to write
doxygen documentation for RT-Thread. This document
is also integrated as part of RT-Thread doxygen
documentation.

An example is also provided.

The original README.md is removed and integrated into
this document.

Updated github actions for doxygen too.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-02-11 17:09:44 +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