Commit graph

62054 commits

Author SHA1 Message Date
raiden00pl
fe42e755a1 !arm/stm32h7: standardize public API prefix to stm32_
BREAKING CHANGE: Public STM32H7 APIs were renamed from stm32h7_*
forms to canonical stm32_* forms.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-13 12:45:16 +08:00
raiden00pl
8ece56ff11 !arm/stm32h5: standardize public API prefix to stm32_
BREAKING CHANGE: Public STM32H5 APIs were renamed from stm32h5_*
forms to canonical stm32_* forms.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-13 12:45:16 +08:00
raiden00pl
3490eec26d !arm/stm32f7: standardize public API prefix to stm32_
BREAKING CHANGE: Public STM32F7 APIs were renamed from stm32f7_*
and stm32f7x9_* forms to canonical stm32_* names.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-13 12:45:16 +08:00
Kerogit
0b5bf6c2c5 arch/avr/src/avrdx/avrdx_delay: add custom up_udelay function
NuttX builtin up_udelay function uses BOARD_LOOPSPERMSEC configuration
value to determine how many loops need to be done to cause requested
delay. This does not match well with AVR DA/DB microcontrollers
because the CPU clock frequency is configurable.

A board configuration could therefore provide BOARD_LOOPSPERMSEC
valid for one frequency but for other frequencies, the user would
be required to calibrate the value and would still get incorrect
result when changing the clock speed during runtime.

This patch therefore implements dynamic architecture-specific
up_udelay function which determines current clock settings
and infers required loop count from that.

New function was tested by simple application that used up_udelay
to put delays between printf calls.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2026-06-12 09:55:11 -04:00
Kerogit
10dea61e23 arch/avr/src/avrdx: add support for reading CPU clock from other sources
This patch adds support for reading CPU clock frequency when the MCU
is driven by clock source other than high frequency oscillator.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2026-06-12 09:55:11 -04:00
Kerogit
689ed188c6 sched/clock/clock_delay: added config flag to remove weak up_udelay
While attempting to create architecture-specific implementation
of up_udelay, it was discovered that the overriding function is not
included in the final binary, the weak implementation was used instead.

Further investigation and experimentation showed that the linker
only overrides the weak implementation with the custom one if
the custom one is present in a .c source file that contains at least
one other function that is called from somewhere. Some additional
testing revealed that at least one other already present up_udelay
override (rv32m1-vega:nsh) is affected by this.

In a short mailing list discussion it was determined that this
is a likely result of using static libraries during the build process
and it was suggested to introduce configuration option that will
exclude weak implementations of the function from the build altogether.
This patch does that.

This patch does not enable this configuration option for any existing
board/chip because doing so would change its behaviour and needs
to be tested by users of the hardware.

Also changed is the static assertion in sched/clock/clock_delay.c
to not prevent building the code when architecture declares that
it does not use BOARD_LOOPSPERMSEC to determine required loop count.
BOARD_LOOPSPERMSEC is made undefined in such case.

Patch was tested by building breadxavr:nsh (identical binary by SHA256),
rv32m1-vega:nsh (identical text section) and rv-virt:nsh (text section
differs because of different ordering of functions in the binary, ostest
passed though.)

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2026-06-12 09:55:11 -04:00
Kerogit
a7352902ae arch/avr/src/avrdx: fix Make.defs when CONFIG_ENABLE_ALL_SIGNALS unset
This patch amends commit dfd3426aa5 which added support for running
with some signals disabled to AVR architecture. AVR DA/DB architecture
was not covered by the commit and failed to build
with CONFIG_ENABLE_ALL_SIGNALS unset (which includes building
with CONFIG_ENABLE_PARTIAL_SIGNALS, the default value.)

Change is replicated from the commit and tested by a custom stress
application which spawns some always-busy threads and uses preemptive
multitasking to switch between them. Additionally, ability to sleep
in the application was tested by a simple LED blinking application.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2026-06-12 09:55:11 -04:00
Kerogit
ce0e715254 boards/avr/avrdx/breadxavr: provide board_late_initialize
This patch amends commit f077c0321d which is a part of series that
changed (in commit 48db502daf) default value of BOARD_LATE_INITIALIZE
to yes. With this change, the boards are required to provide
board_late_initialize function.

Commit f077c0321d added this function to many AVR boards but
not to this one, making the build with default configuration
fail. This patch rectifies that and provides an empty function.

