Commit graph

59136 commits

Author SHA1 Message Date
Thiago Finelon
2713c5e9df boards/esp32s3: Add SPI slave device support
- Added esp32s3_board_spislavedev.c with board-level SPI slave logic
- Added esp32s3_board_spislavedev.h public header in common/include
- Updated Make.defs to include the new source when CONFIG_SPI_SLAVE_DRIVER=y
- Adding spislv board config to esp32s3-devkit
- Adding documentation of esp32s3 devkit spi slv
- Fixing path include in esp32s3_board_spislavedev.c
- Fixing relative path in the header of esp32s3_board_spislavedev.h
- Removing neasted check in Make.defs, consistency reasons

This provides initial support for SPI slave device initialization
on ESP32-S3 boards, making the feature available under conditional
build configuration.

Signed-off-by: Thiago Finelon <thiago.sfinelon@gmail.com>
2025-08-20 14:50:30 -03:00
Niccolò Maggioni
06cc058b61 Documentation/platforms/rp2350: Update the docs for pico-sdk 2.2.0
Bump the version referenced in the commmands and add some tips.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-20 12:24:35 -03:00
Niccolò Maggioni
a6b8210580 Documentation/platforms/rp2040: Update the docs for pico-sdk 2.2.0
Bump the version referenced in the commmands and add some tips.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-20 12:24:35 -03:00
Niccolò Maggioni
093f4d3688 arch/arm/rp2040: Update include paths for pico-sdk 2.2.0
Version 2.2.0 of the SDK unified some headers under a new path.
Now both the old and the new paths are searched during compilation.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-20 12:24:35 -03:00
Jukka Laitinen
0dbbce3a8f sched: Remove unnecessary affinity restriction & restoration over smp calls
When the task has TCB_FLAG_CPU_LOCKED it is locked to the CPU regardless
of the affinity. There is no need to switch the affinity back and forth.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-20 10:16:43 +08:00
Jukka Laitinen
4cc384757b sched: Change SMP list "g_assignedtasks" to a vector
Since g_assignedtasks only holds the running task for each CPU, it can
be just a vector. Idle tasks are already preserved in statically allocated
structures "g_idletcb", and can be used from there.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-20 10:16:43 +08:00
Jukka Laitinen
142f32121a sched: Remove pending list for CONFIG_SMP
This fixes several places, where the sched erroneously checks if the scheduling
is locked on current cpu/task, when it should check if the scheduling is locked
on the target cpu/task.

The original code randomly caused a task to be added to the pending list, and never
taken out from there, leading to system halt.

For SMP, there is no need for the pending list. Each CPU has got it's own
running list (assigned tasks list), and pending tasks can just be kept in
the unassigned (readytorun) list.

In addition, the smp scheduling is changed in a way that every CPU just picks
up the tasks from the ready-to-run list themselves. Which task to pick is
not tried to be dictated by another CPU.

This also allows using up_send_smp_sched for asynchronously
- re-prioritizing a running task
- triggering round robin scheduling switch

Iow, no separate smp call mechanism is needed for those and the code can be simplified.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-20 10:16:43 +08:00
Jukka Laitinen
3e29996d97 sched: After nxsched_add_readytorun, change first parameter to up_switch_context to this_task()
Change every occurence of up_switch_context to use this_task() as the first parameter.

