Commit Graph

59668 Commits

Author SHA1 Message Date
Matteo Golin
3edf6de552 drivers/timers/arch_alarm: Revert removal of ndelay_accurate
Some checks failed
Docker-Linux / push (push) Has been cancelled
This reverts the removal of ndelay_accurate from #14450, since as
mentioned in #17011, this fails to consider the `sim` architecture
where CONFIG_BOARD_LOOPSPERMSEC was set to 0 because of reliance on the
accurate implementations of the up_delay functions. All the commit did
was remove a more accurate implementation in favour of a less accurate
one.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-11-25 22:33:48 +08:00
dependabot[bot]
cf30528231 build(deps): bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-25 10:36:55 +01:00
wangchengdong
ba05c7f133 sched/signal: Fix nxsig_ismember() return value behavior
Some checks failed
Build Documentation / build-html (push) Has been cancelled
nxsig_ismember() has a return type of int, but the current
implementation returns a boolean value, which is incorrect.

All callers should determine membership by checking whether
the return value is 1 or 0, which is also consistent with the POSIX sigismember() API.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-25 10:02:52 +08:00
wangchengdong
817e4ee354 sched/signal: Initialize signal action pool during init phase
Initialize the signal action pool during the signal initialization
phase to improve performance and reduce footprint.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-25 10:02:24 +08:00
wangchengdong
bc561c677a sched/sleep: Add nxched_nanosleep() API
Introduce the nxched_nanosleep() API to provide a lightweight
nanosecond-level sleep based on nxsched_ticksleep().
This API offers the same functionality as nxsig_nanosleep() but without
signal-related overhead, making it suitable for implementing libc
sleep() or usleep() when signals are disabled.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-25 10:02:13 +08:00
wangchengdong
df17524e55 sched/signal: Use clock_compare() in nxsig_clockwait()
clock_compare() should be used when comparing clock tick values to
ensure correct handling of tick wrap-around and time ordering.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-25 09:50:13 +08:00
wangchengdong
7421846c94 sched/signal: Remove redundant wd_cancel() in nxsig_clockwait()
Both the watchdog timeout and signal dispatch paths already cancel
the watchdog timer, so the explicit wd_cancel() call is redundant.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-25 09:50:13 +08:00
wangchengdong
a232815648 sched/signal: Fix remaining time calculation in nxsig_clockwait()
Always compute the expected wake-up time by default, so the remaining
time can be calculated correctly when the flag is not TIMER_ABSTIME.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-25 09:50:13 +08:00
Antoine Juckler
02db473e97 drivers/eeprom: Set the bus frequency
Add EEPIOC_SETSPEED ioctl acting like the MTDIOC_SETSPEED ioctl. The
default frequency is settable in the Kconfig.

Add xx25xx SPI delay control configurations.

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-11-25 09:49:26 +08:00
chengdong wang
df3fe0e16f Revert "sched/signal: Unblock task waiting for event when a signal received"
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Events are not defined in the POSIX standard, so signals are not required
to wake tasks that are in the TSTATE_WAIT_EVENT state.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-24 11:00:23 -03:00
Max Kriegleder
a9ecff5f1c arch/arm/{nrf52|nrf53|nrf91}/i2c: fix I2C bus getting stuck during read
During I2C read, one-too-many byte is read, which can lead to the I2C bus
getting stuck. This is likely due to the STOP condition being set at the
wrong time or being missed completely. The chip offers a shortcut, such
that the STOP condition is set automatically after the last byte is being
written/read.

