Commit graph

61854 commits

Author SHA1 Message Date
Tiago Medicci Serrano
d649732877 arch/risc-v: Fix Espressif timer registering ID
Fix Espressif timer registering ID. Espressif's general purpose
timers are grouped in different Timer Groups, which may contain
more than one general purpose timer. The current implementation is
related to the timer groups (timer0 refers to Timer Group 0, for
instance), but previous registering method was referring to the
timer inside each group, which caused it to fail when more than
one timer group was being selected because only the first timer
on each group is being actually registered.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2026-05-22 19:38:44 -04:00
Tiago Medicci Serrano
4047b9f42b arch/risc-v: Clear BSS section for RISC-V-based Espressif SoCs
Always clear the BSS section before calling `bootloader_init`.
This is necessary because, otherwise, `bootloader_init` may fail
even before `bootloader_clear_bss_section` is called again by that
function.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2026-05-22 12:20:33 -04:00
Eren Terzioglu
c1cc9a4dc7 arch/risc-v/espressif: Fix CMake build issues for new peripheral support
Fix CMake build issues

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-05-22 19:25:56 +08:00
jianglianfang
94733dd17e golfish_gpu_fb: clear fb when initialization
Commit an initial blank frame during goldfish_gpu_fb_register() to
avoid rendering a stale frame from the emulator after reboot.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2026-05-22 17:18:13 +08:00
jianglianfang
a8de4c998c drivers/video: use spinlock to replace critical section for goldfish_fb and vnc
Critical sections only disable interrupts on the local CPU, which
is insufficient for SMP. Replace with per-device spinlocks to
ensure proper mutual exclusion across all cores.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2026-05-22 15:38:50 +08:00
zhangyu117
c858f3cc44 arch/tricore: Add hardware debug breakpoint and watchpoint support.
Implement hardware breakpoint and watchpoint support for TriCore
architecture using the Trigger Event (TREVT) registers. This enables
the standard NuttX debugpoint API (up_debugpoint_add/remove) on TriCore
processors, supporting read/write/execute watchpoints and breakpoints
via the on-chip debug unit.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-05-22 15:38:36 +08:00
Patrick José Pereira
49d7959b96 arch/arm/stm32h5/i2c: Fix warn message about used but not initialized variables
Fix "-Wmaybe-uninitialized" warning messages

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2026-05-22 13:36:54 +08:00
Patrick José Pereira
8df855d2ab arch/arm/stm32h5: Add ethernet hardware checksum
The Ethernet MAC (57.11.4) was already configured in the code,
but it was necessary to configure the Transmit Descriptor (57.10.3)
in read format:
  - Checksum Interface Control for IP, payload and pseudo-header
Add checks for Recceive Descriptor (57.10.4) in read format:
  - Receive Descriptor 1 is valid from Receive Descriptor 3
  - IP checksum was not bypassed
  - IP header checksum error op IP payload checkerror is set

Testing with STM32 Nucleo-144 using iperf, improved transmission from
35 MBits/s to 50MBits/s.

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2026-05-21 23:14:24 -04:00
Peter van der Perk
87d8dd797d arch/arm/imx9: Add SAR ADC support
Add support for the i.MX9 SAR ADC block.

Based on the arm64 version but slightly different init due to SCMI and
different channel mask for i.MX95.

The driver provides initialization, deinitialization, channel-mask
validation, and one-shot reads for the supported ADC channels. It also
handles the ADC clock bring-up, power-up sequence, calibration, and raw
12-bit result extraction from the per-channel data registers.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2026-05-21 23:13:11 -04:00
Filipe Cavalcanti
91cd34a10c boards/xtensa/esp32: increase MM_REGIONS for psram defconfig
Increase MM_REGIONS from 5 to 6 to accomodate latest changes from
initialization refactor.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-05-21 23:12:33 -04:00
Jiri Vlasak
7065266c0c doc/audioutils: Add rtttl-c documentation
Add documentation about rtttl-c, a simple RTTTL parsing library.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-05-21 23:12:05 -04:00
Tiago Medicci Serrano
2c8dc17510 arch/risc-v: Enable setting cache line size for ESP32-P4
Enables setting the cache line size for ESP32-P4 using Kconfig
options.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2026-05-22 10:41:19 +08:00
Lwazi Dube
2b0c59bcf4 drivers/usbhost_hidmouse: fix button detection in touchscreen example
Fix an issue where button presses were missed in the touchscreen
example due to incorrect packet processing.

Previously, the driver waited to accumulate a batch of packets but only
processed the first one, effectively discarding the rest. The driver
now reads and processes packets one at a time to ensure no input
events are lost.

Also fixed typo: usbhost_xythreshold does not exist.

