Commit graph

59136 commits

Author SHA1 Message Date
nuttxs
d1fababfc5 arch/xtensa: esp32(s3)_async_op() using nxsem_wait(), threads may
return early due to signal interruption (EINTR). This makes the
main thread think the async operation is done, but the background
worker thread is still running—risking access to freed memory,
race conditions, crashes or undefined behavior.

Using nxsem_wait_uninterruptible():the main thread waits until the
worker thread finishes, preventing these issues.

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-07-18 22:34:13 +08:00
Windsor Schmidt
1e6289b543 style: fix spelling in documentation 2025-07-18 15:21:08 +08:00
wangmingrong1
1bdbf0effd toolchain/arm64/cmake: Corrected the writing of arm64 cmake search library
Align the writing style of arm cmake, and each compiler defines its own find library
function, otherwise use the default

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-07-17 19:17:55 +08:00
Filipe Cavalcanti
bc8ce393cb documentation: update docs on SDMMC for ESP32C3|C6|H2
Adds sdmmc_spi defconfig documentation for ESP32C3, ESP32C6 and ESP32H2 boards.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-07-16 10:24:21 -03:00
Filipe Cavalcanti
bd18bda0d7 boards/risc-v: add SDMMC defconfigs for ESP32C3|C6|H2
Adds defconfig to support SDMMC over SPI for esp32c3-generic, esp32c6-devkitc,
esp32c6-devkitm and esp32h2-devkit.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-07-16 10:24:21 -03:00
Filipe Cavalcanti
6f19c59d26 boards/risc-v: add support for SD Card over SPI on ESP32-C3|C6|H2
Add board support for SD Card over SPI for ESP32C3, ESP32C6 and ESP32H2.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-07-16 10:24:21 -03:00
chao an
7352e8ebfa arm64/qemu: decouple qemu board from chip
decouple qemu board from chip to support custom boards

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-07-16 10:12:57 -03:00
George Poulios
589c0e13b8 drivers/misc/optee: Cache coherency when MMU is disabled
When the MMU is disabled (CONFIG_ARCH_USE_MMU=n) the
data passed back and forth with the TEE needs to be
synced from/to the cache, otherwise we get random data
in either world.

Fix this by cleaning before a call and invalidating after.
This has to be done both on the optee msg arg, and the shm
buffers therein. Cleaning and invalidating the page list
used to describe non-contiguous shm buffers did not seem
mandatory in my tests, but common sense says that it should
be, so we do that too.

This fix does not apply to the optee msg arg of the socket
transport (optee_socket.c), as that one _should_ be handled
by the socket send/recv methods. It does apply to all shm
buffers though, regardless of transport.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-07-16 15:35:00 +08:00
jingfei
4a765b557f Docs/drviers/mtd:Add description for MTD Device Registration and FTL Control
Documentation:
1. Updates the registration process description and flag usage guidelines
2. Includes the MTD open sequence diagram (mtd_open_flow.png)
2025-07-16 14:11:41 +08:00
jingfei
c3e87dd3d1 drivers/fs: Control the behavior of FTL by passing oflags during the open process.
To save more space (equivalent to the size of one erase sector of
MTD device) and to achieve faster read and write speeds, a method
for direct writing was introduced at the FTL layer.
This can be accomplished simply by using the following oflags during
the open operation:

1. O_DIRECT. when this flag is passed in, ftl internally uses
   the direct write strategy and no read cache is used in ftl;
   otherwise, each write will be executed with the minimum
   granularity of flash erase sector size which means a
   "sector read back - erase sector - write sector" operation
   is performed by using a read cache buffer in heap.

2. O_SYNC. When this flag is passed in, we assume that the
   flash has been erased in advance and no erasure operation
   will be performed internally within ftl. O_SYNC will take
   effect only when both O_DIRECT and O_SYNC are passed in
   simultaneously.

3. For uniformity, we remapped the mount flag in mount.h and
   unified it with the open flag in fcntl.h. The repetitive
   parts of their definitions were reused, and the remaining
   part of the mount flag redefine to the unused bit of open
   flags.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2025-07-16 14:11:41 +08:00
jingfei
a6fdbc538b Revert "ftl: should pre-allocate eblock for car case"
This reverts commit 20fcdcf905f279a9c4527be399a90590f458db1f.
The reason is that the erase buffer isn't always used in most cases.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2025-07-16 14:11:41 +08:00
jingfei
d12cf1cb75 drivers/fs:Always use register_mtddriver() to register the MTD device.
We have adjusted the registration method for MTD devices
in nuttx/boards, replacing the previous approach using
ftl_initialize() and bchdev_register() with
register_mtddriver().