With this patch applied, the build no longer fails.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2026-06-12 09:55:11 -04:00
hanzhijian
d866153a25 Documentation/applications/system/conntrack: add conntrack man page
Add comprehensive documentation for the conntrack command including
dump and event monitoring options.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-06-11 22:52:33 -03:00
hanzhijian
f6bb93c379 Documentation/applications/system/conntrack: add conntrack man page
Add documentation for the conntrack command including usage, options,
output format, and examples for listing and monitoring connection
tracking entries.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-06-11 22:52:33 -03:00
raiden00pl
a788e3d436 !arch/stm32n6: unify non-standard hardware definition prefixes
BREAKING CHANGE: STM32N6 non-standard hardware definition macros
(IRQ, peripheral-count, SRAM and related) were renamed to the common
STM32_* prefix. Out-of-tree code must update the affected references.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-11 22:51:35 -03:00
raiden00pl
28c02dea3e !arch/stm32wl5: unify non-standard hardware definition prefixes
BREAKING CHANGE: STM32WL5 non-standard hardware definition macros
(IRQ, peripheral-count, SRAM and related) were renamed to the common
STM32_* prefix. Out-of-tree code must update the affected references.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-11 22:51:35 -03:00
raiden00pl
61e6b87dde !arch/stm32wb: unify non-standard hardware definition prefixes
BREAKING CHANGE: STM32WB non-standard hardware definition macros
(IRQ, peripheral-count, SRAM and related) were renamed to the common
STM32_* prefix. Out-of-tree code must update the affected references.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-11 22:51:35 -03:00
raiden00pl
65e3f68af8 !arch/stm32u5: unify non-standard hardware definition prefixes
BREAKING CHANGE: STM32U5 non-standard hardware definition macros
(IRQ, peripheral-count, SRAM and related) were renamed to the common
STM32_* prefix. Out-of-tree code must update the affected references.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-11 22:51:35 -03:00
raiden00pl
62e029cb0b !arch/stm32l5: unify non-standard hardware definition prefixes
BREAKING CHANGE: STM32L5 non-standard hardware definition macros
(IRQ, peripheral-count, SRAM and related) were renamed to the common
STM32_* prefix. Out-of-tree code must update the affected references.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-11 22:51:35 -03:00
raiden00pl
feb24082bd !arch/stm32l4: unify non-standard hardware definition prefixes
BREAKING CHANGE: STM32L4 non-standard hardware definition macros
(IRQ, peripheral-count, SRAM and related) were renamed to the common
STM32_* prefix. Out-of-tree code must update the affected references.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-11 22:51:35 -03:00
raiden00pl
8397881df4 !arch/stm32h7: unify non-standard hardware definition prefixes
BREAKING CHANGE: STM32H7 non-standard hardware definition macros
(IRQ, peripheral-count, SRAM and related) were renamed to the common
STM32_* prefix. Out-of-tree code must update the affected references.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-11 22:51:35 -03:00
raiden00pl
2ec8e5aa43 !arch/stm32h5: unify non-standard hardware definition prefixes
BREAKING CHANGE: STM32H5 non-standard hardware definition macros
(IRQ, peripheral-count, SRAM and related) were renamed to the common
STM32_* prefix. Out-of-tree code must update the affected references.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-11 22:51:35 -03:00
raiden00pl
4982f5016e !arch/stm32f7: unify non-standard hardware definition prefixes
BREAKING CHANGE: STM32F7 non-standard hardware definition macros
(IRQ, peripheral-count, SRAM and related) were renamed to the common
STM32_* prefix. Out-of-tree code must update the affected references.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-11 22:51:35 -03:00
Abhishek Mishra
d487c46a29 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-12 08:13:23 +08:00
Abhishek Mishra
14661fdba0 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-12 08:13:23 +08:00
Jukka Laitinen
f442c6b05e libs/libc/pthread/pthread_mutex: Fix robust mutex initialization
This fixes an issue where ostest robust mutex test gets stuck.

In CONFIG_PTHREAD_MUTEX_ROBUST mode, every NORMAL mutex is robust by
definition, so the robust flag must be set to allow the mutex to be tracked
in the holder's mutex list.

Otherwise, pthread_mutex_add() will not record the mutex and
pthread_mutex_inconsistent() will not be able to mark it as inconsistent or
wake waiters when the holder thread terminates.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-12 08:04:09 +08:00
raiden00pl
bb025be12d arch/nrf91: add PWM support
add PWM support for nrf91

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-12 08:03:17 +08:00
Abhishek Mishra
ce01327a45 fs/vfs: inherit ownership in pseudofile_create
Initialize i_owner and i_group from the creating task's
effective uid/gid when a pseudo-file is created via O_CREAT.

