Commit Graph
18296 Commits
Author SHA1 Message Date
bernardandClaude Code 9e29e3246b [components][lwp] harden sys_getaddrinfo user pointer handling
sys_getaddrinfo() validated the top-level res buffer, then wrote the
resolved socket address through res->ai_addr, a user-controlled nested
pointer that was never checked. On Smart/MMU builds a user program could
therefore turn getaddrinfo() into an arbitrary kernel write. The hints
fields were also read directly from user memory after the access check,
leaving a TOCTOU window.

Copy res and hints into kernel temporaries with lwp_get_from_user() so
all nested pointers come from one validated snapshot. Write the nested
sockaddr and the outer addrinfo back with lwp_put_to_user(), which
validates the destination range and never dereferences an unchecked user
pointer in kernel context.

Also fix the servname copy check (a size_t result can never be < 0),
allocate the kernel addrinfo with sizeof(*k_hints), and release k_res on
the new error paths.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-03 09:04:56 +08:00
GuEe-GUI 2c88a3b698 [drivers][scmi] Fix reset provider lookup and driver registration order
- register SCMI reset and power-domain drivers during subsystem initialization
- resolve SCMI reset state through the reset-controller provider
- use the parsed DT reset domain ID when querying reset attributes
- retain the SCMI device reference in the reset provider instance

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-11-02 18:20:45 +08:00
陈泽堂 2254560414 fix[klibc]: stop gcc from turning the kstring.c byte loops into memset/memcpy calls #11965 2026-11-02 18:08:11 +08:00
CYFS dace1947dd [klibc] Fix tiny vsnprintf long long formatting 2026-11-02 16:25:16 +08:00
Old-Ding 08cad4ee9c usbdevice: clamp OS compatible ID response length 2026-11-02 11:47:57 +08:00
Old-Ding cb9dc59180 usbdevice: validate string descriptor index 2026-11-02 11:47:07 +08:00
zhangyangysuandyang.zhang 7e7237d644 Fix stack corruption in rt_sdhci_init_host() (#11542)
* lwp: fix pid leak on exec failure before task startup

When msh tries to execute a non-ELF path, lwp_execve() may allocate a PID
before lwp_load() fails. The old error path only dropped the LWP reference,
leaving the PID tree entry pointing to a freed LWP.

In an init-less boot flow, this can poison pid 1 after a failed command from
msh. A later LWP launch may then treat the stale pid 1 entry as a valid parent
LWP, resulting in invalid pgrp/session state and a job-control assertion during
process exit.

Add lwp_pid_rollback() for exec/spawn failures before the process becomes
runnable. Unlike lwp_pid_put(), it always releases the PID lock and does not
enter the "no more pid allocation" state when the PID tree becomes empty.

Use the rollback helper in lwp_execve() failure paths after PID allocation.

Signed-off-by: zhangyang <gaoshanliukou@163.com>

* [drivers][sdio] avoid SDHCI device name stack overflow

rt_sdhci_init_host() allocated a fixed 32-byte buffer for device-derived object names, but sdio_host_set_name() may copy up to RT_NAME_MAX bytes into the output buffer. When RT_NAME_MAX is larger than 32, this can overwrite the stack and corrupt nearby locals.

Size the temporary name buffer with RT_NAME_MAX, force it to be NUL-terminated, and derive the append offset from the actual string length. Also replace the suffix rt_sprintf() calls with bounded rt_snprintf() so timer and workqueue suffixes cannot overflow the buffer when the base name is already close to RT_NAME_MAX.

Signed-off-by: zhangyangysu <zhangyangysu0928@gmail.com>

---------

Signed-off-by: zhangyang <gaoshanliukou@163.com>
Signed-off-by: zhangyangysu <zhangyangysu0928@gmail.com>
Co-authored-by: yang.zhang <zhangyang01@kylinos.cn>
2026-11-02 11:24:11 +08:00
CYFS cbc19778d0 [clang-format] Pin version 22.1.8 and format kernel sources (#11936)
* [clang-format] Pin formatter version to 22.1.8

* [clang-format] Adjust loop line breaks

* [kernel] Format src with clang-format 22.1.8
2026-10-30 18:20:46 +08:00
usualtreee 506dbc6d6a [dlmodule] fix: uninitialized globals in relocatable modules (#11915) 2026-10-30 10:54:53 +08:00
CYFS c89121a203 [bsp][qemu-virt64] Restore standard kernel defaults 2026-10-29 16:59:15 +08:00
bernard 6b287856f9 [components][lwp] apply clang-format to syscall sources
- format the newly split syscall implementation files
- no functional change
2026-10-29 14:50:07 +08:00
bernard 68757abdcc [components][lwp] split syscall implementation by subsystem
- move syscall implementations from lwp_syscall.c into syscall/
- group memory, file, socket, process, IPC and time syscalls
- add a shared syscall dispatch table and internal header
- register the new directory from the LWP build script
- no functional change
2026-10-29 14:50:07 +08:00
bernard b4c6828cf4 [components][lwp] fix TTY init format and control character copy
- place the TIOCLINUX case brace on its own line
- use sizeof(tty_ctrl_charset) directly as the memcpy size
- fix the cppcheck sizeofDivisionMemfunc warning
2026-10-29 14:48:33 +08:00
bernard 24c624aa7a [components][lwp] handle TIOCLINUX and default window size
- return zero keyboard modifiers for TIOCLINUX instead of failing
- keep terminal applications that probe console state working
- initialize the TTY window size to 24x80 when none is reported
2026-10-29 14:48:33 +08:00
Huoyanlifusu 6040d6cf2c [components][netdev] Fix ping maximum & minimum latency counting 2026-10-29 09:33:44 +08:00
Bernard Xiong b88861d285 [bsp][qemu-virt64] enable RT-Thread Smart #11896 2026-10-29 09:29:21 +08:00
usualtree 30a61febbe [dhcp] fix raw server option bounds checks
Validate option headers and declared lengths before walking or returning options. Check minimum value sizes at the MESSAGE_TYPE and REQUESTED_IP call sites and bound parsing by the received packet length.

Fixes: #11913
2026-10-28 19:04:31 +08:00
rcitach a19a8655f6 [bsp][ra6w1] Adapt the rafw_gen system configuration 2026-10-28 18:52:55 +08:00
Yucai Liu 18da61b557 MAINTAINERS: remove Yucai Liu
I no longer have the time or energy to participate in RT-Thread
community work, so I am removing my maintainer information.

Signed-off-by: Yucai Liu <1486344514@qq.com>
2026-10-28 18:48:34 +08:00
CYFS3 ff82e23d13 style: format code with clang-format [skip ci] 2026-10-28 14:44:20 +08:00
CYFS 25dcad752c utest: skip signal zero with musl 2026-10-28 14:44:20 +08:00
CYFS 90e06f354b utest: stabilize CI test execution 2026-10-28 14:44:20 +08:00
CYFS 58d1377f01 utest: keep testcase failures across units 2026-10-28 14:44:20 +08:00
bernard e6905134d5 [drivers][8250] honor register width for ns16550 earlycon
- read reg-shift and reg-io-width from the device tree
- select the MMIO access width from reg-io-width
- reject unsupported register widths during early setup
- keep the generic 8250 path for other compatibles
2026-10-27 19:26:35 +08:00
bernard 6bce506bed [libc] use DFS file operations in poll
- resolve fops from dfs_file instead of vnode directly
- keep compatibility with both DFSv1 and DFSv2
- validate fops before dereferencing to avoid NULL access
2026-10-27 19:21:46 +08:00
Bernard Xiong 9e7065c85a [net][sal] validate RAW socket protocol (#11888)
* [net][sal] validate RAW socket protocol

- replace the IPPROTO_RAW-only check with VALID_PROTOCOL()
- allow RAW sockets for protocols such as ICMP
- keep the existing domain and type validation unchanged

* [net][sal] fix clang-format alignment

- align the macro continuation after the RAW protocol check
- no functional change
2026-10-27 19:21:16 +08:00
bernard f29b9ae21c [dfs] fix UTIME_OMIT handling in utimensat
- UTIME_OMIT means the corresponding timestamp must not be changed
- the inverted condition overwrote mtime and ignored a valid timestamp
- correct the comparison so UTIME_OMIT leaves the attribute untouched
2026-10-27 19:20:33 +08:00
bernard 9e6dec3b14 [net][lwip] add loopback netdev support
- add RT_LWIP_USING_LOOPBACK as a configurable option
- register lo/lo0 as a netdev and bring the link up
- make loopback the default interface when none is configured
- increase the RAW receive mailbox size for loopback echo
2026-10-25 19:26:53 +08:00
CYFS a59e72fb5c [clang-format] Refine style rules with a thread.c formatting example (#11859) 2026-10-23 17:09:35 +08:00
Yunlk 2f7aba80fb [tools] fix: replace console emoji in attachconfig.py
scons --attach prints a check mark / cross emoji as status prefix. On
Windows the standard output encoding follows the locale code page (936/GBK
on a Chinese system), which cannot encode U+2705/U+274C, so Python raises
UnicodeEncodeError and the command aborts:

    UnicodeEncodeError: 'gbk' codec can't encode character '\u2705'
      File "tools/attachconfig.py", line 18, in GenAttachConfigProject

All three commands go through the same function, so --attach=?,
--attach=<name> and --attach=default were all unusable on such systems.

Replace the emoji with plain ASCII markers and keep the existing ANSI colour
codes, which the other scripts under tools/ already use.

Refs #11906
2026-10-22 18:00:03 +08:00
GuEe-GUI e7c293802a [bsp][spacemit/k1] Enable eight CPUs and add BSP support overview
Increase RT_CPUS_NR from 4 to 8 in the K1 default configuration
and regenerate rtconfig.h.

Add the SpacemiT K1 entry and peripheral support matrix to the
BSP overview.

Verified eight-core boot and root filesystem mounting with the
RISC-V ticket spinlock fix.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-10-22 17:59:29 +08:00
GuEe-GUI 2a4e78d232 [libcpu][risc-v] Fix ticket spinlock stalls under SMP contention
Eight-core boot on SpacemiT K1 could stall with one CPU in the
unlock LR/SC loop, two CPUs allocating tickets, and the remaining
CPUs waiting for the scheduler lock.

Replace LR/SC ticket allocation with amoadd.w.aqrl and release the
lock with a halfword owner update. Order critical-section accesses
after acquiring ownership and before releasing it.

Verified eight-core boot on K1 with temporary diagnostics and
reservation-clearing changes removed.

Signed-off-by: GuEe-GUI <2991707448@qq.com>
2026-10-22 17:59:29 +08:00
Chen MoushunandGrok dff75f072f [bsp][esp32] adapt C3/C6 to ESP-IDF v6.1 and bump RISC-V toolchain to gcc 15.2 (#11870)
* [bsp][esp32] adapt C3/C6 to ESP-IDF v6.1 and bump RISC-V toolchain to gcc 15.2

- Adapt ESP32-C3/C6 BSP to ESP-IDF v6.1; bump RISC-V toolchain to gcc 15.2
- C6: re-enable SPI with board-local drv_spi.c; add devices.spi to CI
  attachconfig; drop shared drv_spi.c spi_command_t hack
- C6: fix ADC oneshot multi-channel unit handle and mutex
- C3: fix portTRY_ENTER_CRITICAL_SAFE expansion in portmacro.h
- Compat with RT-Thread-packages/esp-idf rtt-dev used by CI: map
  SYSTIMER_* to SYSTIMER_LL_* (C3 and C6 board.c), accept uart_periph.h
  from hal/ or soc/
- Fix clang-format and cppcheck issues in the compat code

Signed-off-by: seteiro <chenmoushun@163.com>
Co-Authored-By: Grok <seteiro@mail.grokbot.com>

* ci: retrigger after esp-idf#18 merged

* bsp: ESP: fix C6 ADC for IDF 6.1 (adc_ll bus clock)

Replace removed PERIPH_SARADC_MODULE with adc_ll_enable_bus_clock /
adc_ll_reset_register when ESP_IDF_VERSION >= 6.0.0.

---------

Signed-off-by: seteiro <chenmoushun@163.com>
Co-authored-by: Grok <seteiro@mail.grokbot.com>
2026-10-22 15:42:35 +08:00
GUI 1c801efabc [bsp][spacemit/k1] first version #11132 2026-10-19 18:49:16 +08:00
seteiroandGrok 54f5cac5b4 drivers/misc: register rt_null at BOARD init for default console (#11472)
rt_console_set_device() is typically called in rt_hw_board_init() right
after rt_components_board_init(). null was INIT_DEVICE (level 3), so it
was not registered yet and could not be RT_CONSOLE_DEVICE_NAME.

Raise to INIT_BOARD_EXPORT; null is a pure software sink with no HW deps.

Co-Authored-By: Grok <seteiro@mail.grokbot.com>
2026-10-19 16:53:09 +08:00
zhangyuyang 8159dc81b7 [drivers][touch] Remove redundant path from global CPPPATH
The touch framework has no private headers in its source directory, so
adding the directory to CPPPATH is unnecessary. Remove it to avoid
polluting the global header search path, as discussed in #10980.
2026-10-17 16:42:48 +08:00
Fan YANG fc64f78669 [bsp][hpmicro] upgrade hpm_sdk to v1.13.0 and add hpm5100evk support
Sync the HPMicro BSPs with hpm_sdk v1.13.0 and add the HPM5100EVK
(HPM5151) board.

- add the hpm5100evk BSP (board/startup/applications/Kconfig/docs) and
  register it in .github/ALL_BSP_COMPILE.json, bsp/README.md and the
  HPMicro READMEs
- re-sync the 11 existing boards (board/startup/debug scripts/linker
  scripts/applications) with hpm_sdk v1.13.0, keeping the RT-Thread
  specific parts: clock_time based drv_timer, CXX wired into the scons
  environment, SConscript outputs under build/, named Kconfig choices,
  rt_hw_us_delay in board_delay_*, board local codec files
- sync the shared driver layer with hpm_sdk v1.13.0 (GPTMRv2/PTMR,
  PUART, soft I2C/SPI and the remaining peripheral driver updates)
- select the hpm_sdk v1.13.0 online package (PKG_USING_HPM_SDK_V113)
- use -Og instead of -O0 for the debug builds and print floats with the
  RT-Thread klibc implementation instead of newlib nano
- initialize the RT-Thread heap before the SDK console init: the SDK
  console_init() calls setvbuf(), which allocates through the C library
  malloc() and tripped RT_ASSERT() in rt_smem_alloc() on the boards
  built with RT_USING_DEBUG
- keep only ram_rtt.ld/flash_rtt.ld per board, align the DLM origin to
  4KB on hpm5300evk/hpm5301evklite (the unaligned origin made the
  linker emit a file backed PT_LOAD for the RAM area, which broke
  "program rtthread.elf"), and anchor the generated .bin at the flash
  base address 0x80000000
- sync the hpm6750evk openocd debug scripts with the new style used by
  the other boards (hpm_common.cfg/hpm_reset.cfg with arp_halt)

- keep the upstream synced board/startup/libraries trees of bsp/hpmicro out of the
  changed-file cppcheck run (same policy as bsp/hpmicro/.clang-format-ignore): the
  check runs without the hpm_sdk include paths, so it reports ATTR_PLACE_AT and the
  linker script symbol arithmetic in c_startup() as errors

- give the hpmicro boards in the changed-file scons trigger list the RV32 toolchain
  they need (RISC-V-GCC-RV32) and add the matching installation step to that
  workflow: the entries used sourcery-arm, which only provides the ARM toolchain,
  so those legs could not find riscv32-unknown-elf-gcc

- keep hpm5100evk's ram_rtt.ld identical to the hpm_sdk v1.13.0
  reference: the .fast_ram sections belong in DLM there (the DLM has
  enough headroom), and that also makes its RAM and flash layouts agree
- skip the dependency pre-check when cleaning (scons -c): it runs from
  DoBuilding() unconditionally, so a clean request with packages/ not
  fetched yet was aborted with exit code 1 instead of cleaning

- make the manual scons trigger workflow runnable: it aborted while still
  downloading actions because actions/upload-artifact@v3 is deprecated,
  and scons was not on PATH because ~/.env/env.sh was never sourced.
  Install tools/requirements.txt and source the Env PATH script in the
  build step, and use @main action versions, as bsp_buildings.yml does
- start the LED demo thread only when rt_thread_create() succeeded

Tested:
- 12 boards x {ram_debug, ram_release, flash_debug, flash_release}:
  48/48 clean builds
- flash boot + msh on hpm5100evk, hpm5300evk, hpm5e00evk, hpm6200evk,
  hpm6300evk, hpm6750evk, hpm6750evk2, hpm6750evkmini, hpm6800evk,
  hpm6e00evk, hpm6p00evk (list device/timer, ps, free, reset, rt_kprintf
  float formatting)

- re-ran .github/workflows/manual_trigger_scons_except_STM32_all.yml with
  the matrix reduced to the three hpmicro rows: all three legs build and
  scons --dist succeeds with no local workarounds
2026-10-17 16:28:33 +08:00
GUIandseteiro 8d8dc96b67 [ARCH/RISC-V] Next RISC-V (#10320)
* [libcpu][risc-v] Refactor the RISC-V architecture port

Introduce an opt-in unified RISC-V common layer for RV32 and RV64 while keeping existing BSPs on the legacy implementation during migration.

- use ARCH_RISCV and ARCH_CPU_64BIT for architecture and XLEN selection
- unify context, trap, MMU, cache, timer, SBI, SMP and ISA handling
- add PLIC, CLIC, ACLINT, APLIC and IMSIC support
- map physical hart IDs to contiguous logical CPU IDs
- add T-Head vendor overrides while preserving legacy ports
- migrate qemu-virt64-riscv with RV32 and RV64 support
- update clock_time, MM, LWP, OFW, PCI and Rust integration

Existing BSPs continue using legacy_common or common64 unless they select RT_USING_RISCV_NEW_COMMON.

Signed-off-by: GuEe-GUI <2991707448@qq.com>

* [libcpu][risc-v] skip disabled CPU nodes in early FDT walk

Rbb666 noted that rt_hw_fdt_install_early() walked every /cpus child
without checking status, so disabled cores still joined hart registration
and MMU capability probing. Skip nodes that are not okay/ok via
rt_fdt_device_is_available() before reading reg or mmu-type.

Signed-off-by: seteiro <chenmoushun@163.com>

* [libcpu][risc-v] Fix per-CPU page table mapping

- reuse existing non-leaf page table entries when mapping per-CPU areas
- reject leaf entry conflicts instead of overwriting mappings

Signed-off-by: GuEe-GUI <2991707448@qq.com>

---------

Signed-off-by: GuEe-GUI <2991707448@qq.com>
Signed-off-by: seteiro <chenmoushun@163.com>
Co-authored-by: seteiro <chenmoushun@163.com>
2026-10-17 09:44:26 +08:00
Rbb666 c1d931bcc7 [kernel] Bump version to v5.4.0 2026-10-17 09:43:50 +08:00
seteiro 338eb83718 [bsp][esp32-c6] address review: chunk SPI xfers to 64B limit, BSP-owned gdma.c, early width check 2026-10-16 11:31:50 +08:00
seteiro 1f747c967c [bsp][esp32-c6] drop the null SPI configure call
cppcheck follows spi_configure(NULL, NULL) into a dereference. clang-format also wants the macro backslashes left-aligned and a single space around the enum equals.
2026-10-16 11:31:50 +08:00
seteiro 95cb4c26e0 [bsp][esp32-c6] compile SPI when it is selected
Selecting BSP_USING_SPI on C6 links the IDF SPI master. The default image still leaves SPI off, and the peripheral table stays unsupported.
2026-10-16 11:31:50 +08:00
Huoyanlifusu 5d1fb66d13 [drivers][ofw] Fix phandle hash buffer overflow 2026-10-15 13:50:46 +08:00
OnlyoutzZ 40a302d554 [bsp][n32] n32hxxx: add the H47x_48x/H49x timer support and cover the BSP with ci-attach
The N32H47x_48x and N32H49x series share drv_tim.c with N32H7xx, but only the
H7xx branch was ever implemented, so clock timer, LPTIM, PWM and pulse encoder
built to nothing on n32h487zgl7-evb and n32h497zgl7-evb.  This adds those
branches and gives all three boards a ci-attach entry set that actually
compiles what the drivers claim to support.

Drivers

  - drv_tim.c gains the H47x_48x/H49x clock-source and clock-enable branches,
    the ATIM/GTIM/BTIM instance tables and n32_tim_clock_freq_get(), which
    reads the real PCLK/HCLK/SYSCLK back from RCC rather than assuming one.
    ATIMCLKSEL is inverted between the two families and is handled as such.
  - drv_lptim.c derives its tick from the real LSI value instead of a
    hard-coded one, unlocks the backup domain before touching RCC, latches
    the prescaler, and returns -RT_EINVAL rather than clamping a bad rate.
  - drv_pwm.c and drv_pulse_encoder.c are extended to the H47x_48x/H49x
    instances; the H7xx encoder's update event is cleared through
    TIM_EnableUpdateEvt() because that family has no TIM_ConfigUpdateEvt().
  - config/{h47x_48x,h49x}/{tim,pwm,pulse_encoder,lptim}_config.h are new and
    enumerate the instances each series has, for the existing drivers to read.

Kconfig

Each board defines the timer menus in its own board/Kconfig, so that a
board's peripheral options live with the board and the shared driver
Kconfig stays series-neutral; libraries/N32_Drivers/drivers/Kconfig is
byte-identical to upstream/master.  All three copies enforce the mutual
exclusion drv_pulse_encoder.c documents (a timer instance enabled for both
clock timer and pulse encoder collides at link time on the shared ISR
symbol); N32H7xx's menus had none at all and are brought in line.

ci-attach

51 entries across the three boards (17/16/18).  h487 carries three NAND
entries - peripheral.nand, peripheral.nand_16b and peripheral.nand_large -
and h497 and h760 carry one each.  peripheral.nand_large exists because
drv_nand.c picks the row-address cycle count from pages_per_block *
block_count: 2 cycles up to 65536 pages, 3 up to 16777216, else 4.  Every
other NAND entry takes the Kconfig default 64 * 1024 = 65536, which lands
exactly on the first boundary, so the >= 3 and >= 4 arms were compiled by
nothing at all - it takes a geometry past the 24-bit row width to reach the
top rung.  The entry pins that geometry to arm them; it is not a claim about
the part on the board.

Fixes carried in the same series

  - drv_nand.c emitted its third row-address byte under `== 3`, so a 4-cycle
    part would set the count to 4 and then match no emitter, dropping the
    high row-address bytes outright.  The three guards are now >= 3 with the
    >= 4 byte added.  row_addr is uint32_t at all three sites.
  - timer_ctrl() wrote the prescaler straight to a 16-bit PSC field.
    TIM_ConfigPrescaler() neither masks nor validates, so any freq below
    timer_clock/65537 was truncated and the timer ran at an unrelated rate
    while timer->freq still recorded the requested one.  That window is
    reachable: both boards clock timers at 240 MHz, so the honest floor is
    ~3662 Hz while tim_config.h sets minfreq = 3000 and only [minfreq,
    maxfreq] is checked - 3000 Hz lands in PSC as 14463, about 16.6 kHz.
    Division by zero and any prescaler above 0xFFFF now return -RT_EINVAL.
    The H7xx branch had the identical truncation, so the same two guards
    are applied there too.
  - n32_tim_enable_clock() closed each new branch with RT_ASSERT(RT_TRUE).
    With RT_DEBUGING_ASSERT on, RT_ASSERT() expands to `if (!(EX))
    rt_assert_handler(...)`, so that guard could never fire: a timer
    matching none of the branch's instances enabled no clock at all and
    the caller went on to touch an unclocked peripheral's registers.  All
    three branches are now RT_FALSE.  The H7xx guard cannot fire today -
    every instance its config header can hand out is already in that
    branch's ladder - so fixing it arms the guard against a future
    instance added to the table but not the ladder, rather than changing
    any existing configuration.
  - h497's sdram entry asked for BSP_SDRAM_SIZE=32 while sdram_port.h
    documents the part as 8 MB and board/Kconfig declares `range 8 256` with
    `default 8`; the 32 came from h760, whose own default happens to be 32.
  - drv_hard_i2c.c had no init path at all for H47x_48x/H49x, leaving those
    series with an unconfigured controller; the SCL rate now travels in the
    config struct instead of being assumed.
  - drv_qspi.c and drv_spi.c indexed buffers longer than 65535 bytes with
    16-bit counters, which wraps at exactly 65536.
  - n32eth_cfg.h is added because the H7xx and H49x SDKs' eth.h include it
    but no package in the tree ships it.  It probes for the series headers
    because the SDK includes it before rtconfig.h can define SOC_SERIES_*,
    with a part-macro fallback for ARM Compiler 5, which has no
    __has_include() and is what every Keil project in this BSP uses.
  - n32h487zgl7-evb now builds with its real 8 MHz crystal; left at the
    header's 16 MHz default, RCC_GetClocksFreqValue() reports every clock at
    twice its value and the timer prescalers come out twice too large.
  - n32h760zil7-stb's timer menus had no mutual exclusion at all, so a timer
    instance could be enabled as both a clock timer and a pulse encoder; 24
    ISR symbols are defined by both drivers under those two guards, so only
    the linker would have caught it.  Its 14 PWM menus and its 14 encoder
    entries now carry the same guard as the two new boards', using the
    PWMn == PULSE_ENCODERN == instance n mapping that config/h7xx's
    pulse_encoder_config.h establishes.  On the PWM side that guard is a
    resource guard, not a link one: drv_pwm.c defines no ISRs.
  - the same board's LPTIM menu selected RT_USING_LPTIMER, which is not
    declared anywhere in the tree.  A select of an undeclared symbol is an
    implicit symbol and raises no diagnostic, so the line had never done
    anything; it is dropped, as the two new menus already do.  Three stm32
    boards still carry it and are left alone.

The H49x LPTIM EXTI lines needed the user manual rather than the SDK to
settle, and the manual sides with the driver: N32H49x maps EXTI line 21 to
the LPTIM1 wakeup event and line 22 to LPTIM2, which is what
n32_lptim_get_exti_line() returns.  The headers disagree only because
n32h49x_exti.h's EXTI_LINE16..24 block is a verbatim copy of
n32h47x_48x_exti.h's - that one carries on past line 24 and names 25/26 as
the LPTIM events with 21/22 as COMP1/COMP4 - while the H49x series has no
comparator in its SDK at all, so its copy of that text is stale.  The
driver states the reasoning in a comment rather than the bare value.

The H49x timer clock-source bits needed the user manual rather than the SDK
to settle.  For GTIM8/9/10 (RCC_CFG2 bit 27) h49x names the cleared case
RCC_GTIM_CLKSRC_SYSCLKDIV where h47x_48x names it RCC_GTIM_CLKSRC_PCLK, and
the manual sides with the driver's arithmetic: bit 27 selects SYSCLK, or
SYSCLK/(APB2 prescaler / 2) when that prescaler is engaged - the same rule
the driver writes from the HCLK side as PCLK2 doubled whenever PCLK2 is
below HCLK.  Both boards hold AHBPRES at RCC_SYSCLK_DIV1, so HCLK and SYSCLK
are the same 240 MHz and either spelling gives the same number.  The driver
tests the raw bit and not either family's constant, so the naming difference
never reaches the code.  The same chapter confirms bit 28's inversion, which
the ATIM branches already follow.

Verified: all three boards build from scratch under --strict (gcc -Werror)
with zero diagnostics; all 51 ci-attach entries build clean; the three
series were rebuilt after the assert fix, each through the --attach path
that compiles its branch (devices.timer on all three boards - h760's
default leaves BSP_USING_CLOCK_TIMER off, so drv_tim.c is not compiled by
it at all), rebuilt again after the Kconfig guards, whose
effect was checked by loading the tree with kconfiglib and confirming that
clock-timer ATIM1 with pulse encoder1 goes from satisfiable to unsatisfiable
while a non-colliding pair is left alone); the NAND row-address arms were
confirmed compiled by injecting #error markers and rebuilding through the
real --attach path; each board's committed .config and rtconfig.h reproduce
byte-for-byte from a fresh defconfig; and the CI clang-format gate reports
0 files / 0 lines.
2026-10-15 13:32:50 +08:00
rcitach 3f0c11116c [wlan] synchronize AP lifecycle and direct RX handling 2026-10-15 13:28:57 +08:00
rcitach efc5a9df82 [lwip] configure buffer options and preserve PBUF tailroom 2026-10-15 13:28:57 +08:00
rcitach 1e24039cf8 [DHCP] Optimize the DHCP startup logic 2026-10-15 13:28:57 +08:00
ymj0440 20881ec571 fix(netdev): correct ping delay logic for last packet and avoid rt_thread_delay(0)
The 'index == times' condition in the delay_tick calculation is never true,
so the delay was still applied after the last ping, contrary to the comment.
Skip the delay on the final ping by checking 'index != times - 1'.

Also only call rt_thread_delay() when delay_tick > 0, since passing 0
returns -RT_EINVAL.
2026-10-15 09:10:50 +08:00
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