Commit graph

57910 commits

Author SHA1 Message Date
Laczen JMS
04698fcc00 net/udp: correct icmp(v6) response from udp_input
Ensure that the correct icmp(v6) response is generated from udb_input.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-03-26 19:23:44 +08:00
Eritque arcus
fb562cfbad typo: fix incorrect doc 2025-03-26 19:23:33 +08:00
Javier Casas
1ec3ab357c net/can: Fix NULL dereference for I/O Block
In a recent patch the socketcan timestamp generation was moved
to add it also when there is an active reader (previously the timestamp
was only added before storing the CAN frame in the read-ahead list).

It was working fine but I realized that the can_callback function is
also called when sending frames. In this case, the IO block is not allocated
yet and the code breaks.

This PR is to only generate the timestamp if the IO block is not NULL
(reading path) and skip it when it is NULL (sending path)

Signed-off-by: Javier Casas <javiercasas@geotab.com>
2025-03-26 19:23:24 +08:00
chenrun1
9048230361 fs/virtio-9p:When virtio-9p is not supported, return -ENODEV
Summary:
  When the operating environment does not support virtio-9p and the virtio-9p server driver is not provided, -ENODEV should be returned for virtio-9p to avoid crash caused by continued execution.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2025-03-26 19:23:14 +08:00
simbit18
9b19f44dbf tools/mksyscall: fix 106: Unexpected end of line: "FAR char * co"
line 106 exceeds the 256 character limit

106: Unexpected end of line: "FAR char * co"
make[1]: *** [makefile:108: .context] Error 4
make[1]: Leaving directory 'C:/nxtest/nuttx/syscall'
make: *** [tools/Win.mk:468: syscall\.context] Error 2

fixed tools/csvparser.h from

to

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-03-26 19:23:03 +08:00
Javier Casas
69dfc25710 net/can: fix timestamp
Fix timestamp in socket CAN. Right now the timestamp is only generated
if there is no reader and the frame is stored in the read ahead list.
This is solved by moving the timestamp generation before the code flow
branch.

Signed-off-by: Javier Casas <javiercasas@geotab.com>
2025-03-26 19:22:52 +08:00
SPRESENSE
8be6764a45 sched/init: Fix build error with CONFIG_BOARD_CRASHDUMP_CUSTOM
Fix build error with the following condition.
- CONFIG_BOARD_CRASHDUMP_CUSTOM=y
- CONFIG_COREDUMP=n

The condition for calling `coredump_initialize()` is incorrect.
CONFIG_BOARD_CRASHDUMP_CUSTOM is not dependent on CONFIG_COREDUMP.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-03-26 19:22:32 +08:00
Tomasz 'CeDeROM' CEDRO
2e365e437c 202503 Apache NuttX RTOS Contributing Guidelines update.
* This change comes from vast mailing list discussions on low PR/COMMIT
  quality, breaking changes, code quality, long term self-compatibility
  and maintenance, review problems, and how to improve things.
* Contributing Guidelines updates vote history:
  1. https://www.mail-archive.com/dev@nuttx.apache.org/msg12584.html
  2. https://www.mail-archive.com/dev@nuttx.apache.org/msg12723.html

Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
2025-03-26 19:22:19 +08:00
Daniel Martín Gómez
bcee2e3604 arch/arm/src/stm32f0l0g0: Fix SPI reads when nbits is 8
I found an issue when using SPI with nbits=8: SPI reads return unreliable
results because SPI ignores nbits value and always performs 16-bit reads.

Signed-off-by: Daniel Martín Gómez <danielmartingomez@geotab.com>
2025-03-26 19:22:10 +08:00
Roy Feng
a90110807f lpc31xx: typo fix in board olimex-lpc-h3131 document
`NSH_DISABLE_NSFMOUNT` should be `NSH_DISABLE_NFSMOUNT`

Signed-off-by: Roy Feng <roy.feng@sony.com>
2025-03-26 19:21:58 +08:00
chao an
3bf52e5020 libc/strings: fix compile warning if enable -Wshadow
Replace inline functions with macros to avoid confilcts with builtin definition

nuttx/include/strings.h:80:28: warning: declaration of 'ffs' shadows a built-in function [-Wshadow]
   80 | static inline_function int ffs(int j)
      |                            ^~~
