Commit graph

919 commits

Author SHA1 Message Date
Filipe Cavalcanti
662c1e0bbb boards/xtensa: update board and defconfigs for Wi-Fi on ESP32|S2|S3
Updates the defconfigs and board source to support driver refactor.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-09-14 10:41:15 +08:00
nuttxs
d09b6a9f51 boards/xtensa: fix the issue of undefined symbol reference errors
occurring during compilation and linking phase when the configuration
(CONFIG_ESP32S3_APP_FORMAT_LEGACY=y) is enabled.

---
undefined reference to _esp_system_init_fn_array_start
undefined reference to _esp_system_init_fn_array_end
undefined reference to __init_array_start
undefined reference to __init_array_end
---

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-09-10 10:56:16 -03:00
Filipe Cavalcanti
ed751889de arch/xtensa/esp32: Update E-Fuse driver
Updates E-Fuse driver for ESP32, now sharing a common implementation across Xtensa devices.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-09-06 14:46:32 -03:00
Filipe Cavalcanti
65d5f9bc8f arch/xtensa/esp32s2: Update E-Fuse driver
Updates E-Fuse driver for ESP32S2, sharing a common implementation for Xtensa devices.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-09-06 14:46:32 -03:00
Filipe Cavalcanti
23faaa29f7 arch/xtensa/esp32s3: Update E-Fuse driver
Updates E-Fuse driver for ESP32S3, now sharing a common implementation across
Xtensa devices.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-09-06 14:46:32 -03:00
Filipe Cavalcanti
1d51cfbda7 arch/xtensa: add sys_startup_fn call
Adds SYS_STARTUP_FN which calls constructors and init functions on
common source code. Requires compatibility changes on linker script.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-09-06 14:46:32 -03:00
Thiago Finelon
e87c43b798 arch/xtensa/esp32s3: Add EXT1 wakeup support in power management
Introduce EXT1 wakeup functionality to the ESP32-S3 power management
subsystem. With this feature, the ESP32-S3 can wake up from PM_STANDBY
or PM_SLEEP when one or more RTC GPIOs trigger the EXT1 condition.

Changes include:
- Added EXT1 wakeup configuration and preparation logic in rtc code.
- Integrated EXT1 handling in pmstandby() and pmsleep().
- New board-level Kconfig options under ESP32-S3 DevKit menu:
  - CONFIG_PM_EXT1_WAKEUP: enable EXT1 wakeup support
  - CONFIG_PM_EXT1_WAKEUP_RTC_GPIO<n>: select RTC GPIOs as wake sources
  - CONFIG_PM_EXT1_WAKEUP_TRIGGER_MODE: choose wakeup on HIGH or LOW level
- Fixing Kconfig style
- Fixing comments standard
- Adding PM documentation for esp32s3-devkit

Impact:
- No build impact unless CONFIG_PM_EXT1_WAKEUP is enabled.
- When enabled, ESP32-S3 can wake from low-power states via RTC GPIOs.
- No new public API introduced; controlled via board Kconfig.

Tested on ESP32-S3 DevKit:
- Configured GPIO4 and GPIO5 as EXT1 wake sources.
- Verified wakeup from light sleep and deep sleep on external signals.
- Wakeup reason correctly reported as EXT1.

Signed-off-by: Thiago Finelon <thiago.sfinelon@gmail.com>
2025-08-24 11:32:10 -03: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
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
Eren Terzioglu
a316636dcf boards/xtensa: Revert mdtblock initialization for esp32[-|-s2|-s3]
boards/risc-v: Revert mdtblock initialization for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-08-15 16:42:46 -03:00
Laczen JMS
c506c25f19 drivers/mtd: introduce nvblk
NVBLK provides a block device that operates on top of a non volatile
memory (as a mtd device) that enables wear levelling for non volatile
memory. It's operation is similar to the dhara wear levelling library,
but nvblk is meant to be used on smaller (nor, mram, rram) memory.

I am also the author and maintainer of the nvblk library.

A block device can be created during startup by using:
```
nvblk_initialize(0, mtd, CONFIG_MTD_NVBLK_DEFAULT_LBS,
                         CONFIG_MTD_NVBLK_DEFAULT_IOBS,
                         CONFIG_MTD_NVBLK_DEFAULT_SPEB);
```
and a fat filesystem on top of this as:
```
nsh> mkfatfs /dev/mtdblock0
nsh> mount -t vfat /dev/mtdblock0 /mnt
```
this fat filesystem can then be used:
```
nsh> echo "test" > /mnt/test.txt
nsh> cat test.txt
test
nsh>
```

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-08-06 01:53:56 +08:00
YAMAMOTO Takashi
0f73f92ffc add esp32s3-devkit:mbedtls kconfig
Note: CONFIG_LIBC_RAND_ORDER=2 is a workaround for
https://github.com/apache/nuttx/issues/16760

Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
2025-07-25 21:29:11 +08:00
Martin Vajnar
150854c6f2 ESP_PCNT: add high and low limit Kconfig options
Signed-off-by: Martin Vajnar <martin.vajnar@gmail.com>
2025-07-22 13:09:02 -03:00
Filipe Cavalcanti
3f8cde728d boards/xtensa: fixes SPI Flash for MCUBoot usage
Fixes partitions for MCUBoot usage.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-07-22 10:55:08 -03:00
jingfei
db54331479 drivers/fs:Always use register_mtddriver() to register the MTD device (patch2)
This is a supplement to the patch:1936126210a56b6d1b033d6d940669413dd6e1b0