Signed-off-by: Lwazi Dube <lwazeh@gmail.com>
2026-05-22 10:38:25 +08:00
Matteo Golin
a50614512c docs/raspberrypi-4b: Document new SMP configuration
Documents the new SMP configuration.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-22 06:45:10 +08:00
Matteo Golin
4f8b897e37 boards/raspberrypi-4b: Add SMP configuration
Adds SMP support and an `smp` configuration for the RPi4B.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-22 06:45:10 +08:00
hanzhijian
2b670b83ae Documentation: add candump application documentation
Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-05-22 00:43:01 +08:00
hanzhijian
41cd6eb16d Documentation/uorb: Fix command references in uORB docs.
Align the uORB application documentation with the actual command names, source layout, and configuration options in apps/system/uorb.

This updates the page to describe both uorb_listener and uorb_generator, uses the registered NSH command names in usage examples, and documents the listener and generator options to match the current implementation.

It also adds the relevant Kconfig enablement notes so the documented commands are easier to find and use.

Tested with:
- make html SPHINXOPTS="-W" -j

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-05-22 00:42:48 +08:00
zhangyu117
02833038fd arch/tricore: Full implementation of setjmp and longjmp.
1. The original method of restoring the register context relies on
   the ret instruction, which does not conform to the semantics of
   longjmp not returning.
2. There are csa leak during longjmp and need recycle.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-05-22 00:38:02 +08:00
zhangyuan29
e087d0f79d arch/tricore: Support setjmp and longjmp.
Add setjmp/longjmp support for TriCore architecture using iLLD
intrinsics to save and restore the CSA (Context Save Area) chain.

This implementation saves upper/lower context registers and walks
the CSA linked list to restore the full call context on longjmp.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-05-22 00:38:02 +08:00
hanzhijian
fd907e6ef4 sim: pass no-pie through gcc driver
Pass -no-pie through the gcc driver instead of forwarding it as -Wl,-no-pie.

On Ubuntu 20 with GCC 9, sim:nsh failed during the final link step with /usr/bin/ld: cannot find -lgcc_s.

This change fixes the link failure in that environment.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-05-21 10:53:00 -03:00
Eren Terzioglu
50352c5b75 Docs/platforms/risc-v: Add Analog Comparator docs for esp32[-h2|-p4]
Add Analog Comparator docs for esp32h2 and esp32p4

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-05-21 09:38:58 -04:00
Eren Terzioglu
2769b27efd boards/risc-v/espressif: Add Analog Comparator board support for esp32[-h2|-p4]
Add Analog Comparator board support for esp32p4 and esp32h2

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-05-21 09:38:58 -04:00
Eren Terzioglu
df27531c09 arch/risc-v/espressif: Add Analog Comparator for esp32[-h2|-p4]
Add analog comparator support for esp32p4 and esp32h2

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-05-21 09:38:58 -04:00
Peter Barada
2230d32595 Documentation/nucleo-h753zi: Add board image
Add missing NUCLEO-H753ZI board image.

Signed-off-by: Peter Barada <peter.barada@gmail.com>
2026-05-21 08:56:24 +02:00
Peter Barada
1840cbe63d Documentation/nucleo-h753zi: Fix typo in test log
Fix typo in string written to SD card; its "This", not "Thos".

Signed-off-by: Peter Barada <peter.barada@gmail.com>
2026-05-21 08:56:24 +02:00
Peter Barada
fc2f6c9fc5 boards/arm/stm32h7: Add support fpr nucleo-h753zi board
Add BSP for the NUCLEO-H753ZI board using nucleo-h743zi2 as base.

Signed-off-by: Peter Barada <peter.barada@gmail.com>
2026-05-21 08:56:24 +02:00
hanzhijian
ad182bcb4b sim: resolve host symbols eagerly on Linux
Resolve PLT entries at load time on Linux hosts so early host calls do not enter the lazy binder with simulated interrupts masked.

On Ubuntu 20 with GCC 9, the sim:nsh binary linked successfully after the -no-pie fix but crashed very early at runtime inside _dl_fixup / _dl_runtime_resolve_xsavec when up_irq_save() triggered a first-time PLT resolution.

Setting LD_BIND_NOW=1 avoided the crash and allowed NSH to start, which showed lazy binding was the trigger.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-05-21 08:55:39 +02:00
liwenxiang1
bb27808631 arch/tricore: Improve up_backtrace implementation
1. Make tricore_backtrace.c conditional on CONFIG_SCHED_BACKTRACE,
   consistent with RISC-V and ARM architectures.
2. Add NULL return address check to terminate early on invalid entries.
3. Fix non-current task backtrace to use regs[REG_LPCXI] which
   preserves the UL bit needed for correct CSA type identification.