"nxsched_add_readytorun" returns "true" if context switch is required. "nxsched_add_readytorun"
typically could only switch the assigned/running task to the one which is passed in as parameter.
But this is not strictly guaranteed in SMP; if other CPUs tweak with affinities or priorities,
it may be possible that the running task after the call is changed, but is some other
task from the readytorun list (and it should be, if there is higher priority one available or the
affinity of the added task prevents it to be scheduled in, but the previous head of the readytorun
list should run.

this_task() is always the correct one to switch to, since it always points to the tcb which was
just switched in by the nxsched_add_readytorun.

This is also a precursor to re-writing the SMP queue logic to remove pending lists for SMP.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-20 10:16:43 +08:00
Jukka Laitinen
f55e6f6383 sched: Remove race condition in sched_unlock
When exiting schedlock, that task should first take the critical section and
only after that decrease the lockcount to 0. Otherwise an interrupt might
cause a re-schedule before the task enters the critical section, which makes
the following code meaningless.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-20 10:16:43 +08:00
Niccolò Maggioni
3ba6047e29 drivers/sensors/tmp112: Add support for TMP112 temperature sensor
Add support for the Texas Instruments TMP112 I2C/SMBus digital
temperature sensor. Also add a new defconfig that includes
support for a TMP112 sensor and extend the existing documentation
to include its description.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-19 19:45:32 -03:00
simbit18
2b3741d083 drivers: Fix Kconfig style
Remove spaces from Kconfig
2025-08-19 19:44:31 -03:00
simbit18
015e013447 arch/arm: Fix Kconfig style
Remove spaces from Kconfig
Add TABs
2025-08-19 19:44:31 -03:00
simbit18
d3d1f67198 drivers/analog/CMakeLists.txt: Aligned Cmake with Make
Add:

Texas Instruments ADS1115

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-19 19:07:30 -03:00
Niccolò Maggioni
0f005b7b8c tools/ci: Include fetching pico-sdk in the CI environment setup
The Raspberry Pi pico-sdk was not available in the CI build process,
so the test builds for the rp2040 and rp2350 uCs could not execute the
last packaging stage. The SDK is now fetched and included, both at
runtime and in the Docker image.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-20 02:23:37 +08:00
Tiago Medicci Serrano
d250808c1c esp32s3/elf: Fix ELF loader on ESP32-S3 when using external PSRAM
Prior to this commit, it wasn't possible to load ELF modules from
the external PSRAM. There were two main issues about it: 1) copying
data using the instruction bus was being used instead of the data
bus (this, per si, isn't a problem, but requires special attention
regarding data alignment), and 2) the cache was not being properly
cleaned and flushed to properly access the loaded data using the
instruction bus.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-08-20 02:23:03 +08:00
Tiago Medicci Serrano
60ca804b56 esp32s3: Fix bug related to the PSRAM-allocated task stack
If both SPI Flash support (`CONFIG_ESP32S3_SPIFLASH`) and PSRAM
(`CONFIG_ESP32S3_SPIRAM`) are enabled, the PSRAM can only be
assigned to the user's heap (`CONFIG_ESP32S3_SPIRAM_USER_HEAP`).
Additionaly, `CONFIG_ESP32S3_SPI_FLASH_SUPPORT_PSRAM_STACK` must be
set because the system will end up allocating tasks' stacks from
the external PSRAM. This has an impact when dealing with SPI flash
operations because the cache must be disabled and the running task
should not rely on any data from the PSRAM. To accomplish that, It
offloads the SPI flash operation to a work queue (which, by
definition, allocates its heap from the kernel heap).