When registering MTD devices via register_mtddriver(),
FTL and BCH wrappers will be added during the open() process:

1. Character Device Mode:
   When accessing the MTD device node via the open() interface,
   the device will be automatically converted to a character
   device. Both FTL and BCH wrappers will be implicitly added,
   provided that BCH support is enabled in the configuration.

2. Block Device Mode:
   When accessing the MTD device node via open_blockdriver(),
   the device will be treated as a block device, with only
   the FTL wrapper automatically applied.

Due to the automatic wrapping of MTD devices during the
open() process, the legacy registration methods
ftl_initialize() and bchdev_register() are no longer
required for MTD device registration for user code and should
be used only internally within fs and driver code.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2025-07-16 14:11:41 +08:00
Filipe Cavalcanti
a754b73e4c documentation: update MCUBoot docs for local update agent example
Updates the example documentation for a new example: local update agent.
This example allows the user to update MCUBoot image from a locally stored file.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-07-16 09:12:41 +08:00
Alan Carvalho de Assis
54b2381c42 drivers/input: Create Single Button Multi Actions
This commit creates a sbutton device that uses a single button to
create a keyboard driver that returns TAB or ENTER depending how
long the user keeps the button pressed.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-07-15 18:39:59 -03:00
Alin Jerpelea
3c8859b509 AUTHORS: add Simone Falsetti
Simone Falsetti has submitted the ICLA and should be added to
the AUTHORS file

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-07-15 15:12:44 -03:00
Peter van der Perk
def76c90d5 imx95: eDMA5 Allow sharing with Linux
Allows to offset channels and thus sharing the controller with A-core
2025-07-16 01:19:05 +08:00
simbit18
3ff603fc52 ci/platforms/windows.ps1: bump risc-v toolchain
Bump xPack GNU RISC-V Embedded GCC v14.2.0-3
2025-07-16 01:16:36 +08:00
simbit18
4df40dcb66 ci/platforms/ubuntu.sh: bump risc-v toolchain
Bump xPack GNU RISC-V Embedded GCC v14.2.0-3
2025-07-16 01:16:36 +08:00
simbit18
32474985ab ci/platforms/msys2.sh: bump risc-v toolchain
Bump xPack GNU RISC-V Embedded GCC v14.2.0-3
2025-07-16 01:16:36 +08:00
simbit18
665d608e68 ci/platforms/linux.sh: bump risc-v toolchain
Bump xPack GNU RISC-V Embedded GCC v14.2.0-3
2025-07-16 01:16:36 +08:00
simbit18
e66fbcf708 ci/platforms/darwin_arm64.sh: bump risc-v toolchain
Darwin arm64 Bump xPack GNU RISC-V Embedded GCC v14.2.0-3
2025-07-16 01:16:36 +08:00
simbit18
0f6e385a37 ci/platforms/darwin.sh: bump risc-v toolchain
Bump xPack GNU RISC-V Embedded GCC v14.2.0-3
2025-07-16 01:16:36 +08:00
wangmingrong1
be3cd43a1e toolchain/armclang: Fix armclang config
In the toolchain, ARCH_TOOLCHAIN_XXX is used to select the compiler to be used. If clang is selected here, subsequent errors will occur

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-07-15 21:56:46 +08:00
dongjiuzhu1
338132af8f fs/block_proxy: fix the issue of the refs count for filep being zeroed out by utilizing dup2
file_open will clear filep, include f_refs

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-07-15 19:46:24 +08:00
dongjiuzhu1
ae33447220 fs/vfs: fix bug about lost dup oflags in dup2
this issue is caused by commit: b8e30b54ec

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-07-15 19:46:24 +08:00
Daniel Byshkin
c51f749f9a /drivers/sensors/nau7802: Added frequency control
Added controls to the NAU7802 so that a user can change the frequency via orb_set_frequency/orb_set_interval
2025-07-15 09:39:57 +08:00
Eren Terzioglu
30a567453c tools/espressif: Add risc-v compiler info dump for Espressif devices
Add xpack risc-v compiler info on diagnostic tool

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-15 01:51:04 +08:00
Matteo Golin
953ab4e287 docs/ads1115: Add trigger commands to documentation
Updates the ADS1115 documentation with information about the two new
commands for triggering conversion and reading the result.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-14 10:22:33 -04:00
Daniel Byshkin
4030eb892e drivers/analog/ads1115.h: Add ioctl for conversion trigger
Since the ADS1115 has a relative slow conversion rate, this additional
ioctl command makes it possible to trigger a conversion before reading
the reading the conversion result, allowing the user to perform other
computation in between instead of waiting for the conversion time to
complete. It improves sampling time.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-14 10:22:33 -04:00
Junbo Zheng
a88eb1fc6b cmake: enhance the function of cmake nuttx_wildcard_sources
align already used cmake ifdef/ifndef nuttx_xxx functions, reference:
- https://github.com/apache/nuttx/pull/14747

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2025-07-14 20:41:12 +08:00
Eren Terzioglu
f9c25ecd69 Docs/xtensa: Add match4 game doc for esp32-devkitc
Add esp32-devkit match4 doc

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-14 09:03:28 -03:00
Eren Terzioglu
447c50cbee Docs/games: Add match4 game docs
Add match4 game docs

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-14 09:03:28 -03:00
Eren Terzioglu
495936d16b boards/esp32-devkitc: Add match4 defconfig for esp32
Add match4 defconfig for esp32-devkitc

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-14 09:03:28 -03:00
chao an
382d38b4e0 arm64/zynq-mpsoc: fix race condition in txint handler
The tx int handler will call uart_xmitchars() to make a fake interrupt event,
but this is unsafe after enabling interrupts. This PR will add a critical section
to ensure that the txint process will not be interrupted by the IRQ

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-07-13 18:22:02 -03:00
paolo
b628aec268 arch/arm/rp23xx: spi unset peripheral before to modify Spi parameters
As done by Pico Sdk is better to unset SSPCR1.SSE bit before to modify
Spi parameters (Mode, Frequency as Bits)
2025-07-12 20:11:13 -03:00
simbit18
3b60ed039c [CI] build.yml: fix ERROR: Dangerous symbolic link path was ignored
add:
Command Line Switch -snld

