Commit graph

59273 commits

Author SHA1 Message Date
Halysson
9014af9ae7 libc/crc: Add crc8rohcincr for incremental CRC8 ROHC calculation
Add crc8rohcincr() function to support byte-by-byte CRC8 calculation
using the ROHC polynomial (0x07) without XOR inversions. This is
useful for protocols that require incremental CRC accumulation,
such as GSM 07.10 (CMUX), where the CRC must be computed as frames
are parsed from circular buffers.

Changes include:
- New crc8rohcincr() function for single-byte incremental CRC
- Function takes current CRC value and returns updated CRC
- Uses same g_crc8_tab table as other ROHC functions
- No XOR inversions applied for proper accumulation

This allows protocols like CMUX to replace local CRC table
implementations with standard libc CRC functions while maintaining
correct incremental calculation behavior.

Signed-off-by: Halysson <halysson1007@gmail.com>
2025-09-30 17:30:46 -03:00
p-szafonimateusz
68fdbef524 boards/x86_64/qemu-intel64: increase stack size for ostest
increase stack size for ostest configuration.
The default value is too small for x86 arch.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-09-30 17:26:57 -03:00
p-szafonimateusz
20c9ff679c fs/mmap/fs_mmap.c: fix errno when fd is not valid
mmap() should return EBADF errno when fd is not valid.
We can just return error code from file_get().

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-09-30 16:16:02 -04:00
p-szafonimateusz
0c9d0b3f84 sched/sig_pending: sigpending() should return caller pending signals only
Previously sigpending() returned all pending signals in the group, which is not
POSIX compliant. It should return signals pending only for the caller, so
a signal send with pthread_kill() intended for another thread should not be
returned (it's not pending for a caller).

This fixes the pthread_create.c/test9 test case from
PSE52 Open Group Threads Test Suite.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-09-30 16:15:49 -04:00
simbit18
3fb227d48e arch/arm/src/rp2040/boot2: Improvements rp2040_boot_stage2.cmake
Improvements in linker file name search

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-30 13:28:00 -04:00
simbit18
9bb0beda98 boards/arm/rp2040: CMake added Waveshare RP2040-LCD-1.28 board
Added CMake build for Waveshare RP2040-LCD-1.28

Fix: The relative path of the file does not match the
actual file
   - waveshare-rp2040-lcd-1-28-flash.ld
   - waveshare-rp2040-lcd-1-28-sram.ld

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-30 13:28:00 -04:00
p-szafonimateusz
041c50e1dd fs/mmap/fs_mmap.c: add missing NULL pointer
add missing NULL pointer for msync to match `struct mm_map_entry_s` definition

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-09-30 23:28:41 +08:00
p-szafonimateusz
729f2f890b fs/mmap/fs_mmap.c: MAP_PRIVATE or MAP_SHARED must be specified
MAP_PRIVATE or MAP_SHARED must be specified in flags according to standard

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-09-30 23:28:32 +08:00
p-szafonimateusz
a4c9fdc447 fs/mmap/fs_msync.c: don't flush changes if MAP_PRIVATE
changes should not be flushed to the underlying file if memory mapping is
marked as MAP_PRIVATE.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-09-30 23:27:52 +08:00
p-szafonimateusz
7439e49db8 fs/mmap/fs_munmap.c: return error if len is 0
munmap() shall return ERROR with errno = EINVAL if len is 0

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-09-30 23:27:45 +08:00
guoshengyuan1
3f55710184 arch: remove nxsched_resume_scheduler in cpustart
Idle thread initialization does not require calling nxsched_resume_scheduler

Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-30 23:26:28 +08:00
guoshengyuan1
b2a69ba781 sched: merge nxsched_suspend/resume_critmon
Merge suspend and resume into one switch to optimize performance

Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-30 23:26:28 +08:00
guoshengyuan1
c62861d383 sched: remove nxsched_suspend/resume_scheduler
move both suspned and resume logic to nxsched_switch_context

Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-30 23:26:28 +08:00
guoshengyuan1
13cbc9bf9d arm: remove nxsched_resume_scheduler in cpustart
Idle thread initialization does not require calling nxsched_resume_scheduler

Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-30 23:26:28 +08:00
Tiago Medicci Serrano
b4018f1714 risc-v/espressif/pcnt: Update common source code functions
Updates the common source code for the PCNT 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-09-30 23:25:25 +08:00
Tiago Medicci Serrano
646c06a0c2 risc-v/espressif/mcpwm: Update common source code functions
Updates the common source code for the MCPWM 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-09-30 23:25:01 +08:00
wangchengdong
f582d8efd0 arch/tricore: fix tricore running bug
Fix tricore running issue introduced by PR17060.

  The bug is that when irq returns, the running_task was not
  updated to the current task with highest priority from
  the scheduler  readytorun_list

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-30 17:37:00 +08:00
Filipe Cavalcanti
2e39707f3a arch/xtensa/espressif: fix Wi-Fi netpkt copy error
Fix an issue where netpkt copy would fail due to wrong
return checking condition.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-09-29 17:36:10 -04:00
simbit18
14dd308410 boards/arm/rp2040: CMake added Seeed, WIZnet and Waveshare boards
Added CMake build for:

-  seeed-xiao-rp2040
-  w5500-evb-pico
-  waveshare-rp2040-zero

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-29 17:35:10 -04:00
simbit18
1e5bbb437d boards/arm/rp2040: CMake added Adafruit boards
Added CMake build for:

-  adafruit-feather-rp2040
-  adafruit-kb2040
-  adafruit-qt-py-rp2040

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-30 01:08:57 +08:00
simbit18
4c545f1a63 boards: Fix Kconfig style
Remove spaces from Kconfig
Add TABs
Add comments

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-29 10:56:58 -03:00
simbit18
fafbbfe337 arch/arm/src/stm32h7: Fix Kconfig style
Remove spaces from Kconfig
Add TABs
Add comments

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-29 10:56:58 -03:00
simbit18
fc15bf87a2 arch/risc-v: Fix Kconfig style
Replace help => ---help---

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-29 10:56:58 -03:00
guoshengyuan1
ca7608c2ac sched/irq: add a check for the interrupt stack in irq_dispatch
After irq_dispatch finished, the interrupt stack will be checked to
determine whether overflow occurs.
The relevant configuration reuses the configuration of stack overflow
detection during context switching.

Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-29 19:12:18 +08:00
wangjianyu3
a0ffe03ec5 nuttx/list: Add list_for_every_entry_from()
Iterate over the list of the given type,
continuing from the current position.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-09-29 19:11:48 +08:00
Matteo Golin
504ec6b2c6 arch/udelay: Make common, weak definition of up_*delay functions
Many different architectures re-implemented the exact same code for
`up_*delay` because it was originally written as architecture dependent
code. Busy-waiting can be done regardless of architecture, so this
commit moves that duplicated implementation to a common file with weak
definitions so that individual architectures (see tc32) are still able
to override the definition if needed/desired.

Default implementation is not included if ARCH_TIMER is enabled, since
it is more accurate and provides its own weak definitions to override.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-09-29 09:22:56 +08:00
simbit18
893cf19356 tools/ci/testlist: skip the build of <board>:cxxtest
Problems downloading the uClibc++-0.2.5.tar.bz2 package

cURL error 60: SSL certificate expired

net::ERR_CERT_DATE_INVALID
Subject: cxx.uclibc.org

Issuer: R10

Expires on: 27 set 2025

This blocks the jobs:

- arm-12
- sim-02

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-28 12:47:09 -04:00
Alin Jerpelea
e2fd695710 Documentation: add NuttX-12.11.0 release notes
Add release notes for 12.11.0 release

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2025-09-28 20:52:20 +08:00
Matteo Golin
e10c79b744 rpi4b/autoleds: Auto-LED implementation
Added autoled implementation for the Pi4B. Status LED is used as NuttX
start indicator, while power LED is used for panic/assert indication.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-09-28 10:06:02 +08:00
Matteo Golin
706d389b37 bcm2711/mailbox: Implementation for mailbox API
A basic implementation of mailbox API with some helpers for accessing
properties implemented. Uses busy-wait due to documentation challenges
with mailbox API.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-09-28 10:06:02 +08:00
wangjianyu3
040e661200 nuttx/list: Update parameter names for list_for_every_entry_continue()
Update the parameter names of the macro `list_for_every_entry_continue()`
to maintain consistent naming:
  - list => entry
  - head => list

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-09-27 21:44:43 +08:00
wangjianyu3
2710ff789c nuttx/list: Add list_prepare_entry()
Add `list_prepare_entry()` to prepare entry for use in
`list_for_every_entry_continue()`.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-09-27 21:44:43 +08:00
Tiago Medicci Serrano
1519d6c80b risc-v/espressif/i2c: Update common source code functions
Updates the common source code for the I2C 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-09-27 21:43:33 +08:00
trns1997
d7b2df6d85 ci/cxx: Add out-of-tree build CI test.
Introduce a new CI test to validate out-of-tree builds
and prevent regressions in the `make export` workflow.
Specifically, this change adds `test-oot-build.sh` that:
* Builds NuttX using a selected configuration.
* Runs `make export` to generate the export package.
* Copies the `nuttx-export` to the OOT build project.
* Verifies that compilation and linking succeed.

Signed-off-by: trns1997 <trns1997@gmail.com>
2025-09-27 21:36:22 +08:00
guoshengyuan1
a3e63c44dd Document: add information for stack overflow check on context switching
Updated documentation to explain how to enable detection during context switching.

Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-27 12:56:11 +08:00
guoshengyuan1
5d7ac216f2 arch: optimize up_check_tcbstack for stack overflow detection
Many times, context switching does not occur when the thread stack
memory is almost exhausted, so we need to mofify up_check_tcbstack to
accurately detect it.

Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-27 12:56:11 +08:00
guoshengyuan1
6f478a9e25 sched: detecting stack overflow during context switching
Added two detection methods:

1. Determine by detecting the number of bytes specified at the bottom of the stack.
2. Check if the `sp` register is out of bounds.

Co-authored-by: Chengdong Wang <wangchengdong@lixiang.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-27 12:56:11 +08:00
simbit18
1fb533611d arch/arm/src/rp2040/boot2: Improvements rp2040_boot_stage2.cmake
Improvements in the linker file search

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-26 21:17:06 -04:00
simbit18
0a5336a9f1 boards/arm/rp2040: CMake added pimoroni-tiny2040 board
Added CMake build for pimoroni-tiny2040 board

Removed old file rp2040_tiny2040.h to use the existing rp2040_pico.h to align with other boards.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-26 21:17:06 -04:00
wangchengdong
46292a9529 arch/tricore: Remove tasking compiler tool specific code from
common Cmake scripts

      Remove tasking compiler tool specific code from
      common Cmake scripts

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-26 13:26:31 +02:00
wangchengdong
0b1f774519 arch/tricore: Fix tricore arch build error
Fix the tircore arch build error introduced by PR17060

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-26 13:26:18 +02:00
Matteo Golin
615f1f3f46 drivers/sensors/ms56xx: Replace custom curtime with standard function
The custom implementation of obtaining a timestamp for this driver
returned an unsigned long, which limited the amount of time the driver
could run before roll-over quite significantly (since timestamps are in
microseconds). This change standardizes the driver to use the sensor
driver implementation for timestamps.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-09-26 12:14:32 +02:00
kywwilson11
09290b9254 arch/arm/stm32h5: ADC Driver Improvements
Added ioctls and functions for watchdogs 2 & 3. Modifed wdog1 functions. Needs testing.

Fixed issues with started variable.

Change to add only 3 ioctls, a config for each watchdog. Created cfg structures for watchdog1 and watchdog23. Added code to set difsel register. stop conversions before changing watchdog configs. Other logic changes.

Define AN_STM32H5_FIRST and AN_STM32H5_NCMDS in nuttx/analog/ioctl.h

Remove hardcoded AN_STM32H5_FIRST.

Style fixes.

Fix thershold for watchdog1

Got working watchdog driver with queue and signal. Needs polish.

Refined isr for watchdogs. Added value back to event. value is more accurate, but not guaranteed. It accomdates dma.

Used stm32_adc_sigcfg_s structure inside stm32_adc_sig_s structure. Used common naming for ioctls.

Added stopifstarted and startifstopped for setting watchdogs and other bits. Added adc_reset_dma, which must be run after stopping conversions in circular mode, because buffer and conversions become misaligned. Other refinements.

Added guard around adc_reset_dma, added comment blocks to new functions

NuttX style fixes.

Add return value to wdog configure functions.

Correct number of stm32h5 adc ioctls.

Minor style fix.

Reduce watchdog commit to fit NuttX standards. Remove Queue and Signal aspects. Added Kconfig to initialize watchdog.

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

Added guard around code referencing priv->circular. Added adc_watchdog config for testing watchdog1 with adc1. Added documentation about adc_watchdog config.

Adjusted documentation for adc_watchdog config. Added detailed test procedure.

Longer underline under adc_watchdog title.

Add code for differential adc calibration. Need to calibrate both single-ended and differential if a given adc has both single-ended and differential channels.

Fixed typo.

Initialize watchdog1 parameters at compile time when configured. Added comments to new elements in stm32_dev_s. Confirmed style is good.

Add proper guards around ADC WDG1 variables and functions.

Implemented feedback per raiden00. 1. Changed to use old chanlist type uint8_t. 2. Added smpr1, smpr2, and difsel variables to stm32_dev_s structure. 2. smpr1 and smpr2 are initialized to board defined values if BOARD_ADCx_SMPRx is defined, otherwise initialized to default. 3. difsel initialized to BOARD_ADCx_DIFSEL if defined, otherwise use default (0) for all single-ended.
2025-09-26 17:35:08 +08:00
wangchengdong
def0092f7b arch/tricore: Allow Make to gen .srec and .hex for tasking compiler
Allow Make to gen .srec and .hex for tasking compiler

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-26 13:15:15 +08:00
wangchengdong
d243322f57 CMake: Move global compiler flags setting before add_executable()
Global compiler flags setting should be placed before add_executable(),
   otherwise they will not take effect

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-25 20:47:26 +08:00
guoshengyuan1
6a57c56925 arch: replace all nxsched_suspend/resume_*** with nxsched_switch_context
Complete the missing scheduling information in some architectures

In these architectures (riscv, avr, tricor) context switching
can occur in both up_switch_context and xx_doirq

Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-25 16:40:23 +08:00
guoshengyuan1
7c01281757 arm: replace all nxsched_suspend/resume_*** with nxsched_switch_context
The arm-m architecture svc call will trigger an interrupt,
and the actual context switch is executed after doirq is completed,
so only the scheduling information needs to be updated in doirq.

In the arm-a/r architecture, interrupts and syscalls are independent,
and scheduling information needs to be updated in both locations

Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-25 16:40:23 +08:00
guoshengyuan1
fc15b8da8a arch: unify the scheduling information of task_exit
Replace all nxsched_suspend/resume_*** with nxsched_switch_context

Delete nxsched_resume_scheduler in up_exit and call it uniformly in task_exit

Co-authored-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: guoshengyuan1 <guoshengyuan1@xiaomi.com>
2025-09-25 16:40:23 +08:00
95efa6f7cf net/mdio: add mdio bus
Currently the mdio communication is part of the monolithic 'full netdevs'.
This commit serves as an way to add modularity for the netdevs drivers.
A new upperhalf/lowerhalf mdio device comes with this commit that manages the data transfer ofer mdio interface.

Signed-off-by: Luchian Mihai <luchiann.mihai@gmail.com>
2025-09-25 16:24:18 +08:00
Tiago Medicci Serrano
c8b7950bd4 risc-v/espressif/uart: Update common source code functions
Updates the common source code for the UART 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-09-25 09:27:53 +08:00