Commit graph

58086 commits

Author SHA1 Message Date
Jukka Laitinen
73ee052b3f sched/semaphore: Optimize fast mutex acquire with CONFIG_PRIORITY_PROTECT or CONFIG_PRIORITY_INHERITANCE
When the semaphore priority flags is set to NONE, and the semaphore
is a mutex, the fast locking path can be used, even when
priority inheritance or priority protect are enabled globally.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-04-01 20:37:23 +08:00
Daniel Byshkin
504f838577 sensors/nau7802: Add support for the NAU7802
This patch adds support for the NAU7802 24 bit ADC from Nuvoton.
Please read the documentation for more details.

Signed-off-by: Daniel Byshkin <online@bskdany.com>
2025-04-01 09:38:37 +08:00
Tiago Medicci Serrano
7482170f3f boards/risc-v/esp32c6: Enable SPI Flash's MTD block
This commit enables the SPI Flash's MTD block driver. This block
driver enables testing the SPI Flash device without any associated
filesystems.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-01 09:38:03 +08:00
Tiago Medicci Serrano
c616d2563e boards/risc-v/esp32h2: Enable SPI Flash's MTD block
This commit enables the SPI Flash's MTD block driver. This block
driver enables testing the SPI Flash device without any associated
filesystems.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-01 09:38:03 +08:00
Tiago Medicci Serrano
e499efd119 boards/xtensa/esp32: Enable SPI Flash's MTD block
This commit enables the SPI Flash's MTD block driver. This block
driver enables testing the SPI Flash device without any associated
filesystems.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-01 09:38:03 +08:00
Tiago Medicci Serrano
09bcec95a8 boards/xtensa/esp32s2: Enable SPI Flash's MTD block
This commit enables the SPI Flash's MTD block driver. This block
driver enables testing the SPI Flash device without any associated
filesystems.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-01 09:38:03 +08:00
Tiago Medicci Serrano
6e57b93821 boards/risc-v/esp32c3: Enable SPI Flash's MTD block driver
This commit enables the SPI Flash's MTD block driver. This block
driver enables testing the SPI Flash device without any associated
filesystems.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-01 09:38:03 +08:00
Tiago Medicci Serrano
440d4a688a boards/xtensa/esp32s3: Enable SPI Flash's MTD block driver
This commit enables the SPI Flash's MTD block driver. This block
driver enables testing the SPI Flash device without any associated
filesystems.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-01 09:38:03 +08:00
wangjianyu3
fb807dbbe1 Documentation/szpi-esp32s3: Add doc for LVGL
Basic NuttShell configuration console and LVGL enabled.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-01 09:35:07 +08:00
wangjianyu3
bbcb40c979 boards/szpi-esp32s3: Init configuration for LVGL
And PSRAM enabled.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-01 09:35:07 +08:00
wangjianyu3
bd87bec6fb boards/szpi-esp32s3: Register LCD device
Register LCD device "/dev/lcd0" for graphics.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-04-01 09:35:07 +08:00
Laczen JMS
fb24cae852 boards/extensa/esp32: use wlan config to start wlan
Use wlan configuration option to enable wlan support for:
- esp32-2432S028
- esp32-audio-kit
- esp32-devkitc
- esp32-ethernet-kit
- esp32-lyrat
- esp32-pico-kit
- esp32-sparrow-kit
- esp32-wrover-kit
- lilygo_tbeam_lora_gps
- ttgo_eink5_v2
- ttgo_lora_esp32
- ttgo_t_display_esp32
- esp32s2-saola-1
- esp32s3-box
- esp32s3-devkit
- esp32s3-eye
- esp32s3-korvo-2
- esp32s3-lcd-ev
- lckfb-szpi-esp32s3

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-03-31 11:35:39 -03:00
Laczen JMS
b8964f5c46 arch/xtensa/src/common/espressif: Add wlan config option
Add an option to configure wlan support

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-03-31 11:35:39 -03:00
wangjianyu3
a834540f42 Documentation/szpi-esp32s3: Add doc for LCD
Basic NuttShell configuration console and LCD enabled.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-31 10:06:45 -03:00
wangjianyu3
31da7737b9 boards/szpi-esp32s3: Init configuration for LCD
Init configuration for ST7789 LCD.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-31 10:06:45 -03:00
wangjianyu3
f42b784349 drivers/lcd/st7789: Add option for RGB data endian
Big endian by default.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-31 10:06:45 -03:00
wangjianyu3
8af44d0385 boards/szpi-esp32s3: Add support for ST7789 LCD
Expanded IO0 for SPI C/S, GPIO39 for SPI D/C.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-31 10:06:45 -03:00
wangjianyu3
c97307b24a Documentation/szpi-esp32s3: Add doc for GPIO
Basic NuttShell configuration console and GPIO(e.g. IO39 as SPI D/C) enabled.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-31 10:06:45 -03:00
wangjianyu3
8156211355 boards/szpi-esp32s3: Init GPIO for LCD SPI D/C
And add configuration for GPIO.

