Commit graph

57904 commits

Author SHA1 Message Date
Felipe Moura
94f210ded6 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-05 10:59:53 +01:00
yangsong8
7bad94a964 drivers/usbhost: recognize sim usb cdcacm composite device
In the USB interface descriptor of the cdcacm device, class:2 (CDC)
subclass:2 (ACM) protocol:0 (NONE) may appear. At this time, the
usb host does not match the correct protocol byte, which will cause
the device identification to fail.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-05 10:11:29 +01:00
Michal Lenc
66f464936a drivers/lcd/st7789: add option for SPI delay control
It is now possible to configure SPI delays for st7789 controller if
CONFIG_SPI_DELAY_CONTROL is set. Default values for SPI peripheral
may be too long or too short, therefore the display controller set
its own values as required. The default values in configuration
are taken from the reference manual, but it is possible they may
require tuning for different revisions or temperatures for
example.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-03-05 09:18:56 +01:00
Lup Yuen Lee
825b745408 arch/risc-v/eic7700x: Add support for ESWIN EIC7700X SoC
This PR adds support for the ESWIN EIC7700X RISC-V SoC.
This will be used by the upcoming port of NuttX for PINE64 StarPro64 SBC.

Most of the code was derived from NuttX for SOPHGO SG2000 SoC.
The modified code is explained here:
https://lupyuen.github.io/articles/starpro64#appendix-port-nuttx-to-starpro64

Modified Files in arch/risc-v:

Kconfig: Added ARCH_CHIP_EIC7700X for EIC7700X SoC

New Files in arch/risc-v:

include/eic7700x/chip.h: EIC7700X Definitions
include/eic7700x/irq.h: External Interrupts
src/eic7700x/chip.h: Interrupt Stack Macro
src/eic7700x/eic7700x_allocateheap.c: Kernel Heap
src/eic7700x/eic7700x_head.S: Linux Header and Boot Code
src/eic7700x/eic7700x_irq.c: Configure Interrupts
src/eic7700x/eic7700x_irq_dispatch.c: Dispatch Interrupts
src/eic7700x/eic7700x_memorymap.h: Memory Map
src/eic7700x/eic7700x_mm_init.c, eic7700x_mm_init.h: Memory Mgmt
src/eic7700x/eic7700x_pgalloc.c: Page Allocator
src/eic7700x/eic7700x_start.c: Startup Code
src/eic7700x/eic7700x_timerisr.c: Timer Interrupt
src/eic7700x/hardware/eic7700x_memorymap.h: PLIC and UART Base Address
src/eic7700x/hardware/eic7700x_plic.h: PLIC Register Addresses
src/eic7700x/Kconfig: EIC7700X Config
src/eic7700x/Make.defs: Makefile

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2025-03-04 09:27:48 -05:00
Lup Yuen Lee
76dfa9af57 Documentation/platforms/risc-v/eic7700x: Add support for ESWIN EIC7700X SoC
This PR adds support for the ESWIN EIC7700X RISC-V SoC.
This will be used by the upcoming port of NuttX for PINE64 StarPro64 SBC.

Most of the code was derived from NuttX for SOPHGO SG2000 SoC.
The modified code is explained here:
https://lupyuen.github.io/articles/starpro64#appendix-port-nuttx-to-starpro64

