Commit Graph

23994 Commits

Author SHA1 Message Date
xiezhanpeng3
6238da1355 arch/tricore: remove magic number in tr3xx uart config
Replace magic number with macro for better code readability.

Signed-off-by: xiezhanpeng3 <xiezhanpeng3@lixiang.com>
2025-11-04 20:32:20 -05:00
wangchengdong
c342c0851f xtensa/esp32s2: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in xtensa/esp32s2 with
    spin_lock_irqsave_nopreempt() to improve code clarity and consistency.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-04 22:46:15 +08:00
wangchengdong
97b24a1a0b xtensa/esp32: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in xtensa/esp32 with
    spin_lock_irqsave_nopreempt() to improve code clarity and consistency.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-04 22:46:15 +08:00
wangchengdong
53dd00328d renesas/rx65n: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in renesas/rx65n with
    spin_lock_irqsave_nopreempt() to improve code clarity and consistency.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-04 22:46:15 +08:00
wangchengdong
6c28a2b749 arm64/imx9: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in arm64/imx9 with
    spin_lock_irqsave_nopreempt() to improve code clarity and consistency.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-04 22:46:15 +08:00
wangchengdong
5b4d2dda9d arm/stm32: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in arm/stm32 with
    spin_lock_irqsave_nopreempt() to improve code clarity and consistency.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-04 22:46:15 +08:00
wangchengdong
028f4cd952 arm/sam34: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in arm/sam34 with
    spin_lock_irqsave_nopreempt() to improve code clarity and consistency.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-04 22:46:15 +08:00
wangchengdong
3b77128e65 arm/s32k3xx: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in arm/s32k3xx with
    spin_lock_irqsave_nopreempt() to improve code clarity and consistency.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-04 22:46:15 +08:00
wangchengdong
72fcae36c2 arm/s32k1xx: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in arm/s32k1xx with
    spin_lock_irqsave_nopreempt() to improve code clarity and consistency.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-04 22:46:15 +08:00
wangchengdong
268e67ce3d arm/kinetis: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in arm/kinetis with
    spin_lock_irqsave_nopreempt() to improve code clarity and consistency.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-04 22:46:15 +08:00
wangchengdong
8978be2939 arm/imx9: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt
Replace the spinlock/sched_lock pair in arm/imx9 with
    spin_lock_irqsave_nopreempt() to improve code clarity and consistency.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-11-04 22:46:15 +08:00
haitomatic
e7ad870f18 arch/risc-v/mpfs: Add MSS CAN driver.
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Refactor to  become lower half driver.

Signed-off-by: Hai To <hai.to@tii.ae>
2025-11-03 17:14:53 -03:00
haitomatic
967238ba2c arch/risc-v/mpfs: Add MSS CAN driver.
The Nuttx MSS CAN driver has an exclusive interface to the integrated MSS CAN peripheral residing in Polarfire SoC FPGAs. There are two CAN block 0 and 1 that can be configured for use. In normal mode (non AMP), CAN0 and CAN1 block base register addresses are 0x2010C000UL and 0x2010D000UL.

Signed-off-by: Hai To <hai.to@tii.ae>
2025-11-03 17:14:53 -03:00
Peter van der Perk
e6c982892b imxrt: make DTCM heap size configurable
By default, the full configured DTCM region is assigned to the heap for
dynamic allocation. In scenarios requiring deterministic memory regions
for static buffers or control structures, you can reduce the heap
allocation to reserve part of DTCM for manual/static use.
This kconfig symbol allows to limit the size.

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
2025-10-30 10:07:08 -04:00
Filipe Cavalcanti
680766d304 arch/xtensa: update SPI Flash driver for ESP32-S2|S3
Updates the SPI Flash driver used for user storage MTD.
Moves ESP32 and ESP32S3 to use common driver.
Updates KConfig options to keep backwards compatibility.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-10-29 09:44:55 -04:00
Filipe Cavalcanti
4ccae59e69 arch/risc-v: update SPI Flash driver for ESP32-C3|C6|H2
Updates the SPI Flash driver used for user storage MTD.
Updates board linker script and bring up.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-10-29 09:44:55 -04:00
kywwilson11
94e12d0142 arch/arm/stm32h5: Use au_receive_batch in adc_dmaconvcallback
The adc_dmaconvcallback routine was far too slow and inefficient. This was not caught until recently when I was testing faster sample rates. When in circular mode for the adc (dma and constant conversions), the adc_dmaconvcallback function would overwhelm the OS and lock it up. I looked into this and did a lot of testing. First I tried minimally improving the dma callback by removing the % operator from the algorithm, this was slow and inefficient. I also tried increasing the batch size considerably as well as the fifo size. This helped but the OS would still lockup with the fastest sample rate (5 Msps). au_receive_batch was the solution. In order to use this, I needed to change the dmabuffer to be of type uint32_t to match the data pointer in au_receive_batch. I also needed to create a channel buffer, which is initialized once in adc_setup. stm32_gpdma_cfg_s->tr1 needed to be updated for the uint32_t dmabuffer. Once I made changes to use au_receive_batch, I could reliably use the fastest sample rate without locking up the OS. Calling au_receive for every single conversion in a batch is far less efficient than calling au_receive_batch. I also snuck in some changes for the ADC watchdog defines and guards. These were fixes that were tested while testing these changes.