| Num  | Type      | Func / Location |
|------|-----------|-----------------|
| IO39 | Output    | LCD SPI D/C     |
| IO10 | Input     | GP1.25-5P expansion interface 1 (left side, near the speaker) |
| IO11 | Interrupt | GP1.25-5P expansion interface 1 (left side, near the speaker) |

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-31 10:06:45 -03:00
wangjianyu3
882c39df4d Documentation/szpi-esp32s3: Add doc for PSRAM
Basic NuttShell configuration console and PSRAM enabled.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-31 11:26:30 +08:00
wangjianyu3
847133c1ad boards/szpi-esp32s3: Init configuration for PSRAM
Enable 8MB PSRAM.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-31 11:26:30 +08:00
raiden00pl
c4f142e45c syslog: add an option to completely disable syslog logic
Add an option to completely disable syslog() and replace it with an empty functions.
This option can be useful for small systems when we don't have any logging support,
but compiler is not able to remove useless code.

This way the final image also won't contain the strings that are present in
syslog() calls when compiler optimization is enabled (for example from /boards
where syslog is often used instead of debug macros).

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-03-30 11:36:19 +08:00
yangsong8
48af14beca driver/serial: Check again the RX buffer, then check file flags
The UART driver (cdcacm...) might have buffered data received, Just continue
processing the RX queue if this happens. If not, then check the file or dev
flags.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-29 10:34:00 +08:00
wangjianyu3
cc23e06ea2 arch/esp32s3: The MISO, MOSI and C/S are optional
The MISO or MOSI pin is optional.
The C/S pin is unnecessary when `ESP32S3_SPI_UDCS` is enabled.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-29 10:33:45 +08:00
Michal Lenc
bd628883ab arch/arm/src/samv7: enable GPIO clock even if interrupt not enabled
GPIO peripheral clocks have to be enabled even if interrupt support
on the peripheral is not enabled, otherwise GPIO input will not work.
This is probably caused by input filters that need clock signal.

This commit moves the clock enable call from interrupt specific function
to common initialization function that is called from _start entry
point function.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-03-29 10:33:25 +08:00
Filipe Cavalcanti
2cee5c0945 boards/esp32: add heap test to psram defconfig
Add the heap test to psram and psram_usrheap defconfig of esp32-devkitc.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-03-29 10:29:12 +08:00
zhangshoukui
0550355c92 drivers/mtd/mtd_cfi: Add MTDIOC_ERASESTATE
We need to give a default erase value when we register cfi flash for mtd devices
he pseudo-code is as follows:
register_cfi_driver(xxx)
find_mtddriver("xxx", &inode);
mtdconfig_register(inode->u.i_mtd);

https://github.com/Zhangshoukui/nuttx/blob/master/drivers/mtd/mtd_config.c#L1775C28-L1775C45

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-03-28 19:19:35 +08:00
zhangshoukui
82273b1cf5 tools/ci/testrun/script/test_framework/test_cmocka: skip Skip failed cases
[BUG] CI Test sim:citest fails intermittently for Linux sim-01 nuttx#16088
https://gist.github.com/lupyuen/849562eaf87b93411098c96ada4d43c5

nsh> cmocka --skip test_case_posix_timer|test_case_oneshot|write_default|read_default|burst_test|gpiotest01|test_playback.*|test_interaction.*|test_stress.*|test_capture.*
Cmocka Test Start.
Missing <source>
Usage: cmocka_driver_block -m <source>
Where:
  -m <source> Block device or mtd device mount location.
...
[ RUN      ] drivertest_pm
[  ERROR   ] --- 0 != 3
[   LINE   ] --- drivertest_pm.c:199: error: Failure!
[  FAILED  ] drivertest_pm
[==========] tests: 1 test(s) run.
[  PASSED  ] 0 test(s).
[  FAILED  ] tests: 1 test(s), listed below:
[  FAILED  ] drivertest_pm
...
[ RUN      ] drivertest_posix_timer
[  ERROR   ] --- 2019 is not within the range [1990, 2010]
[   LINE   ] --- drivertest_posix_timer.c:162: error: Failure!
[  FAILED  ] drivertest_posix_timer
[==========] tests: 1 test(s) run.
[  PASSED  ] 0 test(s).
[  FAILED  ] tests: 1 test(s), listed below:
[  FAILED  ] drivertest_posix_timer

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
2025-03-28 11:19:59 +01:00
yangsong8
c4001b2433 Revert "boards/defconfig: remove fixed CDCACM BUFFER SIZE"
Use configuration CDCACM_DISABLE_TXBUF or CDCACM_DISABLE_RXBUF to choose
whether to use usb req buffer as the serial buffer. Since the default
value is n (not using req buf), the original configuration of buf is valid.

