Commit graph

8213 commits

Author SHA1 Message Date
Matteo Golin
7ea7d29bfa drivers/audio/i2s: Fix unsigned integers in function signatures
All I2S driver operation functions say in their signature description
that negative errno values are returned on failure. However, some of
these same functions had `uint32_t` return types. This would result in
incorrect comparison of the return value against signed error code
values.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-06 19:57:13 +08:00
Ilikara
071a358f77 drivers: Fix comment typos — 'Pubic' → 'Public' across drivers and headers.
Fix spelling error in section header comments:
  'Pubic Function Prototypes' → 'Public Function Prototypes'
  'Pubic Functions' → 'Public Functions'

Affected files (12 files, 12 occurrences):
  arch/arm/src/at32/at32_tim.c
  arch/arm/src/common/stm32/stm32_tim_m3m4_v1v2v3.c
  arch/arm/src/stm32l4/stm32l4_tim.c
  arch/arm/src/stm32l5/stm32l5_tim.c
  arch/arm/src/stm32u5/stm32_tim.c
  arch/arm/src/stm32wb/stm32wb_tim.c
  arch/arm/src/stm32wl5/stm32wl5_tim.c
  arch/mips/src/pic32mz/pic32mz_timer.c
  arch/sparc/src/bm3803/bm3803_tim.c
  arch/sparc/src/s698pm/s698pm_tim.c
  drivers/video/vnc/vnc_server.c
  include/nuttx/wdog.h

These are all comment-only changes with no functional impact.

Signed-off-by: Ilikara <3435193369@qq.com>
2026-07-04 02:00:24 +08:00
Xiang Xiao
a0357b3a65 !include/fcntl.h: align open flags with Linux values
Align the NuttX open(2) flag constants with the Linux asm-generic
values so that the FUSE wire protocol and other cross-platform
interfaces work without conversion.

All code that used '(flags & O_RDONLY)' as a bitmask check (always 0
now that O_RDONLY=0) has been updated to use '(flags & O_ACCMODE)'
comparisons.

The NUTTX_O_* constants in include/nuttx/fs/hostfs.h are updated to
match, and the sim hostfs open flag mapping is fixed.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-07-03 10:33:47 +08:00
Xiang Xiao
c790612159 include/fcntl.h: remove O_RDOK/O_WROK aliases
O_RDOK and O_WROK are non-standard aliases for O_RDONLY and O_WRONLY
respectively.  Having two names for the same flag creates confusion,
especially when aligning the flag values with Linux.  Remove the
aliases and replace all uses with the standard O_RDONLY/O_WRONLY.

No functional change — O_RDOK was defined as O_RDONLY and O_WROK as
O_WRONLY, so the replacement is a pure text substitution.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-07-03 10:33:47 +08:00
Karel Kočí
2d8b9deb6b float.h: improve long double related definitions
This addresses "FIX ME" definitions for the long double. These might not
be all long double format supported by NuttX.

The support was also added only for GCC alike compilers. Other compilers
that have CONFIG_HAVE_LONG_DOUBLE defined will fail with error that
mantisage digits have to be defined for that compiler.

Signed-off-by: Karel Kočí <kkoci@elektroline.cz>
2026-07-03 10:32:57 +08:00
Sammy Tran
961fd8f7ca drivers/mtd/gd25: add QSPI support
Add QSPI mode to the GD25 MTD driver alongside the existing SPI path.
When CONFIG_GD25_QSPI is selected, sector erase, chip erase, byte read,
page write, and byte write all use the QSPI command/memory interfaces
instead of SPI. Reads use the quad I/O fast-read command (1-4-4) and
writes use the quad page-program command (1-1-4) via QSPIMEM_QUADDATA.
A new Kconfig option enables the QE bit in SR2 at initialisation so the
quad I/O pins are active.

