Commit graph

59698 commits

Author SHA1 Message Date
Zhe Weng
2b34bcfcb1 netdev/ioctl: Add support for simple VLAN ioctl
Supporting ADD_VLAN_CMD and DEL_VLAN_CMD of SIOCSIFVLAN
Ref: https://github.com/torvalds/linux/blob/v6.12/net/8021q/vlan.c#L621

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-12-09 07:56:20 -03:00
Zhe Weng
242c253178 net: Add VLAN device support
Inspired by Linux's way, we also create VLAN devices for managing VLAN,
which will become interfaces like `eth0.58`.

QinQ is also supported, we can create VLAN devices above another VLAN
devices, like `eth0.100.101` (or even `eth0.1.2.3.4`, also supported on
Linux).

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-12-09 07:56:20 -03:00
Zhe Weng
750fae4cca netdev/lower: Support share quota between devices
To prepare for VLAN device support, a VLAN device will share quota with
its real device.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-12-09 07:56:20 -03:00
daichuan
afc210667d netdev_upperhalf.c: modify for maybe use after free with upper pointer
avoid continuing to access the released memory after the netdev_register
error occurs.

Signed-off-by: daichuan <daichuan@xiaomi.com>
2025-12-09 07:56:20 -03:00
Zhe Weng
b2db3a6430 net/netdev: Add netdev_iob_replace_l2 for netdev to avoid misuse
And fix wrong `d_len` for IOBs from `upper->txq` in TX.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2025-12-09 07:56:20 -03:00
Petro Karashchenko
3c0309e0ed arch/arm/samv7: optimize MCUboot loader configuration
Disable configuration options that are not needed for MCUboot loader
 - Disable floating point and long long support in libc
 - Disable libm
 - Disable POSIX features: environment variables, message queues, timers
   and pthreads
 - Disable RAMTEST app to save code space

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2025-12-09 18:04:01 +08:00
Petro Karashchenko
535b08514d cxx/cstddef: expose 'max_align_t'
expose 'max_align_t'

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2025-12-09 18:03:10 +08:00
Petro Karashchenko
9c38276249 cxx/cmath: expose 'nextafter'
expose 'nextafter'

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2025-12-09 18:03:10 +08:00
Petro Karashchenko
8c3106e2a4 libs/libm: fix typo in Kconfig
fix typo in Kconfig

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2025-12-09 18:03:10 +08:00
zhanghongyu
521e319aa3 drivers/net: replace critical_section with spinlock
so as to better support multi-core scenarios

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-09 14:43:59 +08:00
wangchen
fe822145a3 tun:modify issue of repeatly tun_close failed
after the network card is turned off, read and write operations need
to return -ENETDOWN, and it is necessary to wake up the waiting read
and write operations.

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2025-12-09 14:43:59 +08:00
zhanghongyu
d02ac985dc wireless/ieee802154/: remove the use of critical_section
so as to better support multi-core scenarios

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-09 14:43:59 +08:00
zhanghongyu
9dab103fa0 net: replace critical_section with spin lock
so as to better support multi-core scenarios

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-09 14:43:59 +08:00
xiezhanpeng3
fc0647491b arch/armv8-r: use -mfpu=fpv5-sp-d16 for SP-only Cortex-R52 targets
The specific Cortex-R52 implementation could be configured with
a Single-Precision-only FPU (SP-only) and no Neon unit.
Executing double-precision instructions (e.g., `vadd.f64`) triggers
an Undefined Instruction exception.

The standard `-mfpu=fp-armv8` implicitly enables double-precision,
which is unsafe for this hardware.

`-mfpu=fpv5-sp-d16` is selected as the closest architectural match.
  - It enforces Single Precision code generation (preventing crashes).
  - It enables VFPv4/FPv5 features like FMA (Fused Multiply-Add) supported by the CR52 FPU.
  - It restricts the register set to d0-d15, matching the hardware constraints.

This ensures the compiler utilizes hardware FPU and FMA acceleration
without emitting illegal double-precision instructions.

Signed-off-by: xiezhanpeng3 <xiezhanpeng3@lixiang.com>
2025-12-08 21:09:05 +08:00
Alan Carvalho de Assis
a51e45d5b3 drivers/lpwan: Fix Kconfig SX1276 and SX1262 position
When user was selecting SX1276 the configuration options to this
device was appear below SX1262.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-12-08 10:39:11 +08:00
zhanghongyu
e87082b195 net/utils/net_bufpool: add lock to struct net_bufpool_s and bufpool_navail
Add a lock to net_bufpool to simplify the protocol stack code.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-07 11:11:21 +08:00
kywwilson11
2c0e105cad arch/arm/stm32h5: Add RS-485 support to serial driver
Initial commit for adding rs-485 support to serial driver. More is needed as well as testing.

Style fixes.

Added unconfigure functionality.

Added Unconfigure configs to CONFIG.

More style fixes.