This reverts commit 21c8ed80bd.
2025-03-28 08:52:42 +08:00
yangsong8
e8f9570ffd driver/serial/cdcacm: config to enable or disable txbuf
To be compatible with the previous method, add a buf between cdcacm
and serial. Because when using usbreqbuf directly as the buf of serial,
the amount of data sent may be insufficient due to the limit of the
number of reqs. For example, when the number of reqs is 4, the number
of data send through cdcacm is 5, and each data is a separate USB
packet, if the host does not read in time, resulting in blocking send.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-28 08:52:42 +08:00
yangsong8
f0b52a8b2d driver/serial/cdcacm: config to enable or disable rxbuf
To be compatible with the previous method, add a buf between cdcacm
and serial. Because when using usbreqbuf directly as the buf of serial,
the amount of data received may be insufficient due to the limit of the
number of reqs. For example, when the number of reqs is 4, the number
of data received through cdcacm is 5, and each data is a separate USB
packet, which should require 5 reqs, resulting in the last number not
being received. If the application always waits for 5 numbers before
performing an operation, this will cause problems.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
2025-03-28 08:52:42 +08:00
wangjianyu3
9206abc28a Documentation/szpi-esp32s3: Add doc for LEDC(PWM)
Basic NuttShell configuration console and LEDC(PWM) enabled.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-28 08:50:08 +08:00
wangjianyu3
6165fcc6c8 boards/szpi-esp32s3: Init config for LEDC(PWM)
Enable LEDC driver for IO 42 of LCKFB SZPI-ESP32S3 as backlight of LCD.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-28 08:50:08 +08:00
wangjianyu3
ad622c018c boards/szpi-esp32s3: Add PWM setup
Add PWM setup for LCKFB SZPI-ESP32S3.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-28 08:50:08 +08:00
wangjianyu3
7d288a9894 boards/esp32s3: Move PWM setup to common
Move PWM setup from esp32s3-devkit/src/esp32s3_ledc.c to common/src/esp32s3_board_ledc.c.
Fix esp32s3_pwm_setup() undefined error for esp32s3-korvo-2.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-03-28 08:50:08 +08:00
nuttxs
bfcc283694 arch/esp32_himemcdev: Multiple instances of struct file for the same file
share the f_inode, ensuring that the mapping status is associated with
the file entity rather than a single descriptor.
Avoid redundant mapping operations caused by multiple descriptors
operating on the same file.

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-03-27 02:27:35 +08:00
Huang Qi
0873d88f11 tools/espressif: Improve version checking by subprocess
Summary:
- Replace version checking logic using pkg_resources and importlib with a subprocess call to `esptool.py version`
- This change enhances compatibility with esptool installed via pipx and simplifies the version retrieval process

Impact:
- No functional changes; the script continues to prompt for installation if esptool is not found
- Increases maintainability by reducing dependency on Python version checks

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2025-03-27 02:26:47 +08:00
Zhu Zhongjie
f13e66adcb boards/raspberrypi-pico: add waveshare Pico-ResTouch-LCD-2.8 board support
This change adds support for the Pico ResTouch 2.8" LCD module to enhance display options for NuttX-based systems.

Signed-off-by: Zhu Zhongjie <zhongjiezhu1@gmail.com>
2025-03-27 02:25:51 +08:00
Yanfeng Liu
672f806a7e arch/armv7-r: relax ARM_THUMB
This drops forcing ARM_THUMB for ARMV7R so that downstream chips
can use it optionally.

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-03-27 02:25:05 +08:00
Yanfeng Liu
c7d3f92867 arch/arm: guard .thumb_func use
This guards use of .thumb_func with ARM_THUBM kconfig so that
CONFIG_ARM_THUMB can be off for cases like qemu-armv7r:pnsh

Signed-off-by: Yanfeng Liu <p-liuyanfeng9@xiaomi.com>
2025-03-27 02:25:05 +08:00
lpxiao
9e07b4a924 arch/arm/stm32: fix stm32f1xx alarm support
Summary:
stm32: support querying a previously set RTC alarm In the STM32F1xx series

Impact:
When using the stm32f1xx series MCU, the alarm function can be used, but when we enabled the CONFIG_RTC_ALARM configuration, an error was reported due to the inability to find the specific implementation of rdalarm.