The same (assigning the PSRAM to the user's heap) is valid when the
Wi-Fi is enabled because the lower-half driver requires data being
allocated from the internal memory (which can only be achieved by
allocating from the kernel heap when both the kernel and user heaps
exists).

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-08-20 02:23:03 +08:00
Tiago Medicci Serrano
843b21c654 boards/xtensa/esp32s3: Add missing board_memorymap.h
This commit adds the missing `board_memorymap.h` file for all the
ESP32-S3's boards. This header file is necessary whenever Wi-Fi
is enabled, for instance.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-08-20 02:23:03 +08:00
zhanghongyu
e953bbd47c Dockerfile: fix matter build error
when the version of nodejs used during the installation of the dependency
library is too different from the version of nodejs actually used, we may
encounter version incompatibility issues, resulting in a runtime crash.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-08-19 14:05:54 +08:00
Stepan Pressl
637f15ff3c Make/Toolchain.defs: add the AR_EXTRACT command
Use this command to extract archives.
Not all architectures are modified, only those commands I know
or could be logically deducted from the rest were added.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-08-19 09:47:44 +08:00
dependabot[bot]
f6585e8281 build(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [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/v4...v5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-18 20:28:20 +08:00
Ville Juven
67b17cb4d7 mpfs/mpfs_usb.c: Fix interrupt handling in SMP mode
The interrupt handler accesses the device as well as the driver's private
data. Thus, must take the big kernel lock in SMP mode to protect them.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-18 20:27:20 +08:00
Ville Juven
72bba3b2ee mpfs_emmcsd/coremmc.c: Fix interrupt handling in SMP mode
In SMP mode one CPU can be executing the MMC interrupt while another CPU
disables (e.g. via watchdog timeout). As it is disabled the other CPU
assumes it's safe to start configuring the device after this.

This causes a leak in the driver's private data as well as a mutual
exclusion leak on the device itself.

Fix this by aborting any triggered interrupt by checking whether it's
even enabled.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-18 20:27:20 +08:00
Antoine Juckler
53d7fab355 arch/stm32f7: Fix I2C4 SDA pin assignment.
Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-08-17 21:41:33 +08:00
Jorge Guzman
44b65cbafd boards/qemu-armv8a: Add xedge example program and documentation
- Add documentation for xedge example program
- Add defconfig to run xedge with qemu-armv8a board

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2025-08-16 10:59:57 -03:00
Jorge Guzman
433b7170fe ci: add zip package to Docker environment 2025-08-16 20:21:27 +08:00
Serg Podtynnyi
2437771de5 boards/risc-v/rp23xx-rv/common: update board reset via BOOTROM functions
Update board reset with BOOTROM functions calls
 - normal reboot
 - reboot to bootloader

normal reboot and reboot bootloader now possible from nsh

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2025-08-16 08:56:21 -03:00
lipengfei28
1013faac30 pci: epf test default a function
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-16 19:49:08 +08:00
Eero Nurkkala
581d667f72 risc-v/mpfs: usb: don't try nonexistent ep int flags
Currently the irq handler checks many reserved bits, which is
a waste of resources:

1. pending_rx_ep bit 0 is reserved (always 0)
2. pending_rx_ep and pending_tx_ep have only bits 1, 2, 3 and 4
   defined, no need to scan MPFS_USB_NENDPOINTS (9) bits as the
   rest are reserved

Fix this by checking only the relevant bits.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-16 08:41:59 -03:00
Eren Terzioglu
21787b49f0 arch/xtensa/esp32s2: Remove duplicated lines to fix warning
Remove duplicated lines to fix build warning for esp32s2

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-08-16 08:41:18 -03:00
Eren Terzioglu
a316636dcf boards/xtensa: Revert mdtblock initialization for esp32[-|-s2|-s3]
boards/risc-v: Revert mdtblock initialization for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-08-15 16:42:46 -03:00
Eren Terzioglu
680abacd1f boards/risc-v: Revert mdtblock initialization for esp32[-c3|-c6|-h2]
boards/risc-v: Revert mdtblock initialization for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-08-15 16:42:46 -03:00
Jukka Laitinen
85f6f4bca2 arch/risc-v/src/mpfs/mpfs_userspace.c: Map MTIME into userspace reserved IO area in protected build
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-08-15 09:18:34 -03:00
Jukka Laitinen
d62e500940 boards/risc-v/mpfs/icicle: Add USRIO area for userspace IO mappings
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2025-08-15 09:18:34 -03:00
nuttxs
7470fd9274 sys/socket.h: Since ss_family is of type uint16_t (2-byte alignment),
packing the internal substructures will reduce the overall alignment of
`sockaddr_storage` to 2, which triggers an unaligned access warning
in 32-bit systems.
Add an overall 8-byte alignment to the outermost layer of the structure.

Related commit: 855336bf
Refer to https://datatracker.ietf.org/doc/html/rfc2553#section-3.10

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-08-15 09:59:19 +08:00
Jari Nippula
93c1e0c633 arch/risc-v/src/mpfs/mpfs_emmcsd: ignore WRCOMPLETE
As emmcsd driver does not support separate WRCOMPLETE interrupt the
SDIOWAIT_WRCOMPLETE event shall not be waited.
The SDIOWAIT_TRANSFERDONE event indicates that both "transfer done"
and "write complete" events are completed.
2025-08-15 02:23:23 +08:00
Jari Nippula
31f691e9ed arch/risc-v/src/mpfs/mpfs_coremmc: MPFS_FPGA_FIC0_CLK defined as config value 2025-08-15 02:23:23 +08:00
Jari Nippula
96298efac8 arch/risc-v/src/mpfs/mpfs_coremmc: clock, buswidth and fifo depth fixed
4bit bus width support and FIC0 clock is 125MHz
VR register fifo depth bitfields 5:4 instead of 3:2
2025-08-15 02:23:23 +08:00
Jari Nippula
5020572871 arch/risc-v/src/mpfs/mpfs_coremmc: Remove data line check from sendcmd
mpfs_sendcmd() shall not wait for data lines ready before
sending commands to the card. This prevents mmcsd driver
to poll card busy status prior to next activity after
a write operation.
2025-08-15 02:23:23 +08:00
Côme VINCENT
5cc01bb562 arm/stm32h7: update makefile for capture & config name
Add capture source files to the makefile pipeline.
STM32H7_CAP to STM32H7_TIMX_CAP for clarity.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-14 20:46:37 +08:00
Côme VINCENT
bebcfa0f46 docs(h743zi/capture): add capture driver docs
Add documentation for changes made in #16809.
Add an example defconfig for a nsh build with the capture example.
Replace the STM32H7_CAP option with just CAPTURE as the guard for the
lower half driver.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-14 20:46:37 +08:00
Niccolò Maggioni
7ea3f8e333 arch/arm/rp2040: Support non-sequential ADC channels and standardize internal function names
Enabling a higher channel of the internal ADC had the effect of
initializing the lower ones as well. Now that happens only if
actively requested.

Also, the functions for handling the internal ADC did not follow
the typical naming used by comparable modules for the same arch
and were renamed for coherence. Informational logging calls were
also made slightly more useful and discernible in case of having
multiple ADCs.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 23:23:17 +08:00
Niccolò Maggioni
fa9f771a0f arch/arm/rp2040: Implement GPIO output override functionality
Add support for the RP2040's GPIO output override capabilities.
Implementation inspired by the uniqueid functions for the same arch.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 23:21:35 +08:00
Jukka Laitinen
8a157d7514 arch/arm64_schedulesigaction.c: Fix signal delivery in EL1 when MMU is enabled
When delivering a signal to a kernel task, or in CONFIG_BUILD_FLAT with MMU
enabled, the REG_SCTLR_EL1 needs to be stored for exception return.

Otherwise 0 is restored to the register at exception return, MMU is switched off
and the  system crashes.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-13 23:12:30 +08:00
Niccolò Maggioni
83dd57a488 crypto/hmac: Fix typo in function implementation names
"hmac" was mistyped as "hmca", breaking linking to some prototype
functions. Also, a couple of includes were missing.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 23:11:02 +08:00
Ari Kimari
6f38806a5d arch/arm64/imx9: Fix first trace
Swap board init and uart init.
Reason is that trace might be used on board init.

Signed-off-by: Ari Kimari <ari.kimari@tii.ae>
2025-08-13 10:59:46 -03:00
Niccolò Maggioni
1dfe1f16c6 arch/arm/rp2040: Fix Kconfig ADC options names
The string "RPC2040", presumably a typo, was used in place of "RP2040".

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 13:18:32 +02:00
Niccolò Maggioni
be71e3d019 arch/arm/rp2040: Fix typos in ADC and GPIO macros usage
The strings "RPC2040" and "RP2040_IO_BANK0_GPIO0", presumably typos,
were used in place of respectively "RP2040" and "RP2040_IO_BANK0_GPIO".

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-13 13:18:32 +02:00
Andrew Scheller
3c313a316b Documentation/platforms: RP2350 doesn't contain an RTC.
Signed-off-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2025-08-13 01:47:49 +08:00
Andrew Scheller
c46282bb6c Documentation/platforms: RP2040, RP2350 and Pico products are made by Raspberry Pi, not Raspberry Pi Foundation.
Signed-off-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
2025-08-13 01:47:49 +08:00
Côme
25fe6b0749 Update capture.c 2025-08-12 20:21:14 +08:00