Commit graph

23792 commits

Author SHA1 Message Date
Michal Lenc
cbfaf4224a arch/arch/src/samv7: add support for PIC32CZ CA70 series
PIC32CZ CA70 family is pin to pin and binary compatible with
SAMV70/SAME70 families, therefore the support is placed in samv7
directory. The only difference is larger RAM memory compared to SAM
families.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-07-30 19:28:07 +08:00
Shanmin Zhang
5a91b1b0ee x86_64: allow specifying alternative compilers via CROSSDEV, rather than restricting to specific compiler
Test:

git clone -b dev -depth 1 https://github.com/open-vela/prebuilts_gcc_windows-x86_64_x86_64-none-elf.git ${HOME}/x86_64-none-elf
export CROSSDEV=${HOME}/x86_64-none-elf/bin/x86_64-none-elf-
./tools/configure.sh -l qemu-intel64:nsh
make

Output:

Create version.h
LN: platform/board to /home/shanmin/git/nuttx-apps/platform/dummy
Register: hello
Register: dd
Register: nsh
Register: sh
Register: ostest
LD: nuttx

Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2025-07-30 02:41:29 +08:00
Shanmin Zhang
57d5d87d46 x86_64: Add the -Wa,--divide option for all x86_64 assemblers
Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2025-07-30 02:41:29 +08:00
simbit18
a0c5d035d7 arm: CMake build for the i.MX RT series implemented.
CMake added board ARCX Socket Grid

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-07-30 02:41:08 +08:00
lipengfei28
44016fbe77 arch/arm64/imx9: add imx95 support
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-07-28 09:58:02 -03:00
kywwilson11
4995c836f3 arch/arm/stm32h5: Add DMA Support to STM32H5 Serial Driver
Style fixes.
2025-07-26 20:57:26 +08:00
YAMAMOTO Takashi
69bcbfb207 esp32s3_extraheaps.c: add a missing include for xtensa_imm_initialize
Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-07-25 15:51:38 +08:00
kywwilson11
cbd033ae90 arch/arm/stm32h5: Initial Driver for STM32H5 Digital Temperature Sensor (DTS)
- Committing initial code for DTS. Missing ISR. Works for PCLK1. Cannot get to work for LSE.
- Pushing everything. Working with LSE now.
- Many fixes. Fixed interrupt setting. Added data structures.
- Changed interrupt handling. Removed FARs. Added Kconfig options for selecting interrupts.
- Updated info and formatting.
- Formatting fixes.
- Formatting.
- Changed iten to regval.
- Removed Triggger
- Formatting fixes per Pull request.
- Changed private_types to have stm32_ prefix. Used depends on for DTS Kconfig Menu. Fixed formatting per PR.
- Fixed spacing of function prototypes.
- Fixed indent on line
- Added documentation for STM32H5 and Nucleo-H563ZI regarding DTS. Also added GPDMA support to STM32H5 documentation (previous PR). Made stm32_dts.c more modular. stm32_dts_activate is now much more readable. Added comments/descriptions to private functions. Lastly, added a nucleo-h563zi:dts configuration.
2025-07-23 15:08:02 +08:00
Martin Vajnar
150854c6f2 ESP_PCNT: add high and low limit Kconfig options
Signed-off-by: Martin Vajnar <martin.vajnar@gmail.com>
2025-07-22 13:09:02 -03:00
Filipe Cavalcanti
3468c8e0cf arch/risc-v: change offset for SPI Flash on Espressif devices
Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-07-22 10:55:08 -03:00
Filipe Cavalcanti
a7cd6bb401 arch/xtensa: add E-Fuse support on ESP32S2
Adds support for e-fuse on ESP32S2 and fixes a gitignore issue.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-07-22 10:55:08 -03:00
SPRESENSE
664277039e arch: cxd56xx: Fix bug that causes wake-up by unused gpio interrupt
Set level high for unused interrupt trigger to avoid waking up from cold sleeping.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-07-22 16:21:26 +08:00
guanyi
ac5b38c9e5 arch/sim: avoid host-call being interrupted before getting errno
Sim use coroutine base on one thread in host to do switch context. but if we allow switch context with in one API (host-API and errno get), maybe the switch context from coroutine cause re-enter host-API call. Make the errno get behavior not work as expected.