Testing:
In our own projects, we have done alarm verification using the STM32F103RE..
2025-03-27 02:22:51 +08:00
Tim Kan(SSS)
1c6b603eec feat(arch/xensa): add CONFIG_SPIRAM_MEMTEST from ESP-IDF
The CONFIG item is beneficial for startup performance tuning, so
it would be better to have it in Nuttx as well.

Co-authored-by: FunatsuTaishi <51806905+FunatsuTaishi@users.noreply.github.com>
Co-authored-by: Roy Feng <roy.feng@sony.com>
Signed-off-by: Tim Kan(SSS) <tim.kan@sony.com>
2025-03-27 02:21:16 +08:00
nuttxs
720c6cce6f arch/esp32_partition: read data from SPI Flash at designated
address (with decryption)

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-03-27 02:21:04 +08:00
nuttxs
72f3ac98e2 arch/esp32_partition: add some partition operation interfaces for esp32
Relocate the enum ota_img_ctrl_e and ota_img_bootseq_e
to a directory visible to the application.
Inspect if the MTD partition (factory/ota_0/ota_1) is mapped as text.
Adding an ioctl interface ota_invalidate_bootseq() to the ESP32 partitions,
by deleting the corresponding otadata, makes the boot sequence (ota_0/1) invalid.

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-03-27 02:21:04 +08:00
Gao Feng
5afed2cb00 xtensa/esp32: write encrypt func implementation
based on spec, 16 bytes alignment is checked.
2025-03-27 02:20:14 +08:00
nuttxs
e1ffc1075d arch/esp32_spi: Add check to see if the TX_FIFO is empty
to avoid sending empty data

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-03-27 02:20:02 +08:00
yangao1
ded5a6aae5 nxgdb/dmesg.py:add use gdb dump rpmsg_syslog
(gdb) dmesg
RAM log:
[01/06 02:27:05] [ 1] [cp] reset mode:1
...
[01/06 02:27:05] [ 1] [cp] Dump board_reset backtrace:
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace| 1: 0x10a0d880 0x10a0a78e 0x10a0d8b6 0x10a0f29e 0x10a0f182
[01/06 02:27:05] [ 1] [cp] Time: Mon Jan  6 02:27:05 2025
---END of RAMLOG

RPMSG syslog:
dumpstack: backtrace|10: 0x10a0d880 0x10a0a78e 0x10a110de 0x10a3a482 0x10a3c4fa 0x10a23358 0x10a4aaee 0x10a34a7c
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace|10: 0x10a2330a 0x10a0f1f4
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace|11: 0x10a0d880 0x10a0a78e 0x10a110de 0x10a3a482 0x10a15152 0x10a0f182
[01/06 02:27:05] [ 1] [cp] sched_dumpstack: backtrace|15: 0x10a0d880 0x10a0a78e 0x10a0d8b6 0x10a174d0 0x10a3a482 0x10a3c4fa 0x10a222ee 0x10a18c66
[01/06 02:27:05] [ 1] [cp] Time: Mon Jan  6 02:27:05 2025
---END of RPMSG SYSLOG---

Signed-off-by: yangao1 <yangao1@xiaomi.com>
2025-03-27 02:18:37 +08:00
Alexander Lerach
d1be769038 arch/arm: Fix crash when using memcpy/memset as RAMFUNCS
Add no_builtin for memcpy/memset to the startup code of boards
with CONFIG_ARCH_RAMFUNCS, because certain compilers call memcpy/memset
instead of the explicit for loop. This will cause a crash if memcpy/memset
are mapped to RAM because the function that copies them to RAM is called later,
resulting in undefined code being executed.

Signed-off-by: Alexander Lerach <alexander@auterion.com>

arch/arm: Use decorator for entry point

Use a decorator that contains the required no_builtin instead of adding
them explicitly to the startup code. This way it will be easier to
maintain them in the future when changes to the no_builtin used are required.

Signed-off-by: Alexander Lerach <alexander@auterion.com>

arch/arm: Rename decorator

Rename the entry point decorator used for the startup code to a less explicit name.
This way the style is more consistent with other decorators.

Signed-off-by: Alexander Lerach <alexander@auterion.com>
2025-03-27 02:17:14 +08:00
Tim Hardisty
3ad4ae503a drivers/mtd/gd55.c: fix uninitialised variables.
These caused runtime errors and compiler warnings.

Signed-off-by: Tim Hardisty <timh@jti.uk.com>
2025-03-27 02:16:48 +08:00
Michal Lenc
19b655b4fd arch/arm/sama5/spi: fix ifdelay setup in spi_setdelay call
ifdelay description (delay between frames) matches the DLYBCT field
(delay between consecutive transfers without removing chip select)
much better compared to stopdelay (delay between last CLK and CS
inactive). The option for stopdelay does not seem to be configurable
in SAMA5 peripheral.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-03-26 23:20:10 +08:00