nuttx/include/strings.h:94:28: warning: declaration of 'ffsl' shadows a built-in function [-Wshadow]
   94 | static inline_function int ffsl(long j)
      |                            ^~~~
nuttx/include/strings.h:109:28: warning: declaration of 'ffsll' shadows a built-in function [-Wshadow]
  109 | static inline_function int ffsll(long long j)
      |                            ^~~~~

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-03-26 19:21:41 +08:00
Jukka Laitinen
5ce0480802 arch/risc-v/common: Fix unaligned stack access on 64-bit risc-v
This fixes a crash at boot on 64-bit risc-v systems which need to store
64-bit registers to the stack aligned to 8 byte boundary.

Specifically, this uses 8 bytes to store ra and s0 on rv32 and 16 bytes on
rv64, and does the register stores and loads properly aligned acc. to the
register size.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-03-26 19:21:33 +08:00
yangsong8
3d5447fc9d ptmx: When alloc minor, skip the start addr if it has been used
The alloctab can be looped, if the first check the corresponding
bit is set, it will not continue to loop

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-26 19:21:24 +08:00
Lup Yuen Lee
9790ce826d arch/arm, risc-v: Fix typos in Code Comments
This PR fixes the typos in the Code Comments of chip.h, allocateheap.c
and start.c. The typos were discovered here:
- https://github.com/apache/nuttx/pull/15921

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2025-03-26 19:21:15 +08:00
Felipe Moura
6e64f1553b arch/risc-v/espressif: Remove usb serial workaround for esp32 modules
This commit includes a change to the esp_txint function in the arch/risc-v/src/common/espressif/esp_usbserial.c file. The change primarily involves removing an optimization workaround and adding a call to flush the transmit FIFO.

After this change the usbserial config is able to work using all optimization levels.

Changes in esp_txint function:

Removed the __attribute__((optimize("O0"))) workaround.
Added a call to usb_serial_jtag_ll_txfifo_flush() at the beginning of the function.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2025-03-26 19:20:18 +08:00
Filipe Cavalcanti
c5a4a5106b drivers/net: update format specifier on lan9250 driver
Fix print statement for uint8 and uint16 types.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-26 19:20:00 +08:00
chao an
c7dea2b6b7 audio/pcm_decode: fix typo in assert condition
should be shutdown not start

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-03-26 09:25:38 +08:00
chao an
df538db857 Documentation/uorb: fix typo in uorb chapter
fix typo "Two Tpyes" -> "Two Types"

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-03-26 09:25:02 +08:00
Bowen Wang
6303c11b53 arm/qemu-armv7a: add discard-data-on in rpproxy_ivshmem launch command
add discard-data=on in proxy launch command, so the proxy side
will clean the share memory to make sure that the shared memory is clean
every time server and proxy are started.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2025-03-03 07:37:13 +08:00
Bowen Wang
8762919325 drivers/rpmsgblk_server: fix the syslog format warning
misc/rpmsgblk_server.c:135:16: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int32_t' {aka 'long int'} [-Wformat=]
  135 |           ferr("block device open failed, ret=%d\n", msg->header.result);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~
      |                                                                 |
      |                                                                 int32_t {aka long int}
misc/rpmsgblk_server.c:135:48: note: format string is defined here
  135 |           ferr("block device open failed, ret=%d\n", msg->header.result);
      |                                               ~^
      |                                                |
      |                                                int
      |                                               %ld
misc/rpmsgblk_server.c: In function 'rpmsgblk_close_handler':
misc/rpmsgblk_server.c:170:16: warning: format '%d' expects argument of type 'int', but argument 3 has type 'int32_t' {aka 'long int'} [-Wformat=]
  170 |           ferr("block device close failed, ret=%d\n", msg->header.result);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~
      |                                                                  |
      |                                                                  int32_t {aka long int}