Signed-off-by: kywwilson11 <kwilson@2g-eng.com>
2025-10-29 13:37:14 +08:00
Matteo Golin
d13b10843a bcm2711/sdio: Support for EMMC interfaces on the BCM2711
This initial implementation sets up support for the EMMC interfaces on
the BCM2711. Only EMMC2 is tested since it is the interface of interest
(connects to uSD card). MMCSD communication is functional and the boot
partition of the SD card can be mounted and interacted with.
Insertion/removal interrupts do not fire after initial boot, and
sdstress fails with any byte size larger than 1023. 32GB card works
perfectly, while 64GB card exhibits strange behaviour when interacting
with VFAT filesystem.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-10-28 16:21:53 -03:00
simbit18
4e65e8a1f7 arch/tricore/src/tc397/CMakeLists.txt: nxstyle fix Relative file path
-fix Relative file path does not match actual file.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-10-28 13:38:04 -04:00
Stepan Pressl
cf0d962d9c samv7/mcan,emac: revision logic based on sam_has_revb_periphs
Some checks failed
Build Documentation / build-html (push) Has been cancelled
The sam_has_revb_periphs function is used to configure
the peripherals correctly.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-10-27 00:09:11 +08:00
Stepan Pressl
9fc84c250d samv7/sam_chipid: add sam_has_revb_periphs function
This function can identify (during the runtime) whether the chip
is revB or revA. Bear in mind PIC32CZ2051CA70 is always revB.
Allows to have one binary compatible with SAMV7 and PIC32.

Thanks to Pavel Pisa and Michal Lenc for the suggested code.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-10-27 00:09:11 +08:00
Lars Kruse
8c91052433 boards/arm/rp2040: allow flash write operation on rp2040 in SMP mode
Previously the function "up_cpu_pause" was used for preventing all other
CPUs from executing code from flash.
The above function was removed in d8cb7759.

Now flash operations work on rp2040 in SMP mode by blocking all but the
current CPU for the duration of the critical function (write or erase).

Closes: #16203

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2025-10-26 08:07:08 -03:00
kywwilson11
35d1aaafda arch/arm/stm32h5: STM32H5 PWM Driver (STM32H7 port)
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Adding the stm32h5 pwm driver. This is almost an exact copy of the stm32h7 pwm driver. I confirmed the timers for the h5 are version v2 and added the preprocessor definition. This commit was tested on a stm32h5 nucleo-h563zi development board. Necessary board files and a pwm config have been added. Added pin mappings for all timer outputs.

Signed-off-by: kywwilson11 <kwilson@2g-eng.com>

Added documentation regarding nucleo-h563zi:pwm config.

Removed CONFIG_STM32H5_PWM guard at the top. Fixed IRQs for tim1 and tim8. Added H5 to list of Timer IP v2 timers.

Conditionally compile stm32_serial.c.

Add stm32_pwm.c to CMakeLists.txt
2025-10-25 12:48:34 +08:00
simbit18
678cd54aa8 arch/arm/src/stm32h5: CMake build implemented for STM32H5 MCU series
- added STM32H5 MCU series

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-10-24 12:17:07 -04:00
Vlad Pruteanu
8a10e35c0b arch/xtensa/esp32: Fix support for hardware accelerated AES
Curently, the driver code for HW accelerated AES is not usable
since it's not registered within esp32_crypto. This commit fixes
it as well as a few bugs.

Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
2025-10-24 11:20:04 -03:00
Eren Terzioglu
a590599c7e arch/xtensa/esp32[-s3]: Add ULP RISCV coprocessor wakeup
Add ULP RISCV coprocessor wakeup support for esp32s3

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-10-24 11:16:11 +08:00
Eren Terzioglu
734068890a arch/xtensa/esp32[-|-s3]: Fix exception issue when pm active
Fix exception issue when PM and DEBUG_ASSERTIONS enabled for esp32 and esp32s3.
This error happens due to PM system workflow, when system gets into sleep-modes with
removing PM_NORMAL count, system is raising an exception for not having
enough number of PM_NORMAL state count if DEBUG_ASSERTIONS enabled.

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-10-23 09:38:26 -04:00
kywwilson11
aa8fb9ae2e arch/arm/stm32h5: Add defines for ADC_HAVE_WDG
AWD defines needed by stm32_adc.c were missing from PR #17007. This commit adds them in.