Signed-off-by: Max Kriegleder <max.kriegleder@gmail.com>
2025-11-24 14:57:10 +01:00
ouyangxiangzhen
6689a408f3 Documentation/drivers/timers: Add information about timers.
This commit added additional informantion about the timer driver
abstraction.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
a923cfe4ed arch/riscv: Fix bl602 start_absolute.
This commit fix bl602 start_absolute.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
be62b6152b boards/arm: refresh the defconfig.
This commit refreshed the defconfig after count-based oneshot API
introduced.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
0d0c02205b drivers/timers: Fix oneshot callback arg.
This commit fixed the oneshot callback arg problem.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
b540618e9f driver/timers: Simplify the up_timer_initialize.
This commit simplified the up_timer_initialize.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
b1dd15e6e5 arch/riscv: Remove kmalloc.h for mtime driver.
This commit removed kmalloc.h for mtime driver.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
ee32bd44e0 arch/risc-v: Add clkdev drivers for esp32 timers.
This commit added clkdev drivers for esp32 timers.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
882c663a4f arch/riscv: Add clkdev driver for esp32c3-legacy.
This commit added clkdev driver for esp32c3-legacy.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
f9e894e490 arch/riscv: Add clkdev driver for bl602 timer.
This commit added clkdev driver for bl602 timer.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
a5e64a0a5c arch/riscv: Add CONFIG_ONESHOT condition for riscv_mtimer.c.
This commit added CONFIG_ONESHOT condition for riscv_mtimer.c

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
2227f232f0 arch/risc-v: Add clkdev driver for mtime.
This commit added clkdev driver for risc-v machine timer.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
b2fc959e40 risc-v/bl602: Fix boot issue caused by atomic instructions.
Since the bl602 do not support the atomic extention, we should compile
it with `-march=rv32imfc`, or it will fail to boot when executing the
`lr.w` instruction.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
fd4d93e928 arch/risc-v: Ensure the timer setting atomicity on 32-bit platforms.
This commit guaranteed the timer setting atomicity on 32-bit platforms.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
c4fd6f9636 arch/intel64: update the defconfig after clkdev driver introduced.
This commit refreshed the defconfig after clkdev driver introduced.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
f2585f3042 arch/intel64: Added clkdev driver for oneshot_lower.
This commit addedd clkdev driver for oneshot_lower.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
c8c9dbd127 arch/intel64: Added clkdev driver for TSC-deadline.
This commit added clkdev driver for TSC-deadline.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
chenxiaoyi
6308167c45 arch/sim: fix oneshot driver to work with both signal and sleep
This commit fixed oneshot driver to work with both signal and sleep.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
29bf45c371 arch/sim: Add clkdev driver for sim.
This commit added clkdev driver for sim.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
v-tangmeng
34a2f0cc40 boards/arm: refresh the defconfig
This commit refreshed the defconfig.

Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
6f17f1ce81 driver/timers: Simplify Goldfish timer driver.
This commit simplified goldfish timer driver for better performance.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
5296b8d3e3 drivers/timers: Simplify goldfish timer driver.
This commit simplified the goldfish timer driver, reduce the register io
operations.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
8f2f51e145 drivers/timers: Add clkdev drivers for goldfish.
This commit added clkdev drivers for goldfish.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
buxiasen
8cb0e654a3 arch/armv8-r/timer: fix the UINT64_MAX mask cause tick mode no isr
When TICKLESS not enabled, up_alarm_set_lowerhalf will call start, if we
overwrite the compare register will cause TICK mode no longer isr.

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-11-24 19:43:07 +08:00
husong1
482de93342 arch/arm: Fix the arm timer's maximum delay to be a 64-bit integer.
This commit fixed the arm generic timer's maximum delay.

Signed-off-by: husong1 <husong1@xiaomi.com>
2025-11-24 19:43:07 +08:00
husong1
80463c8b06 arch/armv7r: Add armv7r clkdev timer driver.
This commit added armv7r clkdev timer driver.

Signed-off-by: husong1 <husong1@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
996f110925 arch/arm: Add clkdev driver for generic timer.
This commit added clkdev driver for arm generic timer.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
ouyangxiangzhen
d335cce43a arch/arm64: Add clkdev driver for generic timer.
This commit added clkdev driver for arm64 generic timer.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
2025-11-24 19:43:07 +08:00
Karel Kočí
c61d7c7e8d nuttx/can: add message alignment
This adds ability for read and write operations to work with messages
aligned to configured number of bytes. This has few different use
cases.

The alignment is specified as unsigned integer and can be changed with
ioctl command CANIOC_SET_MSGALIGN. The current value can be queried by
CANIOC_GET_MSGALIGN command.

The default value for the message alignment is 1. This will provide
behavior consistent with current one. Thus messages are placed to the
buffer right after data of the previous one. The same applies for
writes.

The special alignment value 0 disables read and write of multiple frames. Thus
read will always return at most one message and write will always write
only one message even if larger buffer size is provided.

Another use case is if message alignment is set to exactly message
representation size (`sizeof(struct can_msg_s)`). This allows writing
and reading arrays of messages.

Other values provide even more advanced and specialized use cases, such
as optimizations if architecture has to emulate some non-aligned
accesses, there alignment of for example 4 bytes could provide
performance boost.