Signed-off-by: guanyi3 <guanyi3@xiaomi.com>
2025-07-21 19:19:05 -03:00
xuxin19
956a50bb7d cmake(bugfix):add missing c++ toolchain search path
when libcxx or uClib++ is not selected, we use the default NUTTX cxx

Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2025-07-21 19:21:02 +08:00
chao an
9e53aab5b3 xtensa/isa: fix build break if compiler without ISA - XCHAL_HAVE_THREADPTR support
common/xtensa_context.S: Assembler messages:
common/xtensa_context.S:134: Error: invalid register number (231) for 'rur' instruction
common/xtensa_context.S:283: Error: invalid register number (231) for 'wur' instruction
clang-10: error: Xtensa-as command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:143: xtensa_context.o] Error 1
make[1]: *** Waiting for unfinished jobs....

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-07-21 12:56:31 +02:00
wangmingrong1
cbdc1a4108 toolchain/arm/clang: fix nuttx_find_toolchain_lib function error
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-07-18 22:37:36 +08:00
wangmingrong1
d3dd43cb59 arch/arm32v8m/cmake: Fix clang's error in specifying cfg and target
1. -target should be in front, otherwise clang will not be able to find the corresponding libgcc.a
2. When using clang++ compiler to link, you also need to specify the corresponding arch, otherwise ld.lld will report an error due to arch mismatch.

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-07-18 22:37:36 +08:00
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
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
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
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
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
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
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
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
paolovolpi
e1e9ea2e81 RP2350B has 48 gpio, highers 16 accessed by "HI" registers 2025-07-10 13:45:33 +08:00
Eren Terzioglu
af8e43e7f2 arch/xtensa: Bugfix I2C Slave build error for esp32[-|-s2|-s3]
Fix build error for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-09 12:18:06 +08:00
Eren Terzioglu
f07141244c arch/risc-v: Bugfix I2C Slave build error for esp32[-c3|-c6|-h2]
Fix build error for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-09 12:18:06 +08:00
Eren Terzioglu
8995226e0a arch/risc-v: Add LP I2C for esp32[-c6]
Add LP I2C peripheral support for esp32c6

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-09 12:18:06 +08:00
Eren Terzioglu
2e4eaf69ee arch/xtensa: Add arch layer SHA accelerator support for esp32[-s2|-s3]
Add arch layer SHA accelerator support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-09 12:13:06 +08:00
Eren Terzioglu
8e44c85a3a arch/risc-v: Add arch layer SHA accelerator support for esp32[-c3|-c6|-h2]
Add arch layer SHA accelerator support for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-09 12:13:06 +08:00
Eren Terzioglu
d8f241b29d Documentation/risc-v/esp32[c6]: Add LP_UART support docs
Add LPUART support doc for esp32c6

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-08 19:35:54 +08:00
Eren Terzioglu
1c48c0cba7 arch/risc-v/esp32[c6]: Add LP_UART support
Add LP_UART support for esp32c6

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-08 19:35:54 +08:00
Eren Terzioglu
735e16f842 arch/xtensa: Fix dedicated GPIO build error
Fix dedicated GPIO build error for esp32[-s2|-s3]

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-08 11:58:15 +08:00
Filipe Cavalcanti
06b37fe6aa arch/risc-v: set SCL timeout for esp_i2c.c
Adds proper timeout settings to SCL on ESP32C3|C6|H2.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-07-08 11:04:05 +08:00
Eren Terzioglu
3f65182699 arch/risc-v: Change DMA functions with common layer approach for esp32[-c3|-c6|-h2]
Change DMA functions with common layer functions for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-07 23:46:07 +08:00
raiden00pl
f0270eb349 arch/arm/stm32{h5|h7|l4}/adc: move ADC_MAX_SAMPLES to Kconfig
move ADC_MAX_SAMPLES to Kconfig so user can fine tune memory usage

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-07-06 21:27:52 -03:00
Eren Terzioglu
5991a8c4cc xtensa/espressif: Change LEDC implementation to common for Xtensa based Espressif chips
Change LEDC implementation to common one for esp32[-s2|-s3]

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-05 11:12:06 +08:00
chenxiaoyi
886718ade1 xtensa: support more than 32 cpu interrupts
The architecture defines maximum of 128 interrupts, whereas previous
code only supported 32 interrupts.  For every 32 interrupts added,
there are three additional registers: INTERRUPT, INTCLEAR, and INTENABLE.
This patch adds support for handling these registers.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-07-04 11:26:07 -03:00
raiden00pl
b2158c8e3c arch/arm/stm32f0l0g0/adc: move ADC_MAX_SAMPLES to Kconfig
move ADC_MAX_SAMPLES to Kconfig so user can fine tune memory usage

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-07-04 18:14:31 +08:00
Shen Cao
8e68c7a810 arch/arm: Add gic lock for GICD_ICFGR RMW operations.
GICD_ICFGR requires full 32-bit RMW operations.
Each interrupt uses 2 bits; thus updates must be synchronized
to avoid losing configuration in concurrent environments.

RMW conflict on GICD_ICFGRn (without lock)

CPU0 (set IRQ32 edge)      CPU1 (set IRQ33 level)
---------------------      -----------------------
val0 = read(ICFGRn)     │  val1 = read(ICFGRn)
                        │
val0 |= (edge << 4)     │
                        │  val1 &= ~(3 << 6)
                        │
write(ICFGRn, val0)     │
                        │  write(ICFGRn, val1)

=> IRQ32 config lost OR IRQ33 config lost
   (depends on which write finishes last)

Concurrent RMW on ICFGRn causes lost config.
Protect with spinlock to avoid data race.

Since interrupt type configuration is infrequent,
a single global GIC lock is sufficient (no need for
fine-grained locking per ICFGR register).

Signed-off-by: Shen Cao <caoshen3@lixiang.com>
2025-07-03 19:02:50 -03:00
Carlos Sanchez
a9da6fde59 arch/arm/src/*/stm32_fdcan_sock.c: prevent interrupt flood on errors.
Previous code was failing to disable error interrupts which
due to standard CAN retransmissions might trigger continusouly
(for example, with a disconnected CAN interface) flooding the
system and preventing other operations to continue.

Fixes: https://github.com/apache/nuttx/issues/16668
Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2025-07-04 02:00:52 +08:00
wangmingrong1
1df6aa92f9 arm64: Support hardware debug
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-07-03 00:20:54 +08:00
wangmingrong1
3c2b203286 arm64->fetal: Support return to thread site
The breakpoint of arm64 is fetal_handler, which needs to return to the scene

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
2025-07-03 00:20:54 +08:00