platforms/risc-v/eic7700x/index.rst: Added EIC7700X SoC

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2025-03-04 09:27:48 -05:00
yangsong8
02f55f2c70 boards/sim: enable ADB shell service
enable adb shell service when build usbdev

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-04 11:20:50 -03:00
zhanghongyu
7f0a670bde net/socket/getsockopt: move the options check to the upper layer
check parameters at the top level to avoid errors when assigning
values in si_getsockopt.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2025-03-04 09:29:06 +01:00
yangsong8
24d947b7c1 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-04 09:14:25 +01:00
wangjianyu3
677c2187b9 Documentation/fastboot: Add usage for fastboot oem shell
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-04 12:28:12 +08:00
wangjianyu3
4df67da95d esp32s3-devkit/fastboot: Enable fastboot oem shell
Selftest

    # Host side

    $ ./tools/configure.sh -l esp32s3-devkit:fastboot
    $ make flash -j ESPTOOL_PORT=/dev/ttyACMx

    $ fastboot devices
    1234    fastboot
    $ fastboot -s 1234 oem shell ps
      PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK COMMAND
        0     0   0 FIFO     Kthread   - Ready              0000000000000000 0003056 Idle_Task
        1     0 224 RR       Kthread   - Waiting  Semaphore 0000000000000000 0001976 hpwork 0x3fc8bd50 0x3fc8bd80
        2     2 100 RR       Task      - Waiting  Semaphore 0000000000000000 0004048 nsh_main
        3     3 100 RR       Task      - Ready              0000000000000000 0001992 fastbootd
        4     4 100 RR       Task      - Running            0000000000000000 0001992 popen -c ps
    OKAY [  0.010s]
    Finished. Total time: 0.010s

More details

    https://github.com/apache/nuttx-apps/pull/3003

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-04 12:28:12 +08:00
Stepan Pressl
e376e22f93 Documentation/applications/benchmarks/cyclictest: -q
-q (--quiet) option added

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-03-03 16:00:07 +01:00
Lup Yuen Lee
2afeefc805 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-03 14:05:06 +01: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
SPRESENSE
96de2e20c1 arch: cxd56xx: Improve i2c initialize function
During I2C communication between non-Spresense devices is performed,
the I2C bus may freeze after initialization of the Spresense I2C.
As a workaround, switch the pin mode to I2C at the end of the i2c
initialization function.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-02-25 10:55:20 +01:00
SPRESENSE
d521b926aa arch: cxd56xx: Improve i2c reset function
During I2C communication between non-Spresense devices is performed,
the I2C bus may freeze after initialization of the Spresense I2C.
As a workaround, add clock gating process and disable GPIO input
to the I2C reset function.

Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com>
2025-02-25 10:55:20 +01:00
chao an
c782131c5f syslog/rpmsg_server: fix build break if enable SYSLOG_RPMSG/SYSLOG_RPMSG_SERVER
syslog/syslog_rpmsg_server.c:66:13: error: conflicting types for 'syslog_rpmsg_write';
      have 'void(const char *, size_t,  const char *, size_t)' {aka 'void(const char *, unsigned int,  const char *, unsigned int)'}
   66 | static void syslog_rpmsg_write(FAR const char *buf1, size_t len1,
      |             ^~~~~~~~~~~~~~~~~~
In file included from syslog/syslog_rpmsg_server.c:36:
nuttx/include/nuttx/syslog/syslog_rpmsg.h:51:9: note: previous declaration of
  'syslog_rpmsg_write' with type 'ssize_t(const syslog_channel_t *, const char *, size_t)' {aka 'int(const struct syslog_channel_s *, const char *, unsigned int)'}
   51 | ssize_t syslog_rpmsg_write(FAR syslog_channel_t *channel,
      |         ^~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-02-25 10:51:37 +01:00
Alan Carvalho de Assis
8b5a45cee6 stm32l4r9ai-disco: Add support to bringup
Many STM32L4 boards are missing stm32_bringup.c. That confusion
was created when stm32_appinit.c was created. It introduced a new
way to do the board initialization without depending on NSH arch
specific initialization.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-02-25 09:32:25 +01:00
Alan Carvalho de Assis
5040272505 stm32l476vg-disco: Add support to bringup
Many STM32L4 boards are missing stm32_bringup.c. That confusion
was created when stm32_appinit.c was created. It introduced a new
way to do the board initialization without depending on NSH arch
specific initialization.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-02-25 09:32:25 +01:00
Alan Carvalho de Assis
e2a85dd2db nucleo-l496zg: Add support to bringup
Many STM32L4 boards are missing stm32_bringup.c. That confusion
was created when stm32_appinit.c was created. It introduced a new
way to do the board initialization without depending on NSH arch
specific initialization.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-02-25 09:32:25 +01:00