Signed-off-by: Sammy Tran <sammytran@geotab.com>
2026-07-03 10:32:41 +08:00
Sammy Tran
f2a5d1f817 stm32h5/qspi: add QSPIMEM_QUADDATA flag for 1-1-4 transfers
Add QSPIMEM_QUADDATA to the QSPI memory flags. This flag selects quad
data width while keeping the address phase on a single line (1-1-4),
which QSPIMEM_QUADIO cannot express (it forces quad on both address and
data phases). Update stm32_qspi_memory() to honour the new flag by
setting CCR_DMODE_QUAD without touching the address mode.

Signed-off-by: Sammy Tran <sammytran@geotab.com>
2026-07-03 10:32:41 +08:00
Michal Lenc
2c18ee90cd stdbit.h: fix compilation error of generic stdc_ functions
Generic stdc_ functions use _Generic macro, but this requires the type
specific functions stdc_*_uc, stdc_*_ul and so on to be functions,
not just another macro definitions.

This commit fixes the issue by ensuring all type specific functions
are static inline functions, not macro definitions.

There is no change other in the functionality or implementation.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-06-26 19:37:32 +08:00
hanzhijian
b0e8926eb6 drivers/clk: use uintptr_t for register addresses
Change the 'reg' field type from uint32_t to uintptr_t in all clock
provider structs (clk_gate_s, clk_divider_s, clk_phase_s,
clk_fractional_divider_s, clk_multiplier_s, clk_mux_s) and their
corresponding clk_register_*() function prototypes.

Also update clk_write() and clk_read() inline functions to take
uintptr_t parameter and remove the now-redundant (uintptr_t) cast.

On 32-bit embedded platforms uintptr_t equals uint32_t so there is
no functional change. On 64-bit targets (e.g. sim) this fixes
-Wint-to-pointer-cast warnings that GCC15 promotes to errors.

Fixes: #16896
Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-06-23 09:46:33 +08:00
raiden00pl
e5d9e2dd59 !arm/stm32l4: standardize public API/type prefix to stm32_
BREAKING CHANGE: Public STM32L4 interfaces were renamed from stm32l4_* forms to
canonical stm32_* forms across arch and board headers/sources.

Public type names were normalized to stm32_*
equivalents (including timer/lptimer/dma/freerun API-facing types), and
stm32l4can_initialize() was renamed to stm32_caninitialize().

The STM32L4 root family header was renamed from stm32l4.h to stm32.h;
all STM32L4 arch/board includes were updated accordingly.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-23 09:45:36 +08:00
Jukka Laitinen
d4a5db49c2 drivers/mtd: Make compile time check for sane mtd isbad/markbad configuration
This removes the DEBUGASSERT in ftl_initialize_by_path. Instead, check
compile time that FTL is enabled in case some of the drivers implement
the isbad and markbad functions.

Also select the FTL_BBM for those drivers as they require it.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-17 23:14:58 +08:00
Abhishek Mishra
fec3c5bc07 Documentation/sched: Add POSIX user identity transition docs
Adds comprehensive documentation for the POSIX three-tier user identity
model (real, effective, saved-set IDs) enabled by CONFIG_SCHED_USER_IDENTITY.

* Updates sched/Kconfig with detailed help text explaining the config.
* Adds user_identity.rst to formally document credential inheritance
  and the privilege transition rules for setuid(), seteuid(), setgid(),
  and setegid().
* Updates tasks_vs_threads.rst to list credentials as a shared task
  group resource.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-06-17 17:13:57 +08:00
Abhishek Mishra
370d89a012 sched/group: implement POSIX saved-set-UID/GID semantics
Adds tg_suid and tg_sgid fields to task_group_s to complete the
POSIX three-field identity model (real, effective, saved-set).

Updates group_inherit_identity() to propagate the new fields from
parent to child task group on task creation.

Fixes setuid(), setgid(), seteuid(), and setegid() to implement
correct POSIX privilege transition logic:
- Root (euid==0): may set any value; all three IDs updated by setuid/setgid
- Non-root: may only set effective ID to real or saved value; else EPERM

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-06-17 17:13:57 +08:00
Jukka Laitinen
361e7e29ae arch, sched/signal: Fix compilation with ENABLE_PARTIAL_SIGNALS=y
Correct build errors when CONFIG_ENABLE_ALL_SIGNALS is not defined

