Commit Graph
18248 Commits
Author SHA1 Message Date
W GTO 8acbb5df8e [drivers][usb] Clarify the configuration interface count check 2026-10-14 10:17:15 +08:00
W GTO 06f193d682 [usb][host] Bound interface enumeration and detach cleanup
Reject full configuration descriptors with more interfaces than the instance can hold. Clean up using the fixed interface-array capacity so an attach failure cannot leave detach trusting an oversized device-supplied count.

Fixes #11288
2026-10-14 10:17:15 +08:00
rcitach 8c46c09478 Change the main thread stack size to 4096 2026-10-14 09:44:44 +08:00
rcitach 6f6dc98475 Optimize System Resource Allocation for ra6w1 2026-10-14 09:44:44 +08:00
seteiro fd26dfa66b [bsp][esp32-c3] keep bt linker globs from matching libbtdm
A question mark matches any one character, so *bt?* also matches libbtdm. Restrict that separator to a slash.
2026-10-14 09:43:51 +08:00
seteiro e9e5ee3a32 [bsp][esp32-c3] match IRAM wildcards on Windows paths
Object paths on Windows use backslashes, so the forward-slash globs left _global_interrupt_handler in flash and the vector JAL could not reach it.
2026-10-14 09:43:51 +08:00
Zhaoqi Xu 8ec9d87959 [components][netdev] fix divide-by-zero in ping statistics when no reply
netdev_cmd_ping() computed avg_time / received before checking that any
reply arrived. When every request times out, received is 0 and the
integer division traps (SIGFPE on the simulator, a fault on Cortex-M),
taking the shell thread down. Only compute the average inside the
existing received > 0 branch where it is printed.

Fixes #11852
2026-10-14 09:33:19 +08:00
luchenxu 517eecbe4a [kernel] fix calloc overflow 2026-10-14 09:28:14 +08:00
moment-NEW 2486e7b47e style: format code with clang-format [skip ci] 2026-10-14 09:18:27 +08:00
moment-NEW 2cad4a8670 [bsp][stm32] Add SPI6 BDMA support for stm32h723-DM-MC02
- Enable SPI6 on-chip driver with TX/RX selectable DMA/BDMA modes
  (BDMA options come from the shared HAL_Drivers Kconfig)
- Reserve the WS2812 BDMA buffer section (.ws2812_bdma) in SRAM4
  across GCC/IAR/MDK5 linker scripts for a standalone package
- Sync CubeMX configuration and regenerate MDK5 project
- Update README with SPI6/BDMA support status
2026-10-14 09:18:27 +08:00
Jiang Yu 9e0e6dbba7 [components/drivers] reset: Fix build error when reset and ulog are both enabled.
The '#define assert ASSERT' in ulog_def.h conflicts with the 'assert'
used in reset.c (rstc->rstcer->ops->assert), causing unintended macro expansion.

Signed-off-by: Jiang Yu <yu.jiang@rock-chips.com>
2026-10-14 09:16:11 +08:00
Piyush Patle f9436bb5bd [risc-v][vector] Restore vstart after vector configuration 2026-10-14 09:13:49 +08:00
wdfk-prog 270a18d292 fix[tools][eclipse]: handle hidden directories in source exclusion 2026-10-12 11:06:04 +08:00
Rbb666 20c3e12b05 [tools][build] Fail when the toolchain directory is missing 2026-10-12 09:56:31 +08:00
Jaeyeong Lee ceef6e0ccd fix[usb]: support VCOM polling receive with Serial V2
Signed-off-by: Jaeyeong Lee <lee@jaeyeong.cc>
2026-10-11 17:37:11 +08:00
Jaeyeong Lee 8a3ca7bfa3 fix[usb]: stop aliasing rt_ringbuffer as rt_serial_rx_fifo in VCOM
With RT_USB_DEVICE_CDC and RT_USING_SERIAL_V2 both enabled, _function_enable
assigned the embedded rx_ringbuffer to serial.serial_rx. Serial V2 reads that
pointer as a struct rt_serial_rx_fifo, whose first member is a rt_ringbuffer,
so ring-buffer access happened to work while rx_cpt, rx_cpt_index and
rx_timeout landed on the following members of struct vcom, corrupting tx_rbp.
The layout shifts again with RT_SERIAL_USING_DMA, which inserts dma_ping_rb
ahead of those fields.