This aligns pseudo-file ownership with the creator's
effective credentials instead of leaving new files
root-owned by default.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-06-11 12:22:16 -03:00
lccosy
d7f168061b arch/arm/gd32f4: fix missing CTL selector bits in up_disableusartint.
up_disableusartint() saves USART interrupt state from hardware CTL0-CTL3
registers but omits the CTL selector bits (bits 24-27) in the encoded
ie value. When up_restoreusartint() later restores interrupts, it uses
ie >> 24 to determine which CTL register to write. Without selector bits
this evaluates to 0, so no CTL register is updated and all interrupt
enables (including RBNEIE) are permanently lost.

This causes RX interrupts to never fire after any call to up_putc()
(e.g. via syslog), making the serial console unable to receive input.

Fix by adding the corresponding CTL selector bit (USART_CFG_CTLx_INT
<< USART_CFG_SHIFT) whenever a CTL register has active interrupt bits.

Signed-off-by: lccosy <1191294205@qq.com>
2026-06-11 09:18:15 -03:00
raiden00pl
0574de1801 arch/arm/src/stm32f7: remove duplicated stm32_exti_alarm.c source
stm32_exti_alarm.c was added twice in Make.defs and CMakeLists.txt.
Drop the duplicate block

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-11 10:21:11 +08:00
Michal Lenc
e1a9b953e2 fs/vfs/fs_lock.c: support flock for SHM driver
We can apply file lock on SHM inode as well. Ensure file_lock_get_path
function passes and doesn't return EBADF errno.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-06-11 09:10:50 +08:00
Michal Lenc
726dd10bcd fs/vfs/fs_lock.c: fix flock behavior for more threads and fds
We need to use gettid instead of getpid, otherwise flocks applied
from different threads are considered as single thread lock and are
ignored (or updated).

Also fix the behavior if process opens the file multiple times
Linux/BSD manual states multiple file descriptors opened by a single
process shall be treated independently. Therefore we also need to
compare struct file pointer to determine whether the lock applies
to the same descriptor or not.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-06-11 09:10:50 +08:00
yushuailong
1a3185beeb arch/risc-v/esp32c3-legacy: Fix non-atomic clock read in up_rtc_rdalarm.
up_rtc_rdalarm() computed tv_sec and tv_nsec from two separate
evaluations of rt_timer_time_us() + offset + deadline. The RT timer
advances between the two calls, so a read that straddles a second
boundary yields an inconsistent timespec.

Compute the microsecond value once into a local variable and derive
both fields from that single snapshot.

Signed-off-by: yushuailong <yyyusl@qq.com>
2026-06-11 02:59:10 +08:00
yushuailong
1d08a9d019 arch/risc-v/espressif: Fix non-atomic clock read in esp_rtc_rdalarm.
esp_rtc_rdalarm() computed tv_sec and tv_nsec from two separate
evaluations of esp_hr_timer_time_us() + offset + deadline. The
high-resolution timer advances between the two calls, so a read that
straddles a second boundary yields an inconsistent timespec.

Compute the microsecond value once into a local variable and derive
both fields from that single snapshot.

Signed-off-by: yushuailong <yyyusl@qq.com>
2026-06-11 02:59:10 +08:00
yushuailong
c11029848e arch/xtensa/espressif: Fix non-atomic clock read in esp_rtc_rdalarm.
esp_rtc_rdalarm() computed tv_sec and tv_nsec from two separate
evaluations of esp_hr_timer_time_us() + offset + deadline. The
high-resolution timer advances between the two calls, so a read that
straddles a second boundary yields an inconsistent timespec.

Compute the microsecond value once into a local variable and derive
both fields from that single snapshot.

Signed-off-by: yushuailong <yyyusl@qq.com>
2026-06-11 02:59:10 +08:00
yushuailong
5de32920f7 drivers/timers: Fix non-atomic clock read in up_timer_gettime.
up_timer_gettime() computed tv_sec and tv_nsec from two separate calls
to current_usec(), which returns a free-running microsecond counter.
The counter advances between the two calls, so a read that straddles a
second boundary yields an inconsistent (possibly backwards) timespec.

Read current_usec() once into a local variable and derive both fields
from that single snapshot.