- sched makefiles: Move pending-signal helpers from the ENABLE_ALL_SIGNALS-only
  list to the !DISABLE_ALL_SIGNALS list so signal dispatch is available in
  PARTIAL builds sched: make SIG_PREALLOC_ACTIONS, SIG_ALLOC_ACTIONS and
  SIG_DEFAULT depend on ENABLE_ALL_SIGNALS
- sched: fix ifdefs around pending-signal queue access and signal-mask for
  PARTIAL/DISABLE modes
- arch: gate SYS_signal_handler / _return calls and SYSCALL_LOOKUP(signal)
  with ENABLE_ALL_SIGNALS

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-17 17:11:26 +08:00
nicolasWDC
2cddf4e638 include/pthread : initialize wait_count in PTHREAD_COND_INITIALIZER
struct pthread_cond_s contains three fields: sem, clockid, and
wait_count. However, PTHREAD_COND_INITIALIZER only initialized the first
two fields, which triggers -Wmissing-field-initializers when a condition
variable is statically initialized.

Initialize wait_count explicitly to zero so the macro matches the structure
definition and remains warning-free with strict compiler flags.

Validated with a minimal compile test using:

pthread_cond_t cond = PTHREAD_COND_INITIALIZER;

Signed-off-by: nicolasWDC <nicolasWDC@users.noreply.github.com>
2026-06-17 17:10:49 +08:00
raiden00pl
5fcc358305 !sensors/bme680: allow sensor configuration during registration
BREAKING CHANGE: bme680_register() takes an additional "*config" argument.
When config is NULL - driver behavior is the same as before.

With this change bme680 can be configured during registration in board logic.
This way we don't have to callibrate sensor from user-space but sensor is ready
to use after registration.

This change makes the registration the same as for bme688, which is a similar
sensor.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-10 20:45:31 +02:00
shichunma
e041bc7cdc include/nuttx/semaphore.h: parenthesize NXSEM helper args
Wrap the NXSEM_COUNT() and NXSEM_MHOLDER() macro arguments in an extra pair of parentheses before member access.

This makes the helpers safer for complex expressions passed as the macro argument and aligns them with common macro style.

Signed-off-by: Jerry Ma <shichunma@bestechnic.com>
2026-06-10 22:39:46 +08:00
Matteo Golin
8a8a5af90d !boards/boardctl: Remove BOARDIOC_INIT
BREAKING CHANGE: Remove BOARDIOC_INIT macro now that the interface is
removed in favour of CONFIG_BOARD_LATE_INITIALIZE.

Quick fix: instead of calling BOARDIOC_INIT from your application,
instead enable late initialization to have it performed automatically
prior to application entry.

If you need custom initialization logic, use the board_final_initialize
function and `BOARDIOC_FINALINIT` command instead.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-26 09:57:29 +08:00
raiden00pl
f1e7b143d9 !drivers: separate pulse count feature from PWM driver
BREAKING CHANGE: separate pulse count feature from PWM driver.

Coupling PWM driver with pulse count feature was bad decision from the beginning,
these are two different things:

- PWM is a modulation scheme: it continuously represents a value by varying duty
cycle, usually at a fixed frequency.
- Pulse train generation is a finite waveform transaction: generate N edges/pulses
with selected timing, then complete.

This change introduce a new pulse count driver with new API.
Now user can generate pulse train by providing:

- high pulse length in ns
- low pulse length in ns
- pulse count