Serial V2 already owns the receive FIFO: dev_serial_v2.c allocates it with
rt_malloc on open and releases it with rt_free on close, so the assignment
also made rt_free run on memory inside struct vcom.

Drop the assignment and read the FIFO Serial V2 owns. rt_hw_serial_isr
reports RX_IND from serial_rx->rb, so the endpoint handler now fills that
ring buffer and _vcom_getc drains it. The Serial V1 path is unchanged.

Fixes #11739

Signed-off-by: Jaeyeong Lee <lee@jaeyeong.cc>
2026-10-11 17:37:11 +08:00
seteiro 3577e7a6ed [components][libc] run .init_array constructors in cplusplus_system_init
Newer GCC emits C++ global constructors into .init_array, which many
linker scripts keep outside [__ctors_start__, __ctors_end__), so they
never ran. Walk __init_array_start/__init_array_end (weak) as well,
skipping entries already covered by the ctors range.

Add RT_USING_CPP_CRT_INIT for ports whose startup runtime already runs
.init_array, default on for the simulator. With it set, only the
.init_array walk is skipped; the ctors range is still walked.

Renesas RA/RA_WIRELESS/RZ families select it when C++ is enabled: FSP
SystemInit() already walks .init_array, so boards whose linker script
only provides __init_array_* would run constructors twice. Boards that
fold .init_array into the ctors range (ra6m3-hmi-board, ra8d1, rz)
still run them once via RT-Thread.

Also source env.sh and restore RTT_EXEC_PATH in ToolsCI project generate
and dist steps so scons is on PATH (exit 127) and the ARM toolchain path
is not overwritten by env.sh.

Fixes #11778
2026-10-11 16:11:07 +08:00
CYFS 33b1dd58ba [utest][perf] Fix clock time dependency and test build guard 2026-10-11 15:59:15 +08:00
陈谋顺 ba0f47edb3 [components][lwip] dhcpd: apply clang-format to dhcp_server.c 2026-10-10 17:20:57 +08:00
陈谋顺 887ca7175c [components][lwip] dhcpd: check buffer bounds when parsing options
The option loop advanced by the option length without checking the
number of bytes actually received by recvfrom(), so a malformed or
truncated DHCP packet could make the server read past the end of the
receive buffer.

Check that the option type, length and payload stay inside the received
data before reading them, and stop parsing when a requested IP option
is shorter than 4 bytes or a message type option is shorter than 1 byte.

Fixes #11323
2026-10-10 17:20:57 +08:00
avm1234567 cd92c3d06c fix stack alignment to 8 bytes for ARM AAPCS compliance 2026-10-10 17:20:03 +08:00
陈谋顺 914dda7d02 [components][ulog] 用仓库的 clang-format 整理 ulog.c
按根目录 .clang-format 跑过 clang-format 19.1.7。
颜色复位仍在换行之前。
2026-10-09 08:58:47 +08:00
陈谋顺 572b7392b7 [components][ulog] 带颜色日志先恢复默认颜色再换行
Fixes #11296

ulog_tail_formater() 原来先写换行再写 CSI_END,颜色复位落在下一行开头,
shell 提示符不会回到默认颜色。现在先写 CSI_END,再写换行。
2026-10-09 08:58:47 +08:00
Tim Wang c3e94f7b5f [lwip] fix sio_write signature conflict 2026-10-03 12:59:43 +08:00
Tim Wang 8bdb76a12c [lwip] clean lwip doc files 2026-10-03 12:59:43 +08:00
Tim Wang f1cc628cf2 [lwip] add lwIP 2.2.1 as a selectable version alongside 1.4.1/2.0.3/2.1.2
- Kconfig: RT_USING_LWIP221 choice, RT_USING_LWIP_VER_NUM=0x20201
  - SConscript for lwip-2.2.1 (acd.c, mdns split files, tftp.c)
  - replay RTT patch set from lwip-2.1.2 onto 2.2.1
  - import RTT ping.c and tftp_port.c (adapted to 2.2.x TFTP API)
  - SAL: version-gated netconn socket accessor (callback_arg union >= 2.2.0)
  - lwipopts: DHCP ACD (RFC 5227) and MEMP_NUM_SYS_TIMEOUT version gates