The original motivation behind this is was compatibility with socket
CAN. It is easier to port applications to NuttX's CAN driver if only one
frame is provided at the time. This solution was suggested by Pavel Pisa
<pisa@fel.cvut.cz> as a more versatile variant of plain boolean
disabling the multiple frame retrieval.

Signed-off-by: Karel Kočí <kkoci@elektroline.cz>
2025-11-24 14:11:41 +08:00
Karel Kočí
8230c44517 nuttx/can: fix two documented CANIOC names
This is just a simple typo (missing underscore) in the definition. I am
fixing the documentation instead to make it consistent instead of
breaking an API.

Signed-off-by: Karel Kočí <kkoci@elektroline.cz>
2025-11-24 14:11:41 +08:00
Karel Kočí
b9066e42bb include: add BSD rounding macros to sys/param.h
These macros are commonly provided on BSD systems. They are not part of
C nor POSIX but these types of operations can be required in drivers
implementation as well as in user space. The operations themself are
simple but kind of cryptic when placed in the code as is. Thus having
macro with an appropriate name is beneficial.

The use of BSD naming here is only to cling to at least some other
implementation instead of creating completelly NuttX specific one.

Kudos to @hartmannathan for the source code documentation.

Signed-off-by: Karel Kočí <kkoci@elektroline.cz>
2025-11-24 14:11:41 +08:00
wangchengdong
e758e92830 sched/signal: Unblock task waiting for event when a signal received
Some checks failed
Build Documentation / build-html (push) Has been cancelled
If the task is blocked waiting for a event, then that task must
 be unblocked when a signal is received.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-22 17:24:53 -03:00
Michal Lenc
cb5f47e56e documentation: add GPIO character device driver entry
This page describes GPIO character device driver and its API.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-11-22 14:12:19 -05:00
cuichaochao
d3021ffa87 tm32f746g-disco: fix lvgldemo failed
use external ram in lvgldemo

Signed-off-by: cuichaochao <cuichaochao916@gmail.com>
2025-11-21 11:13:11 -05:00
LuchianMihai
e09c8e510e Documentation/Make: add implementation/make_build_system.rst
Some checks failed
Build Documentation / build-html (push) Has been cancelled
This commit adds initial high level overview of the NuttX
make-based build system.  It documents:
* Tools used during the build process
* Mechanisms set in place during the build process

Signed-off-by: Luchian Mihai <luchiann.mihai@gmail.com>
2025-11-20 09:39:16 -05:00
SPRESENSE
b2b045252d arch: cxd56xx: Fix failure to get RTC time in multi-core environment
In multi-core environment where NuttX runs on each core, if one core
sets the RTC time, the RTC value gotten on other cores is incorrect.

This is caused by clock_gettime(CLOCK_MONOTONIC) function used to get
elapsed time, which uses a core-specific global varaiable g_basetime
as the base time.

To fix this, update the g_basetime from the backup SRAM that can be
shared between cores in setting/getting the RTC time.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-11-20 20:56:05 +08:00
wangchengdong
c5f85f8275 CMake: Enable Kconfig generation for external directories
Currently, nuttx_generate_kconfig() can only parse subdirectories
under apps/. This patch extends its capability to also parse
external directories referenced from the apps tree.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-20 19:16:05 +08:00
wangchengdong
fd70e5f947 CMake: Enable both sub-Kconfig and generated menu Kconfig
Currently, nuttx_generate_kconfig() allows a subdirectory to have
either a handwritten sub-Kconfig or a generated menu Kconfig, but
not both.

This patch enables support for having both a sub-Kconfig and a
generated menu Kconfig within the same subdirectory.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-11-20 13:29:02 +08:00
Jukka Laitinen
f641298d9e arch/imx9: Enable manual control for LPSPI PCS signals
Add a function imx9_lpspi_select_cs to assert CS at the start of
an SPI transfer and keep it asserted until called again to
de-assert it. This can be called by board-provided imx9_lpspi_select,
in case the CS needs to be controlled via the LPSPI block and not
GPIO.

The TCR register CONT (continue) bit is asserted to prevent CS toggling
during the transfer, and the PCS bits are set to mark the correct CS

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-11-19 12:28:32 -03:00
Jukka Laitinen
fbd27c045b arch/imx9: Correct LPSPI TCR register PCS bit definitions
According to the TRM, only bits 24-25 are reserved for chip select, and
the maximum number of internal chip selects is 3 (on LPSPI4 bus only).

Fix the TCR_PCS_MASK and remove extra definitions.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-11-19 12:28:32 -03:00