-snld ->  allow extracting of denagerous symbolic links.

https://sourceforge.net/p/sevenzip/discussion/45798/thread/187ce54fb0/

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-07-12 16:12:22 -03:00
George Poulios
c4541a4d4c libc/idr: Remove nodes from RB trees during destroy
idr_destroy() would loop over the removed and alloced
RB tree nodes freeing them but not removing them from
the trees. From the perspective of the RB tree those
nodes would remain valid, while in fact, they were free
memory, potentially reallocated for other purposes, or
otherwise overwritten by the allocator with metadata.
This would cause (seemingly random) memory corruption
crashes triggered by the RB tree code trying to access
link fields from the free'd nodes.

Fix that by removing the nodes before freeing them.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-07-12 14:24:32 +08:00
Rodrigo Sim
95c9525c0d boards/arm/stm32f401rc-rs485: Add support to HX711 ADC
This commit adds support for the HX711 ADC in the STM32F401RC-RS485
board and updates the board documentation accordingly.

Signed-off-by: Rodrigo Sim <rcsim10@gmail.com>
2025-07-12 12:26:07 +08:00
wangmingrong1
51a82d5289 arm/clang: Fix crash caused by clang compiling with -mfpu=fpv5-d16 and -march=armv8.1-m.main+mve.fp+fp.dp
The above combination of compilation causes the compiler to crash:
 #1 0x0000000001fbe154 llvm::sys::CleanupOnSignal(unsigned long) (clang18/bin/clang-19+0x1fbe154)
 #2 0x0000000001f21203 llvm::CrashRecoveryContext::HandleExit(int) (clang18/bin/clang-19+0x1f21203)
 #3 0x0000000001fb7b7e llvm::sys::Process::Exit(int, bool) (clang18/bin/clang-19+0x1fb7b7e)
 #4 0x0000000000b25f0d (clang18/bin/clang-19+0xb25f0d)