Due to the automatic wrapping of MTD devices during the
open() process, the legacy registration methods
ftl_initialize() and bchdev_register() are no longer
required for MTD device registration for user code.

So we have adjusted the registration method for MTD devices
in nuttx/boards, replacing the previous approach using
ftl_initialize()  with register_mtddriver().
2025-07-21 15:15:30 -03:00
jingfei
d12cf1cb75 drivers/fs:Always use register_mtddriver() to register the MTD device.
We have adjusted the registration method for MTD devices
in nuttx/boards, replacing the previous approach using
ftl_initialize() and bchdev_register() with
register_mtddriver().

When registering MTD devices via register_mtddriver(),
FTL and BCH wrappers will be added during the open() process:

1. Character Device Mode:
   When accessing the MTD device node via the open() interface,
   the device will be automatically converted to a character
   device. Both FTL and BCH wrappers will be implicitly added,
   provided that BCH support is enabled in the configuration.

2. Block Device Mode:
   When accessing the MTD device node via open_blockdriver(),
   the device will be treated as a block device, with only
   the FTL wrapper automatically applied.

Due to the automatic wrapping of MTD devices during the
open() process, the legacy registration methods
ftl_initialize() and bchdev_register() are no longer
required for MTD device registration for user code and should
be used only internally within fs and driver code.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2025-07-16 14:11:41 +08:00
Eren Terzioglu
495936d16b boards/esp32-devkitc: Add match4 defconfig for esp32
Add match4 defconfig for esp32-devkitc

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-14 09:03:28 -03:00
jiayadong
0d834b0621 boards/xtensa/esp32s3/esp32s3-box: Fix ILI9342C color inversion
When using the ILI9342C LCD on the esp32s3-box-3 development board, the
displayed colors are inverted.

add content

Manually converts the byte order of color data from little-endian
to big-endian before transmission.
2025-07-09 12:18:23 +08:00
Eren Terzioglu
1512e1e3d2 boards/xtensa: Add board layer SHA accelerator support for esp32[-s2|-s3]
Add board layer SHA accelerator support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-09 12:13:06 +08:00
wangjianyu3
e5b138dee0 boards/szpi-esp32s3: Enable touchscreen for LVGL
1. Rotate the video screen 90 degrees right.
2. Enable touchscreen for the LVGL configuration "lckfb-szpi-esp32s3:lvgl" and add lvgldemo autostart.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-07-07 08:46:58 -03:00
Eren Terzioglu
5991a8c4cc xtensa/espressif: Change LEDC implementation to common for Xtensa based Espressif chips
Change LEDC implementation to common one for esp32[-s2|-s3]

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-07-05 11:12:06 +08:00
Filipe Cavalcanti
187a386cc7 arch/xtensa: update lower-half drivers for ESP32|S2|S3 2025-06-30 22:40:26 +08:00
wangjianyu3
5079105e17 boards: net tcp backlog is enabled by default
The configuration NET_TCPBACKLOG is enabled by default.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-26 09:32:54 -03:00
halyssonJr
3ecdcf556e add lcd suport 2025-06-24 16:29:00 +08:00
Filipe Cavalcanti
02dae3e5eb boards/xtensa: add SDMMC SPI defconfig to ESP32|S2|S3 boards
Adds a defconfig for SDMMC over SPI to the following boards:
esp32-devkitc, esp32s2-saola-1 and esp32s3-devkit.

Renames the defconfig name for:
esp32-lyrat and esp32-wrover-kit.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-24 08:08:55 +08:00
Filipe Cavalcanti
aedce4c648 boards/xtensa/esp32: use common board source for SDMMC
Deletes board specific sdmmc implementation in favor of a common source and header file.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-24 08:08:55 +08:00
Filipe Cavalcanti
452292159b boards/xtensa: support SDMMC over SPI on ESP32-S2|S3
Adds support for SDMMC over SPI on ESP32S2 and ESP32S3.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-24 08:08:55 +08:00
halyssonJr
4193fe6e2b add support to a new board : esp32s3-8048s043. 2025-06-24 01:10:49 +08:00
wangjianyu3
1c7da08b94 boards/esp32s3-devkit: update config for fastboot
Initializing configuration for Fastboot TCP network device.

esp32s3-devkit:fastboot     : Fastboot TCP and USB transport enabled
esp32s3-devkit:fastboot_usb : Fastboot USB transport enabled only
esp32s3-devkit:fastboot_tcp : Fastboot TCP transport enabled only

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-21 04:21:29 +08:00
wangjianyu3
af36267762 boards/szpi-esp32s3: update config for fastboot
Initializing configuration for Fastboot TCP network device.