2026-10-03 12:59:43 +08:00
Tim Wang 4422241f09 [lwip] import pristine lwIP 2.2.1 source tree
Verbatim upstream lwIP 2.2.1 official release (STABLE-2.2.1),
  complete with apps/, test/ and Filelists.
2026-10-03 12:59:43 +08:00
seteiroandseteiro dc8aaa73f2 [bsp][esp32-c6] add ESP32-C6-DevKitC-1 support (#11836)
* [bsp][esp32-c6] add ESP32-C6-DevKitC-1 support

Add bsp/ESP/ESP32_C6. Default image is GPIO, UART0 and ADC. The C6 IDF sources are not in RT-Thread-packages/esp-idf yet.

* [bsp][esp32-c6] fix CI format, C6 package and CH32V203 D6 build

clang-format the files the format check rejected. Fetch the C6 scons
branch when the downloaded ESP-IDF package has no C6 target. Patch the
CH32V20x SDK under libraries so a D6 build no longer calls Exit().

* [bsp][esp32-c6] fetch mbedtls and stop pkgs from pulling the C6 branch

* [bsp][esp32-c6] rebuild CI against the package branch tip

* [bsp][esp32-c6] rebuild CI against the strict-mode package tip

* [bsp][esp32-c6] fix the reviewed ADC, math and package pin bugs

Keep the IDF tree on the reviewed commit, and stop the ADC and critical-section paths from reporting success when they did not.

* [bsp][esp32-c6] reserve stuck interrupt lines and lock ADC

CPU lines 3 and 4 never latch an enable, so copying the handler left the non-IRAM mask on the old line. Reserve those lines and let the allocator write the mask and the route together. The C6 oneshot registers are shared, so one mutex covers enable and convert.

* [bsp][esp32-c6] list the peripherals this board actually runs

GPIO, UART0 and ADC1 have been read on the DevKitC-1. Radios and the untested buses stay marked unsupported.

* [bsp][esp32-c6] keep SPI unsupported after the loopback mismatch

GPIO7 shorted to GPIO2 returned 0xA5000000 for a sent 0xA5, so the table does not mark SPI supported.

---------

Co-authored-by: seteiro <276597748+cms19859230182-lang@users.noreply.github.com>
2026-09-28 22:22:30 +08:00
seteiro 6f99d7bf97 [bsp][ch32v003] add CH32V003F4P6-EVT support #11838 2026-09-28 22:20:40 +08:00
蒙蒙plus a71f87ecec [bsp][iar] Use $PROJ_DIR$ relative paths for link.icf in template.ewp
IlinkIcfFile in 5 BSP template.ewp files pointed to absolute paths on other developers' machines, which scons --target=iar copies into the generated project.ewp and breaks builds elsewhere.

Affected: asm9260t, mm32f3270-100ask-pitaya, stm32f103-100ask-mini, stm32f103-100ask-pro and imxrt1180-nxp-evk/cm7 (3 configurations).
2026-09-28 22:19:15 +08:00
蒙蒙plus 05badce954 [drivers][ipc] 移除 SConscript 中冗余的 __RT_IPC_SOURCE__ 宏定义 2026-09-27 12:18:44 +08:00
Copilot b40aeb146b [gd32][build] skip package precheck during gd32vw553h clean- #11837 #11837 2026-09-26 19:58:26 +08:00
seteiro 386b877ba3 [bsp][ch32v203] add CH32V203C8T6-EVT-R0 support #11827 2026-09-24 16:21:11 +08:00
CYFS da5098b0af [ci][format] Stop skipping CI for clang-format commits 2026-09-23 16:34:50 +08:00
萌新源 005d291492 [bsp/Infineon] Fix PWM macro mismatches left by the CHx_PORTy rename (#11802)
* [bsp/Infineon] Fix PWM macro mismatches left by the CHx_PORTy rename

Commit e5382cb733 renamed the PWM table guards in drv_pwm.c to the
CHx_PORTy convention but only adapted the psoc6-evk Kconfig, leaving
several mismatches behind:

- The psoc6-evaluationkit-062S2 slider sample still tested the old
  flat name BSP_USING_PWM0_PORT0 while the board Kconfig defines
  BSP_USING_PWM0_CH0_PORT0, so the PWM init was compiled out.
- The PORT13 entry was renamed to BSP_USING_PWM0_CH7_PORT13, a macro
  that no Kconfig defines, and the channel is wrong anyway:
  PWM0_CH3_PORT13_CONFIG carries .channel = 3, PORT13 sits under the
  PWM0 CH3 menu, and the slider demo selects CH3 + PORT13.
- The PSOC62 template and five psoc6 boards (cy8ckit-062-BLE,
  cy8ckit-062-WIFI-BT, cy8ckit-062S2-43012, cy8ckit-062s4,
  cy8cproto-062S3-4343W) still define the old flat names.

Fix all of them by migrating the evaluationkit sample to
BSP_USING_PWM0_CH0_PORT0 and renaming the PORT13 group to
BSP_USING_PWM0_CH3_PORT13 across drv_pwm.c, the PSOC62 template and
the five boards' Kconfigs/slider samples, so Kconfig, driver table
and samples match again.

Note: the sibling guards BSP_USING_PWM0_CH7_PORT2/5/7/9/10/12 are
still not generated by these boards' Kconfigs; left untouched for a
separate discussion.

* style: format code with clang-format [skip ci]
2026-09-21 15:44:01 +08:00
Onlyou_tzZ 0edbc15ea9 [cherryusb][fsdev] add N32H4x USBFS device support #11764 2026-09-21 15:43:37 +08:00
wyf-777 3eff2d5c7e [net][at] Reject overlong numeric hostnames
Numeric hostnames were copied into a fixed stack buffer without a length bound.

Cache the length, reject values that cannot fit, and terminate the copy explicitly.

Fixes #11332

Assisted-by: OpenAI Codex:GPT-5
2026-09-21 10:18:56 +08:00
zhangyuyang 5d1aee9b32 [components][sdio] Fix CIS tuple memory leak 2026-09-21 10:12:51 +08:00
Cheng Li f0b40514f8 [docs] do not tell users to delete /usr/bin/python3
Section 3.2.1 of the QEMU (Ubuntu) quick start instructs the reader to
run "sudo rm -rf /usr/bin/python3" and re-create the symlink by hand.
On Debian and Ubuntu, apt and much of the system tooling are Python
programs resolved through that path, so following the guide leaves the
machine unable to install packages at all - including the packages
needed to undo it. The hardcoded 3.9 version in the example also goes
stale with every release.

Replace it with python-is-python3, which is what provides the python
command on these distributions, and add a warning against the manual
approach. Drop the now unreferenced screenshot.
2026-09-21 09:52:58 +08:00
Cheng Li 2613055c4a [docs] point QEMU Linux quick start at qemu-nographic.sh
The quick start only ever mentions ./qemu.sh, and its file table omits
the qemu-nographic scripts entirely. qemu.sh passes -serial stdio
without -nographic, so QEMU opens a GTK window for the emulated CLCD.
On a headless machine or over SSH it stops at "gtk initialization
failed", with nothing in the guide explaining what to do next, even
though the BSP already ships qemu-nographic.sh for exactly this case.

Add both nographic scripts to the file table and document them where
the project is first run.
2026-09-21 09:52:06 +08:00
CYFS b80e928f3d [bsp][gd32] Fix USART TX and RX GPIO initialization
Configure TX as alternate-function push-pull and RX as pull-up input on GD32E50x/F10x/F20x/F30x. Remove the GPIO API alias that incorrectly configured both pins as general-purpose push-pull outputs.
2026-09-21 09:38:05 +08:00
wdfk-prog 3ede09e45b feat[bsp][stm32][h7]: add UART4 RX DMA configuration
Add the missing UART4 RX DMA definitions for STM32H7.

UART4 RX DMA uses DMA1 Stream0 with the UART4 RX DMA request.
The configuration is enabled when BSP_UART4_RX_USING_DMA is selected.
2026-09-21 09:36:49 +08:00
zhangyuyang c2f5a28321 [components][sdio] fix possible memory leak of sdio driver unregistration 2026-09-21 09:34:06 +08:00
kingingwang 678473c3ba [rust][tools] Fix Cortex-M33 hard-float target selection
detect_rust_target() 的 Cortex-M33 分支固定返回 thumbv8m.main-none-eabi,
没有使用同函数已计算的 hard_float,而 M4/M7 分支是判断的。

硬浮点 M33 板卡因此拿到软浮点 ABI 的 Rust 库,链接时报
"uses VFP register arguments" 并终止构建。

按 hard_float 选择 eabihf/eabi,与 M4/M7 分支保持一致。
2026-09-21 09:29:19 +08:00
wdfk-prog f6e74cee17 feat[drivers][block]: fix printf format type mismatches
Fix format specifier mismatches in blk_partition.c by using the
appropriate integer formats and explicit casts.

This removes -Wformat warnings on platforms where rt_uint32_t and
rt_size_t are represented as unsigned long.
2026-09-21 09:28:56 +08:00
luchenxu ed686ba95b [ci] fix missing libtinfo5 dependency for LLVM ARM workflow 2026-09-17 22:29:35 +08:00
luchenxu f33265d90b [bsp][stm32]fix stm32 ld flash oversize #11124 2026-09-17 09:31:36 +08:00
Leeto bbc45da16c [HC32][BSP] Delete PM_TICKLESS_TIMER_ENABLE_MASK in pm_config.h, modify 'NAME_MAX' to 24 #11798 2026-09-16 17:54:41 +08:00
wdfk-prog 69451d1a8e fix(drv_dma): 修复stm32_dma_type_name函数链接问题
将函数声明从static改为extern,解决跨文件调用时的链接错误,
确保DMA、BDMA和GPDMA类型的日志标签能够正确生成。
2026-09-16 10:19:06 +08:00
OnlyoutzZ 51be4c4589 [bsp][n32] n32hxxx: fix H7xx hard I2C abort and add the missing SDK header
The N32H7xx branch of drv_hard_i2c.c had never been compiled. The file takes
its peripheral declarations from board.h, and only n32h497zgl7-evb includes
n32h49x_i2c.h, so on H7xx every I2C symbol was undefined and the option could
not build at all. Include the peripheral header from the driver itself, the way
drv_sdram.c already does.

I2C_ABORT_ON_TIMEOUT also degraded to a bare `state = I2C_READY` on H7xx, at the
four rt_completion_wait() timeouts in n32_i2c_master_xfer(). The H49x
implementation is written against the older IP - I2C_ClrIntPendingBit,
I2C_STS2_BUSY, I2C_CTRL1_STOPGEN - none of which exist in the H7xx SDK, so give
H7xx its own teardown. It disables the interrupt and DMA request sources,
disables the DMA channel that would otherwise stay armed against the caller's
buffer, releases the bus and clears the status residue.

Only flags with a matching INTCLR bit may be passed to I2C_ClrFlag(), which is a
plain "INTCLR |= flag" write; TFC (0x40) and BUSY (0x8000) have none.

I2C_Configuration() was called from n32_i2c_init() but defined nowhere in the
tree. It is a board hook for pin mux, which is not the driver's job - the H49x
path configures no pins either - so drop the call.

Verified by building n32h760zil7-stb with BSP_USING_HARD_I2C1 and its TX/RX DMA
enabled, which now compiles and links with no warnings, and n32h497zgl7-evb with
I2C1/I2C2 DMA enabled, whose image size is unchanged. Neither board routes I2C
pins yet, so this is build-verified only, not hardware-verified.
2026-09-16 09:06:34 +08:00