Signed-off-by: yushuailong <yyyusl@qq.com>
2026-06-11 02:59:10 +08:00
hanzhijian
cdf500960f fix: remove cross-reference to ip6tables doc not yet in tree 2026-06-10 08:57:15 -03:00
hanzhijian
77060179dd fix: replace :kconfig:option: with plain backticks for Sphinx compatibility 2026-06-10 08:57:15 -03:00
hanzhijian
ffd09067e4 Documentation/applications/system/iptables: add iptables man page
Add comprehensive documentation for the iptables command including
all supported commands, options, and usage examples.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-06-10 08:57:15 -03:00
hanzhijian
21157586bc fix: remove extra backtick in See Also doc reference 2026-06-10 08:55:23 -03:00
hanzhijian
a0c9463f01 fix: replace :kconfig:option: with plain backticks for Sphinx compatibility 2026-06-10 08:55:23 -03:00
hanzhijian
d0665a8cff Documentation/applications/system/ip6tables: add ip6tables man page
Add comprehensive documentation for the ip6tables command including
all supported commands, options, and IPv6-specific usage examples.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-06-10 08:55:23 -03:00
raiden00pl
46967df94f !arm/stm32: split legacy STM32 family selectors
BREAKING CHANGE: Convert the legacy STM32 F1/F2/F3/F4/G4/L1 port to the concrete
family selectors while keeping the shared STM32 selector hidden.

Legacy STM32 family selector Kconfig symbols were split by
concrete STM32 sub-family. Out-of-tree defconfigs and code must update
CONFIG_ARCH_CHIP_* selections to the new family-specific selectors.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-10 08:51:47 -03:00
raiden00pl
46d2306bf8 !arch/stm32: rename STM32F7/H7 QUADSPI Kconfig symbol to QSPI
BREAKING CHANGE: CONFIG_STM32F7_QUADSPI and CONFIG_STM32H7_QUADSPI are
renamed to CONFIG_STM32F7_QSPI and CONFIG_STM32H7_QSPI. Out-of-tree F7/H7
board configurations must update the symbol name.

Standardize the F7/H7 QSPI enable symbol on the QSPI name (the QUADSPI and
QSPI peripherals are the same IP block). Only the Kconfig enable symbol and
its CONFIG_ references are renamed; the QUADSPI hardware register/pin/DMA
macros are unchanged.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-10 08:49:59 -03:00
raiden00pl
84f891b848 drivers/sensors/adxl372_uorb.c: fix compilation error
drivers/sensors/adxl372_uorb.c: fix compilation error

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-10 08:49:14 -03:00
raiden00pl
46cc145645 thingy91: initial sensors support
initial sensors support for thingy91

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-10 08:49:14 -03:00
raiden00pl
8021b5371e sensors/bme680_uorb.c: always allow temperature topic registration
Previously bme680 dont register temperature topic when pressure measurement
was enabled. Temperature data is present in barometer data, but sometimes
we need clear separation between these topics.
The old behavior is still achievable by setting CONFIG_BME680_DISABLE_TEMP_MEAS=y

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-10 09:52:00 +08:00
Jukka Laitinen
64b6bbb0c0 sched/Kconfig: Fix ETC_ROMFS dependency
When using FS_CROMFS for etc, user typically don't need FS_ROMFS,
they are completely separate filesystems. But both ETC_ROMFS and
ETC_CROMFS are needed, the first one selects that the ETC needs
to be mounted from ROM based filesystem, and ETC_CROMFS just specifies
that the backing filesystem is actually the CROMFS.

Iow; make ETC_ROMFS depend on FS_ROMFS || FS_CROMFS, so that the
user can drop FS_ROMFS when only FS_CROMFS is needed.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-10 01:23:08 +08:00
nicolasWDC
794f0c2ce9 include/cxx/ctime: Add localtime to std namespace.
NuttX time.h declares localtime in the global namespace, but the C++
ctime shim does not import it into namespace std.

As a result, valid C++ code using std::localtime fails to compile with
the NuttX C++ headers, even though ::localtime is available.

Add using ::localtime to include/cxx/ctime.

Signed-off-by: nicolasWDC <nicolasWDC@users.noreply.github.com>
2026-06-09 11:33:40 -03:00
raiden00pl
0a9cb6538c boards/arm/stm32f4/stm32f401rc-rs485: fix compilation
fix compilation error

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-09 11:33:02 -03:00
raiden00pl
165e7cb1ab arch/arm/stm32f3/stm32f33xxx_pinmap.h: fix compilation
fix compilation error

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-09 11:33:02 -03:00
raiden00pl
2c606a7b41 !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-09 11:00:25 -03:00
Jukka Laitinen
f3e62b837b Documentation: Add documentation of SCHED_DUMP_TASKS and SCHED_DUMP_STACK
Add documentation for controlling the crash dump verbosity.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-09 08:04:54 -04:00
Jukka Laitinen
40bbf67bd3 sched/misc/assert: Add CONFIG_SCHED_DUMP_TASKS and CONFIG_SCHED_DUMP_STACK
Add more refined options for sched/misc/assert to control how verbose
crash dumps are printed out:

- SCHED_DUMP_TASKS
- SCHED_DUMP_STACK

These default to y unless DEFAULT_SMALL is defined. The options can
be undefined to save flash space on a small system.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-09 08:04:54 -04:00