................................................................................
................................................................................
This problem occurs in clang18 and above, and there are compilation instructions that are incompatible with GCC.
By following the recommended v8.1m corresponding fpu modification, no crash will occur
➜  NX git:(master) ✗ clang --target=arm-none-eabi -mfpu=help
clang: note: available multilibs are:
--target=thumbv8m.main-unknown-none-eabi -mfpu=none
--target=thumbv8m.main-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti
--target=thumbv8m.main-unknown-none-eabihf -mfpu=fpv5-sp-d16
--target=thumbv8m.main-unknown-none-eabihf -mfpu=fpv5-sp-d16 -fno-exceptions -fno-rtti
--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none
--target=thumbv8.1m.main-unknown-none-eabi -mfpu=none -fno-exceptions -fno-rtti
--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16
--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-sp-d16 -fno-exceptions -fno-rtti
--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16
--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+fp16 -mfpu=fp-armv8-fullfp16-d16 -fno-exceptions -fno-rtti
--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none
--target=thumbv8.1m.main-unknown-none-eabihf -march=thumbv8.1m.main+mve -mfpu=none -fno-exceptions -fno-rtti

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-07-11 20:36:35 +08:00
wangmingrong1
ae70e09810 toolchain/arm: Fix link parameter error
Fixed the problem that when using armclang, it cannot add a space after --scatter=

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-07-11 09:13:03 -03:00
kywwilson11
7abfbddb2f Add additional support for STM32H5 ADC
Put define guard around call to adc_oversample. Fixed formatting.
2025-07-11 09:59:31 +08:00
Kerogit
d3da5e633c arch/avr/avrdx/avrdx_serial: make uart_ops_s structure const
The structure never changes and should be therefore marked as const.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-07-10 12:21:40 -03:00
Kerogit
d9269112ee arch/avr/avrdx: do not copy const variables into RAM
AVR uses Hardward architecture with separate address space for program
memory (flash) and data memory (RAM). Normal program flow can only
access data memory which means that all variables - including const
variables - have to be copied into RAM to be accessible. (This happens
automatically during startup.)

It is possible to work around this limitation in software but that
can have severe impact on performance and/or API complexity. It is hardly
feasible to change NuttX interfaces in a way that would allow to make use
of this workaround.

On newer AVR families, there is an alternative option enabled by this patch.
These chips map part of their program memory (a 32kB window) into data
memory address space. This patch leverages this feature and adds support
for placing const variables into the mapped window. No copy to RAM is done
for them.

Const variables are therefore loaded directly from flash (not consuming
RAM) while still being available to be used by any NuttX interface.

Linker script of breadxavr board is changed to make use of these changes.

Tested by verifying string addresses - parameters in printf call
in a custom application (and also by running the application and verifying
its output.)

Documentation tested by build.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-07-10 12:21:40 -03:00
Kerogit
14e446628e Documentation/platforms/avr: document options of keeping const vars in flash
This patch adds a document that describes why const variables need to be
copied into the RAM in AVR architecture for normal program flow in NuttX.
It then describes options of accessing them directly from the flash without
need to do any copying.

Patch was tested by building the documentation.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-07-10 12:21:40 -03:00
Kerogit
5710b5495f boards/avr/avrdx/breadxavr: fix path in license header
This linker script was initially created as a copy of another script
and the path was left unchanged.

Signed-off-by: Kerogit <kr.git@kerogit.eu>
2025-07-10 12:21:40 -03:00
sanezek
7a32fed563 arch/arm/stm32h7: support for /dev/random device
Enabling support for random device on stm32h7 arch. Driver copy pasted from arch/arm/stm32.

Signed-off-by: sanezek <sanezek@protonmail.com>
2025-07-10 09:52:58 -03:00
kywwilson11
0c1f9d482d Added DMA support for H5. Also added ADC DMA support.
Added logic to set hasdma to false. This is needed to enable or not enable interrupts on a per ADC basis. Made other minor formatting changes.

Fixed build issues with non ADC/DMA configurations.
2025-07-10 09:51:23 -03:00
yinshengkai
156ef05205 libc/mcount: compatible with armv6m mcount implementation
mcount.S: Assembler messages:
mcount.S:33: Error: cannot honor width suffix -- `bic r1,lr,#1'
mcount.S:35: Error: cannot honor width suffix -- `bic r0,r0,#1'
mcount.S:37: Error: cannot honor width suffix -- `pop {r0,r1,r2,r3,ip,lr}

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2025-07-10 18:06:03 +08:00
paolovolpi
e1e9ea2e81 RP2350B has 48 gpio, highers 16 accessed by "HI" registers 2025-07-10 13:45:33 +08:00
SPRESENSE
a20ac0fe7c sensors/bmi160: Fix a bug sensor_time is truncated
Fix a bug that sensor_time resolution is lost by bit shift.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-09 09:50:18 +02:00