Signed-off-by: kywwilson11 <kwilson@2g-eng.com>
2025-10-23 20:46:20 +08:00
simbit18
bbe1d420a7 arch/risc-v/rp23xx-rv: CMake build implemented for Raspberry Pi RP2350 RISCV
- added Raspberry Pi RP2350 RISCV (Hazard3 RISC-V cores)

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-10-22 09:01:39 -04:00
Eren Terzioglu
7aaac3ed8e arch/risc-v/esp32[c6]: Add multiple ULP bin support for esp32c6
Add multiple ULP bin support for esp32c6

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-10-21 06:32:32 -03:00
Eren Terzioglu
24eeff91c0 arch/xtensa/esp32[-s2|-s3]: Add multiple ULP RISC-V bin support
Add multiple ULP RISC-V bin support for esp32s2 and esp32s3

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-10-21 06:32:32 -03:00
Eren Terzioglu
7403177473 arch/risc-v/espressif: Add ULP as char device to support multiple ULP bins
Add ULP as char device to change binary that runs on ULP

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-10-21 06:32:32 -03:00
Alexander Lerach
a9b258aa68 arch/arm/stm32h7: Fix UART TX DMA getting stuck
When closing a serial port an ongoing TX DMA transfer will be stopped. This can cause
one (or multiple) the following:

- dev->dmatx.length != 0
- dev->dmatx.nlength != 0
- stm32_dmaresidual returning a non-zero residual

This is caused by length/nlength not being set to 0 at startup or during closing.
In addition the DMA_SxNDTR register is not set to 0 at startup or during closing.

This commit solves the issue by setting the variables and register to 0 during closing.

Signed-off-by: Alexander Lerach <alexander@auterion.com>

arch/arm/stm32h7: Add review feedback regarding style

Removed non-needed spaces.
Aligned style of documentation.

Signed-off-by: Alexander Lerach <alexander@auterion.com>
2025-10-21 01:10:05 +08:00
wangchengdong
fca1010a5b arch/risc-v: remove duplicated nxsched_switch_context() call
The nxsched_switch_context() function should only be called
    when a task switch actually occurs. The RISC-V architecture
    already performs this call in riscv_perform_syscall(),
    so this PR removed the redundant nxsched_switch_context() call in
    up_switch_context().

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-10-21 01:05:33 +08:00
Tiago Medicci Serrano
fcb96babc5 risc-v/espressif/spi: Update common source code functions
Updates the common source code for the SPI peripheral used by
Espressif's RISC-Vs SoCs. This enables newer SoCs to be supported
in the future while maintaining backwards compatibility.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-10-21 01:03:36 +08:00
Tiago Medicci Serrano
fb93a9e4d0 arch/risc-v/espressif/i2s: Fix common driver issues
This commit refactors the I2S common driver for Espressif's RISC-V
SoCs. Previously, the peripheral was not working as expected.

Along with the new I2S character driver, this new I2S lower-half
driver can be easily tested using internal loopback between the
transmitter and receiver channels.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-10-17 17:05:38 -03:00
Thiago Finelon
42d5f10c0d arch/xtensa/esp32s3: expose UART RX FIFO controls
Adds Kconfig knobs for the ESP32-S3 RX FIFO full threshold and timeout and wires them into the UART driver.
Clears RX FIFO overflow interrupts by resetting the hardware FIFO so reception resumes cleanly.

Signed-off-by: Thiago Finelon <thiago.sfinelon@gmail.com>
2025-10-17 17:40:32 +08:00
chao an
a8af5f3d0e style/spell: fix spell checker error
To make checker happy:

arch/arm/src/sama5/sam_classd.c:997: nd ==> and, 2nd
arch/arm/src/sama5/sam_classd.c:1362: levl ==> level
drivers/sensors/apds9922.c:286: persistance ==> persistence

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-10-17 14:05:02 +08:00
chao an
87f134cfaa sched/sleep: replace all Signal-based sleep implement to Scheduled sleep
Nuttx currently has 2 types of sleep interfaces:

1. Signal-scheduled sleep: nxsig_sleep() / nxsig_usleep() / nxsig_nanosleep()
Weaknesses:
a. Signal-dependent: The signal-scheduled sleep method is bound to the signal framework, while some driver sleep operations do not depend on signals.
b. Timespec conversion: Signal-scheduled sleep involves timespec conversion, which has a significant impact on performance.

2. Busy sleep: up_mdelay() / up_udelay()
Weaknesses:
a. Does not actively trigger scheduling, occupy the CPU loading.

3. New interfaces: Scheduled sleep: nxsched_sleep() / nxsched_usleep() / nxsched_msleep() / nxsched_ticksleep()
Strengths:
a. Does not depend on the signal framework.
b. Tick-based, without additional computational overhead.

Currently, the Nuttx driver framework extensively uses nxsig_* interfaces. However, the driver does not need to rely on signals or timespec conversion.
Therefore, a new set of APIs is added to reduce dependencies on other modules.

(This PR also aims to make signals optional, further reducing the code size of Nuttx.)

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-10-17 14:05:02 +08:00
Filipe Cavalcanti
7297ecc02e arch/xtensa: add non-iram interrupt support for ESP32-S2
Adds support for enabling and disabling non-iram interrupts on ESP32-S2.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-10-16 17:06:05 -04:00
haitomatic
d6a169d6dd arch/arm64/src/imx9/imx9_flexcan.c: add CAN ID filtering.
Add simple single ID mask filter. Only pkts with set CAN ID are accepted. This works for both STD and EXT CAN ID.

Signed-off-by: haitomatic <hai.to@unikie.com>
2025-10-15 09:41:04 -04:00
Alan Carvalho de Assis
744ce66135 arch/stm32: Only compile stm32_serial.c when STM32_USART is enabled
When SEMIHOST_SYSLOG is enabled it creates its own up_putc() function
however the stm32_serial.c also creates this same function, even
when all STM32_USARTs are disabled. Fix patch fixes this issue.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-10-14 08:36:44 -04:00
Alan Carvalho de Assis
5d784a2abc arm/common: Fix arm_nputs.c to avoid mult. up_nputs() definitions
When SEMIHOST_SYSLOG is enabled up_nputs() could be defined twice.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-10-14 08:36:44 -04:00
Filipe Cavalcanti
df6e5384fe arch/xtensa: update MCUBoot and virtual E-Fuse offset
Updates MCUBoot version and default address for virtual E-Fuse, depending
if MCUBoot is enabled.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-10-14 17:44:15 +08:00
guoshengyuan1
79711737bc arch/init: call up_color_intstack before up_irq_enable
Make sure interrupt stack is colored before IRQ is enabled.

Currently, after calling irq_initialize in nx_start to
enable interrupts, there is still a period of execution
path before the interrupt stack is colored.

Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-10-14 17:42:01 +08:00
wangchengdong
4057d86e2b arch/tricore: Place nxsched_switch_context() at the correct location
Some checks failed
Build Documentation / build-html (push) Has been cancelled
The current implementation does not call
   nxsched_switch_context() exactly when a
   task switch occurs.

   This patch fixes the issue by placing the
   call at the correct location.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-10-13 14:47:28 -04:00
Stepan Pressl
cb2d591b42 stm32/stm32_usbdev.c: include arch/board/board.h
Without this, the compilation would fail for F302 chips.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-10-13 14:45:34 -04:00
raiden00pl
128401a733 arch: remove reference to non-existent readme
Remove the comment which is copy-paste from stm32/stm32_eth.c.

stm3240g-eval doesn't contain any valuable information about eth driver.
If we need to find an explanation of the configuration options, they are in
Kconfig files.

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-10-11 17:07:51 -04:00
chao an
4c7deedd27 sched/clock: remove return value of clock_systime_timespec()
clock_systime_timespec() always returns 0, so there is no need to
check the return value in the caller code, let us remove the return
value directly.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-10-10 23:15:27 +08:00
Jukka Laitinen
480cd623d9 arch/risc-v/mpfs: Enable caches by default on E51 core
E51 needs to use vendor specific CSR to enable L1 cache.

This adds the relevant register setting and makes it
configurable by CONFIG_MPFS_E51_ENABLE_CACHE. With this flag set, the L2
cache on E51 depends on the cache lane configuration. Disabling this flag
disables all caches on E51.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-10-08 11:46:24 -03:00