4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-31 14:00:22 +08:00

16855 Commits

Author SHA1 Message Date
qilian
ffe25c58b9
Update README.md (#9959)
Fixed the issue where the absence of the u-boot-tools package caused rttpkgtools to fail to compile normally.
2025-01-30 20:15:18 +08:00
BernardXiong
cfb44d1f7f [tools] Add requirements.txt for python packages
Add requirements.txt for python packages installation.
2025-01-29 20:56:23 -05:00
Chen Wang
c66374705a libcpu: riscv: rv64: fixed warnings
When building bsp/cvitek/c906_little, compiler reports:

```
.../rt-thread/libcpu/risc-v/rv64/trap.c:
In function 'handle_trap':
.../rt-thread/libcpu/risc-v/rv64/trap.c:106:13:
warning: implicit declaration of function 'rt_hw_tick_isr';
did you mean 'rt_hw_stack_init'? [-Wimplicit-function-declaration]
  106 |             rt_hw_tick_isr();
      |             ^~~~~~~~~~~~~~
      |             rt_hw_stack_init
.../rt-thread/libcpu/risc-v/rv64/trap.c:110:13:
warning: implicit declaration of function 'rt_hw_irq_isr';
did you mean 'rt_hw_soft_irq_isr'? [-Wimplicit-function-declaration]
  110 |             rt_hw_irq_isr();
      |             ^~~~~~~~~~~~~
      |             rt_hw_soft_irq_isr
```

rt_hw_tick_isr()/rt_hw_irq_isr() are implemented by bsp, but
libcpu/risc-v/rv64 doesn't declare them, so compiler warns.

There are three BSPs using 'rv64' (libcpu/risc-v/rv64):
- `bsp/cvitek/c906_little/rtconfig.py`
- `bsp/juicevm/rtconfig.py`
- `bsp/k210/rtconfig.py`

`handle_trap` in `libcpu/risc-v/rv64` is defined as weak.
BSP can use this function directly or define and overload
it by itself.
If bsp use this function directly, bsp need to pay
attention to the fact that three functions will be called
in this function:

- `rt_hw_soft_irq_isr`
- `rt_hw_tick_isr`
- `rt_hw_irq_isr`

In `libcpu/risc-v/rv64`, `rt_hw_soft_irq_isr` has a weak
definition, while the other two do not. This means that
if the bsp does not overload `handle_trap`, bsp must
define `rt_hw_tick_isr` and `rt_hw_irq_isr` itself.
This is also the practice of `bsp/cvitek/c906_little`.
There is also a similar bsp `bsp/k210`, and the form of
`bsp/juicevm` implements `handle_trap` by itself.

It seems that `rt_hw_tick_isr` and `rt_hw_irq_isr` are
not required to be implemented by all BSPs using
`libcpu/risc-v/rv64`. The premise for BSP to implement
them is that it does not overload `handle_trap`. So
declaring `rt_hw_tick_isr` and `rt_hw_irq_isr` with
extern in `libcpu/risc-v/rv64` is not proper.

In addition, the `rt_hw_tick_isr/rt_hw_irq_isr` are only
used by `libcpu/risc-v/rv64`, so it is not worth putting
the declaration in `./include/rthw.h`.

Sum up, the best solution is to add weak definition to
`rt_hw_tick_isr/rt_hw_irq_isr` as existing `rt_hw_soft_irq_isr`.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-29 20:28:38 -05:00
Chen Wang
2dfbae2853 libcpu: riscv: common: fixed build warnings
When building bsp/cvitek/c906_little, compiler warns:

```
.../rt-thread/libcpu/risc-v/common/trap_common.c:
In function 'rt_hw_interrupt_install':
.../rt-thread/libcpu/risc-v/common/trap_common.c:50:11:
warning: unused variable 'user_param' [-Wunused-variable]
   50 |     void *user_param = param;
      |           ^~~~~~~~~~
.../rt-thread/libcpu/risc-v/common/trap_common.c:
In function 'rt_rv32_system_irq_handler':
.../rt-thread/libcpu/risc-v/common/trap_common.c:77:25:
warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   77 |         s_stack_frame = (rt_hw_stack_frame_t *)mscratch;
      |                         ^
```

Fixed these warnings as per indication from gcc.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-29 20:28:38 -05:00
Chen Wang
3383352cdc bsp: cvitek: c906_littel: fixed build warnings for board.c
When building bsp/cvitek/c906_little, compiler warns:

```
board/board.c: In function 'rt_hw_board_init':
board/board.c:26:5: warning: implicit declaration of
function 'rt_hw_tick_init'; did you mean 'rt_hw_stack_init'?
[-Wimplicit-function-declaration]
   26 |     rt_hw_tick_init();
      |     ^~~~~~~~~~~~~~~
      |     rt_hw_stack_init
board/board.c:29:5: warning: implicit declaration of
function 'rt_hw_uart_init'; did you mean 'rt_hw_board_init'?
[-Wimplicit-function-declaration]
   29 |     rt_hw_uart_init();
      |     ^~~~~~~~~~~~~~~
      |     rt_hw_board_init
```

To remove these build warnings, include header files
which declare these functions.

Plus, remove the decalartion of `tick_isr()`, this
function does not exist.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-29 20:28:38 -05:00
kaidegit
d0fcb08611 [bsp][doc]use the default mpu conf of cubemx 2025-01-29 20:28:08 -05:00
yekai
b3bf4c6c3b [bsp][doc] add PeriphCommonClock_Config and MPU_Config 2025-01-29 20:28:08 -05: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
Supper Thomas
9be28dbc67 [tools/mdk5] 如果本地设置了UV4.exe 命令,则进行MDK编译 2025-01-26 11:34:50 -05:00
Chen Wang
40f3b6a569
doxygen: create framework to unify markdown and source code part (#9946)
* doxygen: adjust documentation directory structure

- Rename documentation/doxygen to documentation/0.doxygen and cleanup
  some unused files.

- Add/rename folders for each sub sections, such as
  1.introduction/...... Each sub section will be created as a subpage.

- Generate initial Doxyfile, this Doxyfile will be used to unify
  doxygen generated API documents and those markdown files under
  documentation folder. This patch just add the default Doxyfile
  generated by running "doxygen -g". It is used as baseline to add
  more features/configurations.

- Rename documentation/README.md to documentation/INDEX.md, and
  use it as mainpage.

- Move 0.doxygen/readme.md to documentation/README.md.

* doxygen: update configurations

These configurations are from old documentation/doxygen/Doxyfile.
Try best to compatible exixting design.

* doxygen: add run script

Add a script to automatic some operations.

Updated the README.md.

---------

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
Co-authored-by: Supper Thomas <78900636@qq.com>
2025-01-26 11:44:39 +08:00
Chen Wang
c3e5152c13 bsp: cvitek: removed useless files after using rttpkgtool
Based on the patch "bsp: cvitek: use rttpkgtool
to replace cvitek_bootloader", continue cleanup useless files.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-26 10:55:44 +08:00
Chen Wang
7e0acaa254 bsp: cvitek: use rttpkgtool to replace cvitek_bootloader
Originally, for riscv big and little cores under bsp/cvitek,
after generating rtthread.bin, the cvitek_bootloader tool
would be used to package it and generate fip.bin and boot.sd
files that can be burned into sdcard. However, the
cvitek_bootloader tool repository is relatively large, and
it compiles and generates firmware such as fsbl, opensbi and
uboot from the source code level. And when using it, it
needs to be downloaded to the bsp/cvitek directory, which
will introduce pollution to source files in the RTT repository
under the original working path.

The new solution uses rttpkgtool, which is similar to
cvitek_bootloader, but it uses prebuilt firmware, so it is
very small and does not introduce pollution to the source file.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-26 10:55:44 +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
Chen Wang
7432b0a019
Revert "[action] add cvitek/c906_little ci" (#9945)
Revert "[action] add cvitek/c906_little ci (#9901)"

This reverts commit 969e0e01ef603d3929a186e8bd03f3657ec8227c.
2025-01-23 10:37:56 +08:00
Supper Thomas
969e0e01ef
[action] add cvitek/c906_little ci (#9901)
* [action] add cvitek/c906_little ci

* Update bsp_buildings.yml

* Update rtconfig.py
2025-01-23 09:35:06 +08:00
Supper Thomas
d9947e50fa
[bsp/stm32f407-rt-spark/stm32l496zg-st-nucleo] add cherryusb support (#9929)
[bsp/stm32f407-rt-spark/l496zg] add cherryusb support
2025-01-23 09:32:38 +08:00
hydevcode
5886e262f9 [scons] ci.attachconfig.yml is used in combination with scons 2025-01-22 18:21:17 -05:00
Jamie
0800db1400
Add pm driver for F472 and add lVD unlock in board_init 2025-01-21 18:43:46 -05: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
imcu
680333fc18 [bsp][cvitek] fix c906_little build warning in cache.c
build warning: passing argument 1 of 'inv_icache_range' makes integer
from pointer without a cast [-Wint-conversion]

Analyze: The passed parameter type is void*, which is a pointer type,
but the required type is uintptr_t, which is an integer type. Therefore,
there will be a 'makes integer from pointer without a cast' warning.

Solution: casting the void* pointer to uintptr_t, ensure that the
function receives the correct type.

Signed-off-by: zdtyuiop4444 <ign7798540@gmail.com>
2025-01-20 14:26:50 +08:00
Jamie
77e95594db
[BSP] add some bsp drivers for F448, F472 and add bsp test codes 2025-01-19 22:13:22 -05:00
Chen Wang
ab1f438161 bsp: cvitek: optimze build operations for aarch64
For bsp/cvitek, duo256m, the operation process is
slightly different when building images for riscv
and arm64.

To improve the user experience, unify the building
process and steps of the two as follows:

- Enter c906_little and execute `scons`

- Enter cv18xx_riscv/cv18xx_aarch64 and execute `scons`

That's all. Finally, we can get `fip.bin` and
`boot.sd` under `bsp/cvitek/output/milkv-duo256m`.

Update the README.md accordingly.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-18 00:42:14 -05:00
hydevcode
4f40a740d2
[bsp/stm32] change the attach file of stm32f407-rt-spark to yml (#9926) 2025-01-17 21:16:29 +08:00
Chen Wang
2b82ab38a2
bsp/cvitek: print arch info. during boot-up (#9919)
Duo's CPU combination is more complicated:

| BSP           | B/L core| ISA             | UART  |
| ------------- | ------- |---------------- |-------|
| cv18xx_risc-v | Big     | RISC-V C906     | UART0 |
| c906-little   | Littel  | RISC-V C906     | UART1 |
| cv18xx_aarch64| Big     | ARM Cortex A53  | UART0 |

Printing ISA and big and small core information
during the boot process helps developers/testers
determine the CPU and serial port corresponding to
the current console.

In addition, the RTT logo printing has already
distinguished whether it is smart, so the bsp
printing no longer distinguishes.

Updated README to sync with this change.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-16 22:33:55 +08:00
Chen Wang
d3841c3109
lwp: Kconfig: LWP_DEBUG default as n (#9921)
LWP_DEBUG is debugging related, should be disabled
by default.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-16 19:56:44 +08:00
imcu
6cbb2c3ee5 [bsp][cvitek] add cache opration functions for cache coherence
By default, the small core enables D-Cache without ensuring cache
coherence. Therefore, when using shared memory, inconsistencies can
occur in the data read by the small core and the big core.

Solution: Migrate cache-related functions from the official
duo-buildroot-sdk library to implement cache-related operations in
rthw.h. This allows you to either disable D-Cache or call the
flush_dcache_range function before reading and after writing for
synchronization.

It is recommended to use the flush_dcache_range function, as disabling
D-Cache can have a significant performance impact.

Signed-off-by: zdtyuiop4444 <ign7798540@gmail.com>
2025-01-16 09:05:52 +08:00
kenneth.liu
95064ed449 bsp: cvitek: fix bug in setting PLIC_PRIORITY[n]
description: In the bsp/cvitek/c906_little/board/interrupt.c, There is an issue with
setting the PLIC_PRIORITY[n].

analysis: PLIC_PRIORITY[n] each register corresponds to the priority of
a hardware interrupt number.

Solution: Each register is 4 bytes.
Multiply the total number of IRQs by 4 instead of dividing by 4.

Signed-off-by: Liu Gui <kenneth.liu@sophgo.com>
2025-01-16 09:03:26 +08:00
DingDing
37908818a0
fix GPIO and SCI drivers for RZ series (#9908)
fix gpio and sci drivers for RZ series
2025-01-15 21:38:09 +08:00
Meco Man
da6c62c293 [utest] fix twice operation of uassert 2025-01-15 10:26:40 +08:00
zhuzhuzhu
4e370473c5
fix cppcheck in lwp.c will fail if no define RT_USING_DFS (#9912) 2025-01-14 14:21:04 +08:00
zms123456
4343d32df4
[components][fs]sync procfs (#9206)
* add procfs

* fix ref count check error
2025-01-14 14:18:39 +08:00
zms123456
0ae537e531
[components][dfs]separate dfs fs data structure ops (#9205)
separate dfs fs data structure ops
2025-01-14 14:17:00 +08:00
QTbin
3436aa64cb
[ht32][drv]新增了CAN、USB和SDIO的驱动文件 2025-01-12 21:32:15 -05:00
Bernard Xiong
c5a79de38e
[tools] Add sdk_cfg.json setting for env CC detection 2025-01-11 21:20:25 -05:00
Chen Wang
123ed1be1b bsp: qemu-virt64-riscv: remove config RISCV_S_MODE
RISCV_S_MODE configuration only affects the code in
libcpu/risc-v/virt64, and the only bsp using this
libcpu is qemu-virt64-riscv.

Considering s-mode is the default mode RT-Thread
running on virt64 machine, it seems unnecessary to
make RISCV_S_MODE a Kconfig option.

Solution: Remove RISCV_S_MODE from Kconfig and define
it as a macro in the code in libcpu/risc-v/virt64.

Plus, due to this macro is only related to virt64, rename
RISCV_S_MODE to RISCV_VIRT64_S_MODE.

Update the .config/rtconfig.h in this patch.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-10 17:14:13 +08:00
Meco Man
bdd9447d70 [utest] make RT_USING_CI_ACTION to be clear
RT_USING_CI_ACTION will select RT_UTEST_USING_AUTO_RUN and RT_UTEST_USING_ALL_CASES
2025-01-09 17:45:15 -05:00
wycwyhwyq
53bd56ccf9 [components][dfs_v2]: Fix dfs_devfs_open memory leak 2025-01-09 19:07:56 +08:00
kurisaw
1b76eccb37 [drivers] merge the software i2c driver 2025-01-08 22:07:03 -05:00
Meco Man
97b9cc5000 fix: add \n for addr2line hint 2025-01-08 17:54:46 -05:00
heyuanjie87
9ceb17f176
[bsp][qemu-virt64-riscv]修正内存大小超限制的问题 2025-01-08 17:54:34 -05:00
Chen Wang
2322f0154e bsp: cvitek: remove support for spinor/spinand
Confirmed with milkv, only the sd card version is sold
by default for duo in the market. The spi pins are
provided through stamp holes, so that users can solder
the corresponding components on their baseboard during
secondary development.

In order to simplify maintenance work, the mainline
will only support the sd-card version and no longer
support spinor/spinand.

Updated config files the same in this patch.

Signed-off-by: Chen Wang <unicorn_wang@outlook.com>
2025-01-08 17:54:14 -05:00
Fan YANG
9e36a5b97d [bsp][hpmicro] fix the alignement check logic and the cache-maintenance logic
- corrected the alignement check logic
- optimized the cache maintenance logic

Signed-off-by: Fan YANG <fan.yang@hpmicro.com>
2025-01-08 14:55:04 +08:00
Meco Man
88920fd814 [utest] 修复UTEST_UNIT_RUN嵌套宏时将宏直接输出的问题 2025-01-07 20:44:29 -05:00
Meco Man
0a25fcffab [utest] add float operators
uassert_float_equal and uassert_float_not_equal
2025-01-07 20:44:29 -05:00
Supper Thomas
c9c103f30e [action] set runner to ubuntu22.04 2025-01-06 19:45:33 +08:00
Shell
6c6c5f5d35 feat: Kconfig: collecting some config to sub-menu
To improve the readability of the menuconfig.

Signed-off-by: Shell <smokewood@qq.com>
2025-01-06 19:34:16 +08:00