Changed depend spacing from 4 spaces to tab.

Fixed priv types, changed serialin to getreg.

Do not unconfigure tx/rx/dir pins by default.

Signed-off-by: kywwilson11 <kwilson@2g-eng.com>
2025-12-06 11:35:53 -03:00
zhanghongyu
f5741c0ea1 net/netdev/netdev_register.c: skip mld_devinit if Nic can not support mld
avoid unnecessary operations

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-06 18:13:26 +08:00
zhanghongyu
f7526522a1 icmp/icmpv6: fix the level parameter type
use a more standard definition

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-06 17:55:40 +08:00
zhanghongyu
d697f1c4f6 icmp/icmp6: fix errno forgot to add a negative sign
otherwise, errors cannot be returned correctly

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-06 17:55:40 +08:00
zhanghongyu
1bf71795fc select: fix too small timeout will be counted as 0
avoiding timeouts less than 1ms may lead to busyloop

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-12-06 17:46:20 +08:00
Søren Friis
1569621149 cmake: Add support for ccache.
Enable ccache in CMake if CONFIG_CCACHE is set

Signed-off-by: Søren Friis <sfriis@gmail.com>
2025-12-05 11:46:30 +01:00
simbit18
c47911ffa1 boards/arm/stm32l4: CMake added boards Part1
CMake added boards:

  - b-l475e-iot01a

 -  nucleo-l432kc

 -  nucleo-l452re

 -  nucleo-l496zg

 -  steval-stlcs01v1

 - stm32l476-mdk

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-04 17:51:44 -03:00
donghaokun
839468f52d docs/sched/sched: Add documentation for different sleep interfaces
As pull request apache#17200 & apache#17368 introduced support for scheduling sleep, a documentation is needed for different sleep interfaces.
This patch adds the description for sleep interfaces currently provided in NuttX, including Scheduled sleep(nxsched_sleep()...), Signal-scheduled sleep(nxsig_sleep()...), and Busy sleep(up_udelay()).

Signed-off-by: Haokun Dong <donghaokun@lixiang.com>
2025-12-04 18:59:58 +01:00
Michal Lenc
58be428e37 arch/arm/src/samv7/Kconfig: allow 0 in MCANx_RXFIFOx_SIZE
Zero can be used to disable the FIFO queue. Fix the range to allow
to configure this value.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-12-04 16:32:39 +01:00
simbit18
424aa6be0f workflows/build.yml: fix fatal: write error: No space left on device
Fixed error verified in this PR https://github.com/apache/nuttx/pull/17423

added to the workflow:

- Show Disk Space

- Free Disk Space (Ubuntu)
  Only Android runtime removed

- Post-build Disk Space

We can now monitor disk space.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-04 22:07:05 +08:00
Mathias Duckeck
21b9b919cc arch/arm/samv7: allow all values for count in read
The parameter count of read had to be a multiple of 4, otherwise the
result was truncated. Now all values are possible.

Signed-off-by: Mathias Duckeck <mathias.duckeck@avat.de>
2025-12-03 22:05:53 +08:00
Antoine Juckler
4863564d48 drivers/eeprom: Support PE/SE/CE commands
Add support for the page erase (PE), sector erase (SE) and chip erase
(CE) dedicated commands on supported devices.
They can be triggered using the corresponding IOCTL commands
EEPIOC_PAGEERASE, EEPIOC_SECTORERASE and
EEPIOC_CHIPERASE.

On unsupported devices, this is equivalent to writing a full page,
sector, or the entire EEPROM to 0xFF.

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-12-03 22:05:44 +08:00
Michal Lenc
bf391cc2bc drivers/lcd/st7789.c: fix byte order in st7789_fill for 3 wires
The bytes of color should be sent in an opposite order in st7789_fill
function if the driver operates in 3 wire mode.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-12-03 14:36:46 +01:00
Alin Jerpelea
0522e15e1b AUTHORS: add Michal Lenc
Michal Lenc has submitted the ICLA and should be added to
the AUTHORS file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-12-03 08:46:33 -03:00
adriendesp
ec04ef9ccf arch/arm/xmc4 : various fixes and clean
- Fix EtherCAT signals drive strengh (from errata PORTS_CM.H002), caused bus faults.
- Changed xmc4_ecat.c for compile time pin definition.
- Fixed xmc4_ecat.c register not written (reset value already used).
- Removed EXTCLK for xmc4800 as pin is used for ECAT.
- Clean xmc4 familly board.h and clocks config.

Signed-off-by: adriendesp <adrien.desproges@gmail.com>
2025-12-03 13:47:34 +08:00
Filipe Cavalcanti
2b39147fe2 documentation: update ESP32-C3 board names for legacy and new devkit
Updates the docs to the new esp32c3-devkit naming, after deprecating support
for now esp32c3-legacy.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-03 13:45:13 +08:00
Filipe Cavalcanti
1218ecfd88 boards/risc-v/esp32c3: deprecate esp32c3 boards based on esp32c3-legacy arch
This change makes the esp32c3-generic the main esp32c3 supported board: esp32c3-devkit.
The now esp32c3-legacy is pure register based and not maintained anymore.
Now, esp32c3-devkit shares the same driver implementation as ESP32-C6 and ESP32-H2.

