Commit graph

59062 commits

Author SHA1 Message Date
Jukka Laitinen
80cb2cf9c6 arch/xtensa/esp32,esp32s3: Start the "spiflash_op" thread with correct affinity
Set the affinity of the task before activating it. There is no parameter
or other interface in "kthread_create" to set the affinity mask,
like in "pthread_create".

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-22 15:46:47 -03:00
Alan Carvalho de Assis
eec50c183c build.yml: Excludes the workflow run if the file is CONTRIBUTING.md
CI does not compile everything for a simple modification of the CONTRIBUTING.md file.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-08-22 23:29:15 +08:00
lipengfei28
d45dfb8a9e arch/arm64: porting config iomux use scmi form arm imx95
pinctrl use same format scmi and config regs

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-22 20:54:05 +08:00
lipengfei28
c90349348e arch/arm64: porting config clock use scmi form arm imx95
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-22 20:54:05 +08:00
lipengfei28
909d9f1351 arch/arm64: porting mu drv and scmi from arm imx9
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-22 20:54:05 +08:00
p-szafonimateusz
92186c1942 Documentation/posix.rst: fix typos
fix typos in Documentation/standards/posix.rst

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-08-22 20:50:13 +08:00
p-szafonimateusz
9fd1478a99 pthread: add pthread_{get|set}concurrency support
Add support for pthread_{get|set}concurrency support.

NuttX uses 1:1 threading model (every pthread is a kernel-managed thread),
so this function has no real effect on the scheduling behavior.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-08-22 20:50:13 +08:00
p-szafonimateusz
b1e03bca0c libc: add support for sigsetjmp() and siglongjmp()
Add support for sigsetjmp() and siglongjmp().

This implementation is build on top of setjmp() and longjmp().
sigsetjmp() in that case must be implemented as a macro otherwise
we lose setjmp context.
siglongjmp() is kept as inline function to satisfy the PSE52 VSX
tests requirement.

An alternative implementation requires writing these function in
assembly code for each architecture.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-08-22 20:50:13 +08:00
p-szafonimateusz
396f5b40ce unistd: add support for confstr()
add support for POSIX defined confstr()

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-08-22 20:50:13 +08:00
p-szafonimateusz
8108aad1a4 pthread: add pthread_attr_{get|set}guardsize support
This commit adds simple implementation of guardsize for pthreads.
At this moment this option simply increases the size of allocated pthread stack.

At default pthread guard size is set to 0.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-08-22 20:50:13 +08:00
nuttxs
46bbde02b1 esp32/esp32_spiflash.c: during the SPI Flash erasure operation, task
scheduling (yield) is added to prevent the Watchdog Timer from
triggering a reset due to timeout

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-08-22 20:47:03 +08:00
simbit18
95f1cf4748 drivers/spi/CMakeLists.txt: Aligned Cmake with Make
Add iCE40 driver #12012

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-22 08:18:50 -03:00
p-szafonimateusz
4ed174a7e0 drivers/can/kvaser_pci.c: configure number of passes in interrupt handler
Configure number of passes in interrupt handler logic to avoid losing RX frames
in QEMU environment.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-08-22 15:34:38 +08:00
“wangchengdong”
e2cdb7ef34 arch/tricore: add up_trigger_irq
Add up_trigger_irq in arch/tricore/src/common/tricore_irq.c
  Select ARCH_HAVE_IRQTRIGGER in config ARCH_TC3XX
2025-08-22 15:04:06 +08:00
Niccolò Maggioni
86c466b6bc tools/rp{2040,23xx}: Ensure that picotool is found or built
The current logic failed silently on some systems, maybe because of a
different default shell? This resulted in builds that completed
successfully but generated invalid UF2 files, which were refused by
the uC bootloader.

Now the check is properly enforced and picotool is either found in
the $PATH or built from the pico-sdk source.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-22 00:30:28 +08:00
Niccolò Maggioni
3e70a7edc7 boards/arm/rp2040: Add ADS7046 example config
Add a new defconfig that includes support for an ADS7046 sensor
and extend the existing documentation to include its description.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-22 00:29:55 +08:00
Niccolò Maggioni
7a2343f1be drivers/analog/ads7046: Add support for ADS7046 ADC
Add support for the Texas Instruments ADS7046 12-bit, SPI-compatible ADC.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-22 00:29:55 +08:00
Niccolò Maggioni
f43c943ebe arch/arm/rp2040: Silence "LOAD segment with RWX permissions" linker warnings
This arch uses code relocation to SRAM through a XIP unit, so forcing segment
permissions manually in the linker script could create unforeseen issues.
A quick fix is setting the "--no-warn-rwx-segments" linker option just for
for the incriminated stage2 bootloader binary.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-22 00:27:12 +08:00
nuttxs
0ff26f0850 esp32/esp32_partition.c: based on the latest revision, in the ESP32 compilation
environment, uint32_t is defined as long unsigned int (i.e., unsigned long)

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-08-22 00:26:46 +08:00
“wangchengdong”
057b483350 include/nuttx/compiler.h:
fix nooptimiziation_function definition problem for tricore gnu compiler
arch/tricore:
	move tricore_csa2addr and tricore_addr2csa definition from include/arch.h to include/irq.h to fix build error
2025-08-21 08:34:13 -03:00
v-tangmeng
7e258621df arch/arm: Add missing barriers.h
This commit adds the missing `barriers.h` for arm.

Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
2025-08-21 08:32:52 -03:00
“wangchengdong”
8f5c0d5da3 arch: Add Cmake build support for raspberrypi-4b board & bcm2711 chip
Add:
arch/arm64/src/bcm2711/CMakeLists.txt
boards/arm64/bcm2711/raspberrypi-4b/CMakeLists.txt
boards/arm64/bcm2711/raspberrypi-4b/src/CMakeLists.txt
2025-08-21 17:43:31 +08:00
Jorge Guzman
46d415698d Documentation/xedge_demo: Fix RST formatting issues
Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2025-08-21 17:43:09 +08:00
simbit18
337c1128db drivers/ioexpander/CMakeLists.txt: Aligned Cmake with Make
Add:

iC-JX driver #11590

ISO1H812G driver #10426

ISO1I813T driver #10435

PCA9557 driver #16042

mcp23008 driver #10532

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-21 15:22:50 +08:00
simbit18
50bbad510a drivers/leds/CMakeLists.txt: Aligned Cmake with Make
Add:

KTD2052 led driver

#16217

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-21 13:23:41 +08:00
simbit18
d54fb6ad00 drivers/audio/CMakeLists.txt: Aligned Cmake with Make
Add:

fake audio driver

https://github.com/apache/nuttx/pull/15295

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-21 13:22:26 +08:00
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