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>
[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>
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>
[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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>