All architectures supporting pulse count have been adapted in subsequent commits.
Users must migrate their code to use the new driver with new API.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-25 14:33:11 +02: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
Xiang Xiao
c47b1e2c5b !sys/types.h: change time_t and clock_t to int64_t to align with other OSes
POSIX leaves the signedness of time_t and clock_t unspecified, but
mainstream implementations (Linux glibc/musl, the BSDs, macOS, RTEMS,
Zephyr's POSIX layer, Windows _time64) expose time_t as signed 64-bit.
NuttX has historically used uint64_t only because it was tied to the
CONFIG_SYSTEM_TIME64 knob; with that gone, switch:

  time_t   : uint64_t  -> int64_t
  clock_t  : uint64_t  -> int64_t
  CLOCK_MAX: UINT64_MAX -> INT64_MAX

This lets (time_t)-1 sentinels, negative tick deltas, and host-side
headers behave as on every other POSIX system without source churn.

Headers updated:
  - include/sys/types.h, include/limits.h, include/nuttx/clock.h
  - include/nuttx/fs/hostfs.h (nuttx_time_t alias)
  - include/nuttx/{mqueue.h,wdog.h,wqueue.h,timers/clkcnt.h}

Because clock_t is now signed 64-bit, the NuttX-internal sclock_t
alias becomes redundant: every sclock_t/SCLOCK_MAX use is folded
back to clock_t/CLOCK_MAX (notably in sched/wdog, sched/mqueue,
sched/sched, sched/clock, sched/timer, libs/libc/time, fs/vfs and
the drivers/arch consumers below).

Tick/period constants (NSEC_PER_SEC, USEC_PER_SEC, MSEC_PER_SEC,
SEC_PER_MIN, ...) in include/nuttx/clock.h are retyped from "long"
literals to INT64_C(...) so that 64-bit arithmetic no longer
depends on the host's long width.

Strip now-redundant (time_t)/(clock_t)/(unsigned long) casts and
unsigned-only branches across the tree:
  - arch RTC / oneshot / tickless lowerhalfs:
      arm: cxd56xx, efm32, imxrt, lc823450, max326xx, sam34, sama5,
           samd5e5, samv7, stm32, stm32f7, stm32h7, stm32l4, stm32wb,
           xmc4
      mips: pic32mz       sparc: bm3803       x86_64: intel64
      risc-v/xtensa: espressif (esp_i2c[_slave], esp_rtc,
           esp32c3{_i2c,_rtc,_wifi_adapter}, esp32{,s2,s3}_*),
           mpfs_perf
  - drivers: audio/tone, input/aw86225, power/pm/{activity,
           stability}_governor, rpmsg/rpmsg_ping,
           timers/{ds3231,mcp794xx,pcf85263,rx8010},
           wireless/ieee80211/bcm43xxx, wireless/spirit/spirit_spi
  - core: fs/vfs/{fs_poll,fs_timerfd}, mm/iob/iob_alloc,
          libs/libc/{netdb/lib_dnscache,time/{lib_calendar2utc,
          lib_time}}, net/icmp/icmp_pmtu, net/icmpv6/icmpv6_pmtu,
          net/ipfrag, net/tcp/{tcp.h,tcp_timer},
          net/utils/net_snoop, net/mld/mld_query (drop the now-dead
          mld_mrc2mrd helper since signed math handles it directly),
          sched/clock/{clock,clock_initialize},
          sched/sched/{sched_profil,sched_setparam,sched_setscheduler},
          sched/pthread/pthread_create,
          sched/wdog/{wd_gettime,wd_start,wdog.h},
          sched/timer/timer_gettime, sched/mqueue/*

Flip the few in-tree printf format strings that assumed an
unsigned 64-bit tv_sec:
  * drivers/rpmsg/rpmsg_ping.c                       PRIu64 -> PRId64
  * arch/xtensa/src/esp32{,s2,s3}/esp32*_oneshot_lowerhalf.c
                                          PRIu32 (already wrong) -> PRId64

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-19 16:21:28 +08:00
Xiang Xiao
c6654b1106 !sched/clock: remove CONFIG_SYSTEM_TIME64 and always use 64-bit time
The 32-bit system clock has a limited range (~497 days) and the
configuration knob is no longer worth the complexity given that
practically every modern target already enables it.  Make 64-bit
time_t/clock_t/sclock_t/nuttx_time_t the only supported flavor.

Specifically:
  - Drop the SYSTEM_TIME64 Kconfig option and its dependent
    PERF_OVERFLOW_CORRECTION/HRTIMER guards in sched/Kconfig.
  - Remove every #ifdef CONFIG_SYSTEM_TIME64 branch in headers
    (include/{sys/types.h,limits.h,inttypes.h,nuttx/clock.h,
    nuttx/fs/hostfs.h}) and core code paths
    (sched/clock/clock.h, drivers/power/pm/pm_procfs.c,
    drivers/rpmsg/rpmsg_ping.c, fs/procfs/fs_procfsuptime.c,
    libs/libc/wqueue/work_usrthread.c,
    arch/avr/src/avrdx/avrdx_timerisr_tickless_alarm.c).
  - Strip CONFIG_SYSTEM_TIME64=y from every board defconfig.
  - Update Documentation/guides/rust.rst accordingly.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-19 16:21:28 +08:00
Xiang Xiao
c32b683085 !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support
Every compiler supported by NuttX provides the "long long" types,
so the CONFIG_HAVE_LONG_LONG indirection is no longer useful.
Remove the option from include/nuttx/compiler.h and treat
"long long" as unconditionally available across the OS.

In addition to deleting the guard itself, this commit unconditionally
enables the long-long flavored helpers that used to be gated behind
it:

  - libs/libc/fixedmath: drop the soft-emulated b32/ub32 routines
    in lib_fixedmath.c (-261 lines) and trim the matching
    prototypes, Make.defs and CMakeLists.txt entries; keep only
    the long-long backed implementations.
  - include/sys/endian.h, include/strings.h, libs/libc/string
    /lib_ffsll.c, lib_flsll.c: always expose the 64-bit byte-swap
    and ffsll/flsll variants.
  - libs/libm/libm/lib_llround{,f,l}.c: drop the empty stubs.
  - libs/libc/stdlib (atoll, llabs, lldiv, strtoll/ull, rand48,
    strtold), libs/libc/stream (libvsprintf, libvscanf,
    libbsprintf, ultoa_invert), libs/libc/misc (crc64, crc64emac),
    libs/libc/inttypes/strtoimax, libs/libc/lzf, libs/libc/libc.csv,
    libs/libc/string (memset, vikmemcpy): remove the
    #ifdef CONFIG_HAVE_LONG_LONG branches.
  - include/{stddef.h,stdlib.h,fixedmath.h,sys/epoll.h,cxx/cstdlib,
    nuttx/audio/audio.h,nuttx/crc64.h,nuttx/lib/math.h,
    nuttx/lib/math32.h,nuttx/lib/stdbit.h}: same guard cleanup.
  - drivers/note/note_driver.c, fs/spiffs/src/spiffs.h,
    sched/irq/irq_procfs.c: drop their local guards as well.
  - Documentation/applications/netutils/ntpclient/index.rst:
    refresh the documentation snippet.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-05-19 16:21:28 +08:00
raiden00pl
4df80e1928 !drivers/pwm: remove PWM_MULTICHAN option
BREAKING CHANGE: remove PWM_MULTICHAN option

PWM_MULTICHAN option is redundant, we can just set CONFIG_PWM_NCHANNELS > 1.
At default CONFIG_PWM_NCHANNELS is set to 1, so the default behavior is preserved.
Access to single channel API is now `info->channels[0].XXX` instead of `info->XXX`

This is the first step to simplify PWM implementation and make it more portable.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-18 11:35:25 -04:00
Jiri Vlasak
3c05605079 kinetis/pit: Update Kconfig, implement oneshot PIT
Implementation of the Kinetis' Periodic Interrupt Timer (PIT). The lower
half driver is oneshot.

Signed-off-by: Jiri Vlasak <jvlasak@elektroline.cz>
2026-05-17 11:47:06 +08:00
wangyongrong
f20f9ff19e sched/group: skip group_release for kernel thread group
When CONFIG_DISABLE_PTHREAD=y, HAVE_GROUP_MEMBERS is undefined and
group_leave() unconditionally calls group_release() for every exiting
thread. This destroys the shared g_kthread_group resources (mutex,
fdlist, task_info) while other kernel threads are still using them,
causing use-after-free crashes.

Fix by checking TCB_FLAG_TTYPE_KERNEL in group_leave() before calling
group_release(), so the entire release path is skipped for kernel
threads. This is safe because g_kthread_group is statically allocated
and its lifetime is the entire system.

Signed-off-by: wangyongrong <wangyongrong@xiaomi.com>
2026-05-08 13:44:51 +08:00
daniellizewski
9b18160893 drivers/usbhost/usbhost_cdcecm.c: Added support for Host CDC-ECM
Added support for USB host to use an USB CDC-ECM device.
This class is used for usb-ethernet adapters as well as many modems.

Signed-off-by: daniellizewski <daniellizewski@geotab.com>
2026-05-06 06:20:03 +08:00
daniellizewski
761c17f1e0 drivers/usbhost/usbhost_enumerate.c: Allow selecting USB configuration
Added support for selecting a different USB configuration.
Certain USB devices offer different classes using different
configurations. This allows a board file to provide a callback
to select the proper configuration for a given USB device.

Signed-off-by: daniellizewski <daniellizewski@geotab.com>
2026-05-06 06:20:03 +08:00
shichunma
3c9a9d683f include/errno.h: skip set_errno in interrupt context
set_errno() should not modify the interrupted task's errno.
Add a check using up_interrupt_context() and skip the assignment
when called from an interrupt handler.

Signed-off-by: Jerry Ma <shichunma@bestechnic.com>
2026-05-03 17:23:40 -03:00
Alan Carvalho de Assis
a1d6016962 drivers/sensors: Add support to MT6816
This commit adds support to MagTek MT6816 sensor

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-05-03 07:56:38 -03:00
Alan Carvalho de Assis
04d5cad64e drivers/spi: Add SPIDEV_MAG_ENCODER() definition
This definition is needed to have multiplese Magnetic Sensors in the
same board.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-05-03 07:56:38 -03:00
Matteo Golin
48db502daf !boards: Remove NSH_ARCHINIT and board_app_initialize
BREAKING: In an effort to simplify NuttX initialization, NSH_ARCHINIT is
removed. board_app_initialize is also removed. BOARD_LATE_INITIALIZE now
performs all board initialization logic, and is by default enabled. All
references to these symbols are removed. BOARDIOC_INIT remains, but will
result in -ENOTTY when called. It is to be removed in a later commit.

Quick fix: Boards relying on NSH_ARCHINIT should now enable
CONFIG_BOARD_LATE_INITIALIZE instead. If the application needs
fine-grained control over board initialization from userspace, the logic
performed by BOARDIOC_INIT may be copied to the board_finalinitialize
function and used instead via BOARDIOC_FINALINIT. All
board_app_initialize logic provided by NuttX is now moved to
board_late_initialize, and the same should be done for out-of-tree
boards.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-05-02 18:36:46 +08:00
raiden00pl
39378e1d46 drivers/sensors: add initial support for fixed-point data for sensors
new sensor framework can now select between float data type and
fixed-point data type

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-05-02 00:56:42 +08:00
Jukka Laitinen
b810cbe4d3 drivers/timers: Add common include files, definitions and upper-half for DSHOT
DShot is a packet based serial protocol, used for controlling motor controllers
(ESCs), typically for drones.

This adds an upper-half driver for dshot protocol, along with common
configuration options and definitions definitions.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-04-30 12:24:47 +08:00
zhanxiaoqi
786b315947 fs/inode: add optional manual FD backtrace control via task group flag
When CONFIG_FS_BACKTRACE is enabled, collecting a stack trace for every
new file descriptor adds overhead to fast path operations like open(),
dup(), and socket().

This patch adds a new configuration option CONFIG_FS_BACKTRACE_DEFAULT.
When enabled (default behavior), the GROUP_FLAG_FD_BACKTRACE flag is
automatically set during group allocation, causing backtrace to be
captured for all tasks globally, preserving the original diagnostic
capability.

When disabled, backtrace capture is zero-cost by default and must be
explicitly enabled per task group using GROUP_FLAG_FD_BACKTRACE.

Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
2026-04-28 09:53:27 +02:00
Alan Carvalho de Assis
90ab0a8ae1 drivers/mpr121: Add support to MPR121 Capacitive Keypad
This driver adds support to MPR121 Capacitive Keypad usually found
at Aliexpress. The MPR121 is a touch sensor chip from Freescale/NXP
that supports up to 12 sensor electrodes and 1 proximity electrode.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-04-23 15:56:32 -03:00
zhanxiaoqi
e2ddb55101 nuttx/nx: compilation error occurs
Enabling CONFIG_NX_HWCURSORIMAGE or CONFIG_NX_SWCURSOR causes a compile error due to a missing semicolon after a structure variable.

Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
2026-04-14 13:35:26 +08:00
zhanxiaoqi
f9fae3ed32 video/fb: fix compilation errors
enabling CONFIG_FB_HWCURSOR and CONFIG_FB_HWCURSORIMAGE causes a compile error: missing semicolon after a structure variable.

Signed-off-by: zhanxiaoqi <zhanxiaoqi@bytedance.com>
2026-04-13 19:55:44 +08:00
Piyush Patle
13d0e64ee6 style: fix checkpatch issues after debug.h move
Fixed copespell errors, for CI sucess!

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-07 07:50:06 -03:00
Piyush Patle
0dccc8ba21 include/debug.h: Move to include/nuttx/debug.h
debug.h is a NuttX-specific, non-POSIX header. Placing it in the
top-level include/ directory creates naming conflicts with external
projects that define their own debug.h.
This commit moves the canonical header to include/nuttx/debug.h,
following the NuttX convention for non-POSIX/non-standard headers,
and updates all in-tree references.

A backward-compatibility shim is left at include/debug.h that
emits a deprecation #warning and re-includes <nuttx/debug.h>,
allowing out-of-tree code to continue building while migrating.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-07 07:50:06 -03:00
Piyush Patle
7b590f9c43 espressif/rmt: replace rmtchar with arch-specific lirc adapter
Replace the ESP-specific rmtchar upper-half with arch-local esp_lirc
adapters for Xtensa and RISC-V.

 This moves the RMT upper-half out of drivers/rmt, registers LIRC
 devices from the ESP board bring-up paths, and removes the old common
 rmtchar driver and headers.

 Also update the ESP Kconfig and build wiring to build esp_lirc when
 ESP_RMT and DRIVERS_RC are enabled.

 Fixes discovered during hardware validation:
  - register TX as /dev/lirc1 so RX and TX do not collide
  - parse the RX worker thread argument from the correct argv slot
  - keep RX devices from advertising TX capability

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-04 11:18:32 -03:00
wangjianyu3
5ba0d062b1 audio: add ES7210 4-ch ADC codec driver
Add ES7210 audio ADC driver for NuttX implementing the audio
lower-half interface. Supports 4-channel recording via I2S with
configurable sample rate, bit depth, and mic gain.

- drivers/audio/es7210.c: Codec driver using LPWORK for async buffer
  management, I2C register access, and NuttX audio buffer management
- drivers/audio/es7210.h: Internal register definitions and macros
- include/nuttx/audio/es7210.h: Public header with platform config
  structure and es7210_initialize() API
- drivers/audio/Kconfig, Make.defs, CMakeLists.txt: Build system
  integration for CONFIG_AUDIO_ES7210

Key implementation details:
- ES7210_SDP_NORMAL (normal I2S) instead of TDM, matching NuttX
  I2S standard Philips mode
- ES7210_ADC_PGA_POWER_ON bit in gain registers REG43-46, required
  for analog front-end amplifier power-on
- 50ms startup delay in es7210_start for codec clock stabilization
- I2S_IOCTL(AUDIOIOC_STOP) in es7210_stop to notify I2S layer,
  preventing DMA from running without buffers after stop

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-04-03 13:34:36 +08:00
Vlad Pruteanu
3039184806 crypto/cryptosoft: Add support for PBKDF2
This adds support for PBKDF2 (SHA1 and SHA256) while leveraging
the existing infrastructure for HMAC.

Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
2026-03-29 17:23:03 -03:00
trns1997
219a5ce09e build/cmake/stdlib: guard include/cxx by LIBMINIABI, fix div_t conflict
include/cxx contains NuttX's mini C++ ABI shims and must only be added
to the include path when CONFIG_LIBMINIABI is selected.  tools/Config.mk
was adding it unconditionally for every non-LIBCXX/non-UCLIBCXX build,
and the platform.cmake files for arm, arm64, risc-v, x86_64 and tricore
were adding it inside the CONFIG_LIBCXXTOOLCHAIN block.

With an unpatched downloaded ARM GNU Toolchain, <cstdlib> uses
newlib's stdlib.h, defining div_t as an anonymous struct.  A later
inclusion of NuttX's stdlib.h via <cstdio>->stdio.h->kmalloc.h then
redefines div_t with struct tag div_s, causing a conflicting declaration
error.

Guard the div_t/ldiv_t/lldiv_t definitions in stdlib.h with
redefinitions when a toolchain stdlib.h was already processed.

Also fix lldiv_s members typed as long instead of long long.

Signed-off-by: trns1997 <trns1997@gmail.com>
2026-03-29 16:45:29 -03:00
wangjianyu3
4775b36316 drivers/usbdev: add UVC gadget class driver
Add USB Video Class 1.1 gadget driver supporting Bulk transport
with uncompressed YUY2 video streaming. Resolution and frame
interval are negotiated dynamically via PROBE/COMMIT control.

- uvc.h: protocol constants, streaming control struct, public API
- uvc.c: class driver with PROBE/COMMIT, bulk EP, /dev/uvc0 chardev
- Kconfig/Make.defs: USBUVC config and build rules
- boardctl.c: BOARDIOC_USBDEV_UVC standalone init path

Hardened against host disconnect:
- Removed nxmutex_lock from USB interrupt context paths
- Added 30s semaphore timeout in uvc_write with EP_CANCEL fallback
- Drain stale wrsem counts in VS_COMMIT before new stream
- Guard uvc_streaming_stop() against double EP_CANCEL race
- Handle EP_SUBMIT returning -ESHUTDOWN gracefully

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-03-29 12:35:22 -03:00
Huang Qi
e09048cc88 style: Fix "is is" typo across the codebase.
Correct duplicate "is is" word found in 181 files throughout the
codebase.
In most cases "is is" was changed to "is", but in contexts like
"MCU is is sleep mode" it was corrected to "MCU in sleep mode".

Also fixes a "the the" typo in net/inet/inet_sockif.c.

This is a pure style/documentation fix that improves code readability.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-03-24 09:39:26 +08:00
Huang Qi
e3eeaefd6d style: Fix "the the" typo across the codebase.
Fix 269 occurrences of duplicate "the" word typo found in 209 files
across source code, header files, and configuration.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-03-23 11:07:49 +01:00
Michal Lenc
600d0e413a ioexpander/iso1i813t: add option to check errors during read
This commit adds the possibility to check for expander errors when
reading the data. This is optional if glerr_check or interr_check
fields in configuration are not zero.

If not zero, read operation also reads ISO1I813T_GLERR and
ISO1I813T_INTERR register and returns error if there is some error.
The user can control which errors he wants to check with
glerr_check and interr_check masks.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-03-18 15:00:48 -03:00
Arjav Patel
10c75d2722 docs/sdio: clarify 136-bit R2 format
This update adds comprehensive documentation regarding the 136-bit response format for SDIO, including the structure of the response, CRC handling, and necessary byte-shifting for alignment. This information is crucial for developers implementing or maintaining SDIO drivers.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-03-17 18:14:10 -03:00
wangjianyu3
fadfa85296 drivers/video: add GC0308 VGA CMOS image sensor driver
Add support for the GalaxyCore GC0308 VGA CMOS image sensor.
The driver implements the NuttX imgsensor interface and supports
VGA (640x480), QVGA (320x240), and QQVGA (160x120) resolutions
via Kconfig selection. Output format is RGB565X (big-endian).

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-03-16 17:26:27 -03:00