- esp32c3-devkit  -> esp32c3-legacy
- esp32c3-generic -> esp32c3-devkit

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-03 13:45:13 +08:00
Filipe Cavalcanti
6ccc5847fb arch/risc-v/esp32c3: rename ESP32-C3 Generic configs
- ARCH_CHIP_ESP32C3_LEGACY created
- ARCH_CHIP_ESP32C3_GENERIC is now ARCH_CHIP_ESP32C3

This is part of deprecating esp32c3-devkit as esp32c3-legacy and
using esp32c3-generic (now esp32c3-devkit) instead.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-03 13:45:13 +08:00
Filipe Cavalcanti
ea1d59e89c boards/risc-v/esp32c6: add capture example to capture defconfig
Add missing PWM capture example from the capture defconfig of
esp32c3-devkitc.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-03 13:44:25 +08:00
Filipe Cavalcanti
0158eda813 arch/risc-v/espressif: add PWM capture getedges function
Create esp_capture_getedges function which was missing from
the capture API.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-03 13:44:25 +08:00
Filipe Cavalcanti
027bc43df7 arch/xtensa/espressif: add PWM capture getedges function
Create esp_capture_getedges function which was missing from
the capture API.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-12-03 13:44:25 +08:00
simbit18
b3caa6717f boards/arm/stm32l4/nucleo-l476rg: CMake fix addition of HTS221 and LSM6DSL
- fix addition of HTS221 and LSM6DSL sensors

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-03 08:36:06 +08:00
simbit18
bb66e96023 arch/arm/src/stm32l4: Removed repeated addition of CONFIG_STM32L4_IWDG
- Removed

   if(CONFIG_STM32L4_IWDG)
      list(APPEND SRCS stm32l4_iwdg.c)
   endif()

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-03 08:36:06 +08:00
wangchengdong
a2773f267e cmake: Improve nuttx_generate_kconfig()
Enhance the nuttx_generate_kconfig() implementation to ensure that
both subdirectories and external directories containing a CMakeLists.txt
or a Kconfig file are properly included during Kconfig generation.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-02 02:45:36 +08:00
simbit18
6f4d610636 boards/arm/kl: CMake build for Freedom-kl25z, Freedom-kl26z and Teensy-lc boards
- CMake added board NXP Freedom-KL25Z

- CMake added board NXP Freedom-KL26Z

- CMake added board PJRC Teensy-LC

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-02 02:42:55 +08:00
simbit18
0af53187b5 arch/arm/src/kl: CMake build implemented for NXP KL Series Arm MCUs
- added NXP KL Series Arm MCUs

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-12-02 02:42:55 +08:00
Eren Terzioglu
f90dcde45e Documentation/xtensa/esp32[-s2]: Add PM docs
Add PM docs for esp32s2

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-12-02 02:37:06 +08:00
Eren Terzioglu
1dcbb7c519 boards/xtensa/esp32[-s2|-s3]: Refactor PM board layer
Refactor PM board layer for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-12-02 02:37:06 +08:00
Eren Terzioglu
6b53141c9e arch/xtensa/esp32[-s2|-s3]: Refactor PM support
Refactor PM modes for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-12-02 02:37:06 +08:00
Jukka Laitinen
5ae35b619a arch/mpfs/mpfs_ddr.c: Improve CA training validity check heuristics
Update the CA training result check to match the HSS reference code.

The original check which required phase delays to be 5 taps separated was wrong.
This has also been removed from the HSS.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-12-02 02:36:55 +08:00
Jukka Laitinen
3560a28eef arch/mpfs/mpfs_ddr.c: Make sure eye doesn't grow past the window end
The window is 32 taps, so in order to the eye to be completely inside the window,
the (offset + width) has to be less or equal than (32 - margin).

Add this additional sanity check in the mpfs_training_verify.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-12-02 02:36:55 +08:00
wangchengdong
930cc984a2 arch/tricore: Fix build errors in Tricore architecture
Fix build errors in the Tricore architecture caused by the missing `lock`
member in `struct tricore_systimer_lowerhalf_s`, as well as the missing
definition of the `IFX_CFG_CPU_CLOCK_FREQUENCY` macro.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-12-02 02:35:59 +08:00
lipengfei28
94fae9133f drivers/pci: fix arm32 build warning
fix arm32 build warning

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-12-01 14:38:02 +01:00
hujun5
9461c70fcd x86_64: fix bootup problem in SMP
We need to initialize the per - CPU registers as early as possible.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2025-12-01 14:28:11 +01:00