lckfb-szpi-esp32s3:fastboot     : Fastboot TCP and USB transport enabled
lckfb-szpi-esp32s3:fastboot_usb : Fastboot USB transport enabled only
lckfb-szpi-esp32s3:fastboot_tcp : Fastboot TCP transport enabled only

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-06-21 04:21:29 +08:00
robert
be8471625f Add BLE config to esp32-sparrow 2025-06-11 15:48:25 +08:00
raiden00pl
0b3245f701 boards: unify Private Types banners
unify Private Types banners according to NuttX coding standard

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-05-28 10:17:15 +08:00
Aung Khant Maw
29c4c87e2c boards/xtensa: Add GC9A01 LCD support for esp32 boards
esp32 based boards will now be able to use GC9A01 LCD driver for LVGL.

- Enabling CONFIG_LCD_GC9A01 will now flip spi_cmddata pin
- Added esp32_gc9a01.c file.

Signed-off-by: Aung Khant Maw <aungkhantmaw64@gmail.com>
2025-05-26 22:01:22 +08:00
Vlad Pruteanu
82effd4b2f xtensa/esp32: Add support for hardware accelerated SHA
This enables the use of the cryptographic accelerator within
the ESP32. The support algorithms are: SHA1, SHA256, SHA384
and SHA512.

Signed-off-by: Vlad Pruteanu <pruteanuvlad1611@yahoo.com>
2025-05-26 15:23:51 +08:00
Lars Kruse
3ce85ca54e style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
Martin Vajnar
68b22fee3c Update defconfigs
Remove SENSORS and SENSORS_QENCODER as it is selected by ESP_PCNT_AS_QE.
2025-05-16 11:10:29 -03:00
Martin Vajnar
3e100e3c86 esp32[c6|h2|s2|s3]: Assign Edge/Level GPIO pin numbers when in Quadrature Encoder mode
Only 2 pins are needed in this mode for both channels. The wiring
is such that Edge and Level pins are cross-connected for both
channels.
2025-05-16 11:10:29 -03:00
Martin Vajnar
51a75e622f esp32[c6|h2|s3|s2]: Fix assignment of Edge/Level GPIO pins in PCNT 2025-05-16 11:10:29 -03:00
Eren Terzioglu
d471609267 boards/xtensa: Add dedicated GPIO board level support for esp32[-s2|-s3]
Add board level dedicated GPIO support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-14 19:38:21 +02:00
Eren Terzioglu
4b36d69630 boards/xtensa: Add SDM peripheral board layer support for esp[-|-s2|-s3]
Add SDM perpiheral board layer support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-09 19:20:47 +08:00
Filipe Cavalcanti
28abfb5fd1 boards/esp32s3: fix rtc segment on linker script
Modify rtc_data_seg to rtc_slow_seg to fix RTC problems.
The proper location for those is in RTC slow memory.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-05-05 23:50:52 +08:00
Filipe Cavalcanti
e837b26518 boards/esp32s2: add -fno-omit-frame-pointer to saola board
This change affects esp32s2-saola-1 board when optimizations are enabled.
Fixes issue on timer defconfig.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-04-30 13:41:06 +08:00
Tiago Medicci Serrano
4a8af202c6 boards/xtensa/esp32[|s2|s3]: Fix unknown disassembling instructions
This commit adds sections used by the debugger and disassembler to
get more information about raw data present in the code.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-24 10:05:37 -03:00
Tiago Medicci Serrano
216c4b00e2 boards/[risc-v|xtensa]/esp32[|c3|c6|h2|s3]: set coexiram sections
This commit sets the coexiram (from libcoexist.a) sections on IRAM.

Before this commit, no other rules matched such sections and the
sections could be placed outside markers that denote the end of the
text sections, causing unexpected errors.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-23 16:17:17 +08:00
Filipe Cavalcanti
6a721b859c boards/xtensa: fix build errors related to data types on ESP32|S3
Fix format specifier macros after compiler type changes.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>

Fix boards with PRI
2025-04-18 09:32:58 +08:00
Tiago Medicci Serrano
2bbafcacc1 xtensa/esp32s3: Fix getting the flash mappings by openocd-esp32
This adds new fields to the metadata section used by MCUBoot.
The openocd-esp32 project requires these fields to properly map the
flash segments and enable using SW breakpoints and flash through
openocd-esp32.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-18 02:25:14 +08:00
Tiago Medicci Serrano
31b6cdac6d xtensa/esp32s2: Fix getting the flash mappings by openocd-esp32
This adds new fields to the metadata section used by MCUBoot.
The openocd-esp32 project requires these fields to properly map the
flash segments and enable using SW breakpoints and flash through
openocd-esp32.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-18 02:25:14 +08:00
Tiago Medicci Serrano
7a3e67d59a xtensa/esp32: Fix getting the flash mappings by openocd-esp32
This adds new fields to the metadata section used by MCUBoot.
The openocd-esp32 project requires these fields to properly map the
flash segments and enable using SW breakpoints and flash through
openocd-esp32.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-18 02:25:14 +08:00