Signed-off-by: liwenxiang1 <liwenxiang1@xiaomi.com>
2026-05-21 11:38:31 +08:00
zhangyu117
356f7c7b47 arch/tricore: Fix up_fpucmp to compare correct CSA region.
up_fpucmp was comparing lower CSA registers (offset 0) using upper CSA
register definitions (REG_D8-D15). Since up_saveusercontext stores:
  - Lower CSA at saveregs[0..15]
  - Upper CSA at saveregs[16..31]

The fix adds TC_CONTEXT_REGS offset to point to the upper CSA and
compares only D8-D15 which are the FPU data registers on TriCore.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-05-21 11:34:14 +08:00
zhangyu117
4e648c1693 tricore/fpu: Support tricore fpucmp for float.
Implement up_fpucmp to compare FPU register state between two
saved contexts. This is used by the ostest FPU test to verify
that FPU registers are properly preserved across context switches.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-05-21 11:34:14 +08:00
zhangyuan29
51ebb21474 tricore: Add fpu init to open FZ trap.
Initialize the FPU and enable the FZ (flush-to-zero) trap for
TriCore TC4xx processors. This ensures floating-point divide-by-zero
exceptions are properly caught and reported via the trap handler.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-05-21 11:34:14 +08:00
raiden00pl
980b7b1e27 arch/stm32f0l0g0/stm32_pwm.h: restore mapping for STM32F0L0G0_PWM_MULTICHAN=n
restore mapping for CONFIG_STM32F0L0G0_PWM_MULTICHAN=n.

It should not be removed in 4df80e1928

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-21 06:30:36 +08:00
zhangyu117
a4e9584715 arch/tricore: optimize perf counter conversion with fast integer division
for tc3xx, without div64 hw inst:
gcc toolchain software way: 684ns
tasking toolchain software way: 3516ns.
invdiv_u64: 182ns

for tc4xx, with div64 hw inst:
div64 hw inst cost 182ns.
invdiv_u64: 125ns

Although there is a delay of tens of nanoseconds for tc4xx, the impact
on performance is minimal, but for simplicity, invdiv_u64 is used.

Signed-off-by: zhangyu117 <zhangyu117@xiaomi.com>
2026-05-21 06:29:18 +08:00
zhangyuan29
4f98bb32ae arch/tricore: add up_perf function for tricore
Add performance counter support for TriCore architecture using the
CPU clock counter (CCNT). Implements up_perf_init, up_perf_getfreq,
up_perf_gettime and up_perf_convert interfaces.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
2026-05-21 06:29:18 +08:00
Bowen Wang
426a5154d9 drivers/rptun: guard nxsched_waitpid with CONFIG_SCHED_WAITPID
nxsched_waitpid is only available when CONFIG_SCHED_WAITPID is
enabled. Wrap the call with #ifdef to fix the build error when
this option is disabled.

