Commit graph

1916 commits

Author SHA1 Message Date
Filipe Cavalcanti
294848e623 arch/xtensa: decouple common source for Espressif's MCUBoot port
Decouples the NuttX build from the MCUBoot common source on Xtensa
devices. Allows using different branches for each.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-06-14 17:11:58 +08:00
Jukka Laitinen
56ad0d6837 arch: Flag all definitions of up_perf_* functions with CONFIG_ARCH_HAVE_PERF_EVENTS
Use the flag CONFIG_ARCH_HAVE_PERF_EVENTS to detect whether the architecture specific code
provides the up_perf_* functions. Now it is mixed with CONFIG_ARCH_PERF_EVENTS, which should
select just whether the perf events (perf_*) are enabled for the configuration.

- drivers/timers/arch_alarm.c: Don't compile the up_perf_* functions here if the
  CONFIG_ARCH_HAVE_PERF_EVENTS is defined
- arch/*/*_perf.c: Change CONFIG_ARCH_PERF_EVENTS -> CONFIG_ARCH_HAVE_PERF_EVENTS to
  select whether architecture specific up_perf_* functions are provided

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-06-06 17:31:10 +08:00
wangzhi16
35a62b7d5e Revert "Reduce the size of tcb by four bytes."
This reverts commit 893c5e92c2.
2025-05-27 16:30:35 +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
3dc53adb28 arch | boards | drivers: fix whitespace issues for switch case statements 2025-05-23 10:48:41 +08:00
Lars Kruse
3ce85ca54e style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
Martin Vajnar
a3d0411c24 Select SENSORS_QENCODER as dependency for Quadrature Encoder mode of PCNT unit 2025-05-16 11:10:29 -03:00
Martin Vajnar
abac610d13 xtensa|espressif: Unify Quadrature Encoder handling among units 2025-05-16 11:10:29 -03:00
Lars Kruse
4568110d63 fix misspelled names in locally scoped code
These misspelled words are used in strictly local scopes.
Renaming these variables should not cause any problems.
2025-05-15 10:12:12 +08:00
Eren Terzioglu
ea8744631a arch/xtensa: Update common layer version for esp32s3
Update common layer version for esp32s3 to fix warnings when building

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-14 19:38:21 +02:00
Eren Terzioglu
e9e3a0ecf7 arch/xtensa: Add dedicated GPIO support for esp32[-s2|-s3]
Add 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
simbit18
ea47f0cf42 [Kconfig]: Fix Kconfig style
Remove spaces from Kconfig files
Add comments
Add TABs

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-05-14 21:15:14 +08:00
buxiasen
cd7a8f73eb comments: update text typo pre-empted to preempted
Or will be catch by codespell, when do checkpatch.sh

Also fix the relative comment file changed.

include/nuttx/scsi.h
drivers/syslog/ramlog.c
excluded as we have to modify field name in struct

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2025-05-12 15:01:37 +08:00
Eren Terzioglu
39465d2156 arch/xtensa: Add SDM peripheral support for esp32[-|-s2|-s3]
Add SDM peripheral support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-05-09 19:20:47 +08:00
Tiago Medicci Serrano
c22df41ca6 espressif: Add variable to override MCUboot version and URL
The version and the git repository of Espressif's MCUboot port can
be changed by setting the `MCUBOOT_VERSION` and `MCUBOOT_URL`
environment variables before running the `make bootloader` command.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-05-07 01:51:40 +08:00
nuttxs
c4506929e9 arch/esp32_partition.c: fix the issue of switching from Factory to OTA_1
with a fixed seq of 1, which causes ota_get_bootseq() to return ota_0.

The current solution is to directly use the target partition's number (num)
as next_seq to ensure the correct increment logic of seq. Ensure the formula
(seq-1) % OTA_DATA_NUM + OTA_IMG_BOOT_OTA_0 correctly maps to ota_0 or ota_1

Signed-off-by: nuttxs <zhaoqing.zhang@sony.com>
2025-04-28 22:23:16 +08:00
Kevin Zhou
fb5f27e984 xtensa/esp32s3: fix tickless mode timer unexpect interrupt handle
Signed-off-by: Kevin Zhou <kevin.zhou@sony.com>
2025-04-28 22:13:52 +08:00
Filipe Cavalcanti
b8e9bc3313 arch/xtensa: fix build errors related to data types on ESP32|S2|S3
Fix format specifier macros after compiler type changes.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-04-18 09:32:58 +08:00
Filipe Cavalcanti
0715c584b7 arch/xtensa: use compiler's definition of uint32 and int32
Modify types.h and inttypes.h to use the correct _int32_t and _uint32_t types.
Type is now defined according to recent compiler versions.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
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
Filipe Cavalcanti
99099a1a9d arch/xtensa: ADC support on ESP32|S2|S3
Add common ADC source for ESP32|S2|S3.
Remove legacy ADC from ESP32S3.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2025-04-17 13:56:40 +08:00
anjiahao
28ad852a6c arch/xtensa:add crt0 to initialize environment
we use crt0 inside of start hook in pr https://github.com/apache/nuttx/pull/16154, so xtensa also need add it.

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-04-16 01:24:57 +08:00
chao an
52482219c8 libc/elf: rename modlib to libelf
Renaming "modlib" to "libelf" is more in line with the implementation content,
which makes it easier for individual developers to understand the capabilities of this module.

CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-04-11 09:43:22 +08:00
anjiahao
422c43949a binfmt:use crt0 inside of starthook
test:
1.use mps3-an547 build helloxx as module and run it
2.use qemu-armv7a:knsh test kernel build helloxx and run it

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2025-04-09 23:07:29 +08:00
Tiago Medicci Serrano
05e63e31c4 arch/xtensa/espressif: Fix ESP32-S2 SPI flash frequency selection
This commit fixes the SPI flash frequency selection for ESP32-S2,
enabling the Kconfig macros to be selected when ESP32-S2 SoC is
enabled. Please note that this was recently changed to make it
compatible with already existing SPI flash Kconfig macros for ESP32
and ESP32-S3 and it introduced this regression for ESP32-S2.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-09 14:00:08 +08:00
Eren Terzioglu
8a835dd545 arch/xtensa: Remove legacy I2S implementation for esp32[-|-s2|s3]
Remove legacy I2S implementation without breaking defconfigs for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-04-08 22:53:58 +08:00
Eren Terzioglu
97ff8906e4 arch/esp[s2|s3]: Update common layer version
Update common layer version of Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-04-08 22:53:58 +08:00
Eren Terzioglu
873a6319bb arch/esp32[s2|s3]: Add common I2S arch layer support
Add common I2S arch layer support for Xtensa based Espressif devices

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-04-08 22:53:58 +08:00
Eren Terzioglu
fd4914b953 arch/xtensa/esp32[s3]: Add more dma functions
Add dma function to use peripheral more efficiently

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-04-08 22:53:58 +08:00
chenxiaoyi
b3567fe964 xtensa/esp32s2: enable sysclk and deassert reset signal for uart1
The uart1 is found be in reset state, and the sysclk is not enabled
for it.

Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
2025-04-08 22:44:59 +08:00
Tiago Medicci Serrano
622355b5c3 arch/xtensa/esp32s3: Fix bug regarding SPI flash operation mode
SPI flash operation modes - Dual Output (dout), Dual I/O (dio),
Quad Output (qout), Quad I/O (qio) and Octal (opi) were not being
properly selected. This commit fixes this behavior and the device
is now able to boot and initialize the proper SPI flash mode.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-08 14:44:38 +08:00
Tiago Medicci Serrano
80559890ff espressif: Simplify the selection of the SPI flash frequency
This commit simplifies the selection of the SPI flash frequency for
Espressif SoCs by using a standardized Kconfig-defined macro.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-05 11:26:32 +08:00
Tiago Medicci Serrano
1e8250d918 boards/xtensa/esp32s3: Move some .bss sections to the external RAM
This commit moves some internal libraries' .bss sections to the
external PSRAM chip, freeing internal memory for other usages. Note
that it is necessary to update `esp32s3-devkit:python` defconfig
otherwise it would fail to build.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-04-05 11:24:58 +08:00
Laczen JMS
34bb3c88a2 arch/xtensa/src/esp32: remove espnow
remove espnow pktradio from arch/xtensa/src/esp32

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-04-04 06:49:50 +08:00
Laczen JMS
58463d9484 arch/xtensa/src/common/espressif: Introduce espnow
Move espnow:
 arch/xtensa/src/esp32 -> arch/xtensa/src/common/espressif

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-04-04 06:49:50 +08:00
raiden00pl
5d2e0f8c80 arch/esp32s3/esp32s3_wdt_lowerhalf.c: fix printf warning
fix printf warning:

chip/esp32s3_wdt_lowerhalf.c:497:17: error: format '%u' expects argument of
type 'unsigned int', but argument 4 has type 'long unsigned int'

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-02 08:29:00 -03:00
raiden00pl
649e979f58 arch/esp32s2/esp32s2_wdt_lowerhalf.c: fix printf warning
fix printf warning:

chip/esp32s2_wdt_lowerhalf.c:493:17: error: format '%u' expects argument of
type 'unsigned int', but argument 4 has type 'long unsigned int'

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-02 08:29:00 -03:00
raiden00pl
1a6cb4c784 arch/esp32s3/esp32s3_ble_adapter.c: fix printf warning
fix printf warning:

chip/esp32s3_ble_adapter.c:1065:13: error: format '%u' expects argument of
type 'unsigned int', but argument 3 has type 'long unsigned int'

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-02 08:29:00 -03:00
raiden00pl
ea28e08be4 arch/esp32/esp32_ble_adapter.c: fix printf warning
fix printf warning:

  chip/esp32_ble_adapter.c:1137:13: error: format '%u' expects argument of
  type 'unsigned int', but argument 3 has type 'long unsigned int'

Signed-off-by: raiden00pl <raiden00@railab.me>
2025-04-02 08:29:00 -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
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
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
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
Eren Terzioglu
43f982db1a arch/xtensa/esp32s3: Change default pins for esp32s3-lcd-ev-board v1.5
Change default pins for esp32s3-lcd-ev-board to prevent pin changes between boards

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2025-03-24 21:28:04 +08:00