misc/rpmsgblk_server.c:170:49: note: format string is defined here
  170 |           ferr("block device close failed, ret=%d\n", msg->header.result);
      |                                                ~^
      |                                                 |
      |                                                 int
      |                                                %ld

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2025-03-03 07:37:13 +08:00
Alan Carvalho de Assis
47d0356c65 doc: Add documentation to USERLED subsystem
The USERLED subsystem is responsible to register and to control the
user LEDs on the board.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-03-02 00:13:29 +08:00
Filipe Cavalcanti
fdb8e85525 drivers/audio/es8388: set proper format specifier macro for logging
Use PRIu32 instead of %d/%u for uint32_t to avoid build warnings on different architectures.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-01 06:37:30 -03:00
Kevin Witteveen (MartiniMarter)
fb853be004 arm/rp2040/common: Change SPI board functions to weak
Summary
Board logic change.
This PR adds weak_function attributes to the RP2040 common SPI board logic.
This allows board developers to override and extend the SPI board logic.

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-02-28 21:02:40 -03:00
Sydeney Araujo
89ddf9e7b9 arch/arm/tiva: Refactor complementary PWM mode configuration
This commit improves the configuration of complementary PWM mode for
Tiva C-Series microcontrollers by moving the complementary flag
definition directly into each channel structure.

Changes made:
- Renamed 'complementary_generation' to 'complementary' for clarity.
- Moved complementary mode configuration into the static PWM
  channel structures.
- Replaced runtime conditional checks with compile-time configuration
  using '#ifdef CONFIG_TIVA_PWM_COMPLEMENTARY_Gx'.
- Improved readability and maintainability of the PWM driver.

These modifications ensure a more efficient initialization process,
reduce runtime conditionals, and align better with NuttX coding practices.

Signed-off-by: Sydeney Araujo <sydney.wagner39@gmail.com>
2025-02-28 11:07:19 -03:00
Filipe Cavalcanti
dcb74eba2e drivers/audio/es8311: set proper format specifier for logging
Use PRIu32 instead of %d/%u to we avoid build warning on different architectures.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-02-28 10:46:20 +01:00
Kevin Witteveen (MartiniMarter)
b698cc1338 Documentation: add SX126x plan
Added detailed information about the SX126x and its current state in development.
Added directories for wireless character driver and LPWAN.
Added indexes to each directory and its contents within.

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-02-27 16:03:18 -03:00
Kevin Witteveen (MartiniMarter)
20ed2e689c drivers/wireless/lpwan/sx126x:
[Experimental]
This adds a driver for the SX126x (SX1261 and SX1262) LoRa chips.
All functions and definitions are coming directly from the DS SX1261-2 V2.1 datasheet.

Signed-off-by: Kevin Witteveen (MartiniMarter) <kevinwit1999@gmail.com>
2025-02-27 16:03:18 -03:00
Michal Lenc
4e70cc1e69 samv7/pwm: add support for PWMIOC_FAULTS_FETCH_AND_CLEAR ioctl
This ioctl fetches and clears PWM faults.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-27 11:47:51 -03:00
Michal Lenc
86917b4777 drivers/pwm: add PWMIOC_FAULTS_FETCH_AND_CLEAR ioctl for fault clears
This ioctl clears the active fault inputs. Some faults can be latched
(still active even if the source is not active anymore), so they have
to be cleared from the software. The argument is a pointer to unsigned
long bitmask variable. This bitmask specifies which faults are to be
cleared.

The ioctl also can fetch the faults active prior to the clear. These
faults are saved to the argument specifying which faults are to be
cleared. Therefore passing zero bitmask means the driver will only return
active faults and clear none. Passing NULL pointer means the driver
will clear all active and return none.

The implementation of this ioctl is per driver.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-02-27 11:47:51 -03:00
Stepan Pressl
e53de96692 Documentation: add cyclictest benchmark utility documentation
The documentation concerns the cyclictest in apps/benchmarks/cyclictest.
The documentation describes the usage of the NuttX device timer
in this benchmark, the app usage and an example with an output.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-02-27 11:30:55 -03:00
Eren Terzioglu
8d86340b98 Docs/esp32: Add brickmatch config doc for esp32-devkitc
Add missing documentation for brickmatch defconfig for esp32-devkitc

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-27 12:12:20 +01:00
Eren Terzioglu
a66e58cf59 Docs/brickmatch: Update brickmatch game docs
Update brickmatch game docs after I/O option additions

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-27 12:12:20 +01:00
chao an
52a13a8351 sched/spin_lock: continue work to rename raw_spin* to spin_*_notrace
Some improvements are made to the following commits:

| commit f22b93b337
| Author: hujun5 <hujun5@xiaomi.com>
| Date:   Fri Jan 31 07:01:07 2025 +0800
|
|     sched/spin_lock: rename raw_spin_lock to spin_lock_notrace
|
|     Signed-off-by: hujun5 <hujun5@xiaomi.com>

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-27 06:11:58 +02:00
George Poulios
aa5d119bc3 arch/arm64: fix boot stage prints with CONFIG_ARCH_EARLY_PRINT=y
`boot_stage_puts` used by early asm calls arm64_lowputc() for each
character in a loop. During that loop it uses x1 as the pointer to
the next character to be printed. However, x1 is clobbered by
arm64_lowputc(), resulting in undefined behaviour (only the first
character of the string is guaranteed to be printed).

Fix this by using x19 instead.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-02-26 20:47:05 +02:00
Eren Terzioglu
c7702894fe documentation/esp32[s2|s3]: Add I2C slave support
Add I2C Slave support into docs for xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 16:32:40 +01:00
Eren Terzioglu
06ef4a8084 boards/xtensa/esp32[s2|s3]: Add I2C slave support
Add I2C slave board support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 16:32:40 +01:00
Eren Terzioglu
4d89d7186e arch/xtensa/esp32[s2|s3]: Add I2C slave support
Add I2C slave support on arch level for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 16:32:40 +01:00
Eren Terzioglu
7658c39304 documentation/esp32[c3|c6|h2]: Add I2C slave support
Add I2C slave support into docs for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 16:32:40 +01:00
Eren Terzioglu
939b31b97e boards/risc-v/esp32[c3|c6|h2]: Add I2C slave support
Add I2C slave support into board layer for risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 16:32:40 +01:00
Eren Terzioglu
59fe350708 arch/risc-v/espressif: Add I2C slave support
Add I2C slave support for arch layer to risc-v based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-02-26 16:32:40 +01:00
Ville Juven
8ab87c582b arch/mcx-nxxx: Add GPIO interrupt support
Add support for GPIO interrupts.
2025-02-26 10:18:22 -03:00
Ville Juven
d7811c4b6e arch/mcx-nxxx: Enable GPIO clocks.
For the I/O pins to work, the clock gate needs to be opened.
2025-02-26 10:18:22 -03:00
Ville Juven
1d57ed7807 arch/mcx-nxxx: Add GPIO port 0
The port numbers go from 0-7 (and up) for this architecture; port 0 was
missing.
2025-02-26 10:18:22 -03:00
Tiago Medicci Serrano
fcff16a0a8 arch/risc-v: Add ARCH_HAVE_RAMFUNCS to ESP32-C6 and ESP32-H2
Following the https://github.com/apache/nuttx/pull/14741, add the
`ARCH_HAVE_RAMFUNCS` config to ESP32-C6 and ESP32-H2 to suppress
the RWX memory region warning.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-02-26 09:16:18 +01:00
leocafonso
98b9cc25ef Documentation/ra4m1: Add documentation for Renesas RA4M1 MCU and arduino-r4-minima
Signed-off-by: leocafonso <leocafonso@gmail.com>
2025-02-25 13:14:48 -03:00
leocafonso
5697053540 boards/ra4: Add support for Arduino-R4-Minima
Add support for arduino-r4-minima.
Created defconfig and board source files for:
* nsh
* nsh-leds

Signed-off-by: leocafonso <leocafonso@gmail.com>
2025-02-25 13:14:48 -03:00
leocafonso
f4b6cf2b9f arch/ra4: Add support for Renesas RA4M1 MCU
Add basic support for RA4M1.
The following perpheral are added:
* GPIO
* SCI (UART)
* Clock (Just internal clock - HOCO)

Signed-off-by: leocafonso <leocafonso@gmail.com>
2025-02-25 13:14:48 -03:00
Marco Casaroli
16e2e77bdf esp32: use mcuboot for qemu_openeth config
Now, espressif qemu supports MCUboot, so we can switch the app
format.
2025-02-25 13:13:40 -03:00
Marco Casaroli
b4c827cee3 esp32s3: use mcuboot for qemu_openeth config
Now, espressif qemu supports MCUboot, so we can switch the app
format.

The build was failing with the legacy app format because
_ext_ram_bss_end and _ext_ram_bss_start are not defined in the
legacy linker file.
2025-02-25 13:13:40 -03:00
Filipe Cavalcanti
b89ad74660 xtensa/esp32: use common Espressif wireless source
Update the wireless symbols from ESP32_* to ESPRESSIF_* for using common layer.
Remove ESP32 specific WiFi files and edit build system to use common layer.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-02-25 12:35:46 +01:00