Signed-off-by: huojianchao <huojianchao@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-05-21 06:28:36 +08:00
Bowen Wang
960bd97bb0 drivers/rpmsg: use NuttX atomic_t API instead of C11 atomics
Replace C11 atomic types and operations with NuttX native atomic
interfaces (atomic_t, atomic_set, atomic_fetch_and_acquire,
atomic_fetch_or_acquire) to avoid build failures on toolchains
that lack full C11 atomics support.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2026-05-21 06:28:36 +08:00
Carlos Sanchez
ee57ca0800 drivers/mtd/mx25rxx.c: add support for MX25L12873G
MX25L12873G is a SPI memory very similar to MX25L25673G,
but 128Mbit, which means it does not use 4-byte addresses.

Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2026-05-20 14:50:18 -03:00
dependabot[bot]
f657ea6031 build(deps): bump idna from 3.11 to 3.15 in /Documentation
Bumps [idna](https://github.com/kjd/idna) from 3.11 to 3.15.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](https://github.com/kjd/idna/compare/v3.11...v3.15)

---
updated-dependencies:
- dependency-name: idna
  dependency-version: '3.15'
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-20 13:13:59 -04:00
raiden00pl
4ee59f6b68 arch/stm32f0l0g0/stm32c0_rcc.h: fix TIM bits
fix wrong bits for TIM14-TIM17

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-20 13:13:01 -04:00
raiden00pl
4484f16efc boards/nucleo-c0XXX: add PWM support
add PWM support for nucleo-c071rb and nucleo-c092rc

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-20 13:13:01 -04:00
Filipe Cavalcanti
ec9a849e15 tools: add build path support on host_info tool
Adds a build_path argument for when CMake builds are used.
This solves a problem when building the nxdiag tool with CMake.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-05-20 13:12:38 -04:00
panzihao
191e250cc3 arch/tricore: Suspend stm when CPU stops
Fix break point cause suspend stm still running cause timer paused.

Signed-off-by: panzihao <panzihao@xiaomi.com>
2026-05-20 21:25:28 +08:00
Peter van der Perk
52ae08196d Docs/platforms/imxrt: Update chip support table.
Include i.MXRT1170 as supported chip and add newer unsupported chips.
Also updated the cache chapter to reflect current state of driver and
support.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2026-05-20 17:34:30 +08:00
Alin Jerpelea
fee3c3d3aa AUTHORS: add Eren Terzioglu
Eren Terzioglu has submitted the ICLA and should be added to
the AUTHORS file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-05-20 15:17:00 +08:00
Filipe Cavalcanti
5053734b50 arch/risc-v/espressif: Fix CMake irq.h header ordering race
Ensure esp-hal copied headers are generated during nuttx_context so parallel CMake builds cannot compile sources before arch/chip/irq.h exists.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-05-20 09:35:45 +08:00
donghaokun
f401467a94 arch/tricore: add TriCore up_backtrace() support
Implement up_backtrace() for TriCore by walking the CSA chain and
collecting return addresses from upper CSA A11 register.

Signed-off-by: LukeKun <donghaokun@lixiang.com>
2026-05-20 09:20:33 +08:00
Shoji Tokunaga
131cc703c5 git: Specify multiple build directories in .gitignore.
Change to allow ignoring multiple build directories.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-05-20 03:06:58 +08:00
Lwazi Dube
81dc339415 arch/arm: fix infinite loop in test and clean cache operations
Update the destination register to r15 (PC) for test and clean
operations, as specified by the ARM926EJ-S Technical Reference
Manual (TRM). Using the wrong destination register prevented the
loop condition from updating correctly, resulting in an infinite
loop.

Signed-off-by: Lwazi Dube <lwazeh@gmail.com>
2026-05-19 19:49:55 +08:00
Shoji Tokunaga
5349a5ab0c arch/sim: replace macOS C++ constructor runtime hack with post-link patch
- Invoke `codesign` and after lief rewrites the binary, so the modified
   Mach-O remains loadable on macOS.
- Run the patch script via a dedicated `sim_patch_macho_initsection`
  custom target attached to `nuttx_post`, instead of a POST_BUILD
  command on the `nuttx` target.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-05-19 07:08:55 -03:00
Xiang Xiao
754dfd980b arch/sim: replace macOS C++ constructor runtime hack with post-link patch
The sim architecture needs to defer C++ global constructors until after
NuttX kernel initialization completes. On macOS this was previously done
via a runtime hack (sim_macho_init.c): a __attribute__((constructor))
function intercepted constructors, saved them, and replayed them later.
That approach was fragile because it depended on constructor ordering
and required mprotect() to patch the read-only __mod_init_func section
at runtime.

This commit replaces the runtime hack with a post-link patching scheme:

  1. Link with -Wl,-ld_classic,-no_fixup_chains to keep the classic
     __mod_init_func pointer format (prevents ld64 from converting it
     to __init_offsets).
  2. Post-link, run patch_macho_initsection.py (python3 + lief) to
     patch Mach-O section type flags from
     MOD_INIT_FUNC_POINTERS/INIT_FUNC_OFFSETS to REGULAR, so dyld
     skips them entirely.
  3. Use the Mach-O auto-generated boundary symbols
     section$start$__DATA_CONST$__mod_init_func /
     section$end$__DATA_CONST$__mod_init_func, mapped via __asm()
     labels in arch/sim/include/arch.h to the common _sinit[]/_einit[]
     names used by lib_cxx_initialize().

Linux behavior is unchanged.

Changes:
  - arch/sim/include/arch.h: add macOS __asm() declarations for
    _sinit/_einit
  - arch/sim/src/Makefile: drop sim_macho_init.c HEADSRC handling,
    always pass -ld_classic,-no_fixup_chains on macOS, run
    patch_macho_initsection.py after link when CONFIG_HAVE_CXXINITIALIZE
  - arch/sim/src/sim/CMakeLists.txt: same for the CMake build
  - arch/sim/src/patch_macho_initsection.py: new lief-based patcher
  - arch/sim/src/sim/posix/sim_macho_init.c: deleted (135-line hack)
  - libs/libc/misc/lib_cxx_initialize.c: remove
    macho_call_saved_init_funcs special case; single unified loop

Testing:
  - macOS (Ventura VM): verified lief patching with standalone test
    (test_sinit7) confirming the constructor is deferred past main()
    and only invoked when explicitly called via the _sinit/_einit loop.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-19 07:08:55 -03:00