Commit Graph

1584 Commits

Author SHA1 Message Date
chenwen@espressif.com
5b83af1607 xtensa/esp32s3: Fix duplicate definition warnings
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-04-03 23:12:43 +02:00
Tiago Medicci Serrano
9520edeb16 espressif/rmt: Fix minor issues regarding formatting and comments
This commit only fix minor issues regarding formatting and comments
2024-04-02 14:50:59 -03:00
Tiago Medicci Serrano
5ba40d083a esp32/rmt: Use the Espressif`s common RMT driver.
This commit implements the common RMT driver (already available for
the other Espressif's xtensa-based devices) for ESP32.
This allows us to have a proper separation between the lower and
upper-half drivers and use the 'ws2812' example to drive WS2812 RGB
LEDs.
2024-04-02 14:50:59 -03:00
Tiago Medicci Serrano
6b73782c27 esp32: Remove outdated/unnecessary code
These functions are no more used directly by NuttX. There is no
need to keep them.
2024-04-02 14:50:59 -03:00
Tiago Medicci Serrano
4b3b22cbeb esp32/rmt: Remove outdated RMT driver
The new common RMT driver - already available for ESP32-S2 and
ESP32-S3 - will be implemented in another commit for ESP32.
2024-03-29 16:14:27 +08:00
Tiago Medicci Serrano
573e1a255f esp32s3/[ble/wifi]: Improve code compatibility between SoCs
Introduces a couple of minor changes to make it easier to keep the
code update between different Espressif's SoCs.
2024-03-29 16:14:27 +08:00
Tiago Medicci Serrano
2f8e0c7fd4 esp32s3/ble: Rearrange types, data and functions order
This commit just rearranges the order of the types, data and
functions without modifying them. This is done to make it look more
similar with ESP32's ble adapter and ease maintanence.
2024-03-29 16:14:27 +08:00
Tiago Medicci Serrano
62fbb7f03a esp32s3/ble: Update the name of the interrupt status flags
In order to avoid confusion with other interrupt status flags used
by the system and the common source, rename it to be more specific.
2024-03-29 16:14:27 +08:00
Tiago Medicci Serrano
c07f8ab312 esp32s3: use common espressif code instead of chip-specific.
Most of the functions used to set the peripherals are available for
all Espressif's chips. This commit uses this set of functions and
remove outdated functions that perform the same operations in a
chip level.
2024-03-29 16:14:27 +08:00
Tiago Medicci Serrano
09464ff9bc esp32/[ble/wifi]: Update the wireless drivers
This commit updates the Wi-Fi and the BLE driver of ESP32. Most of
the changes rely on using the common sources and header files for
xtensa-based Espressif's SoCs.

The new Wi-Fi driver supports WPA3-SAE for both Station and SoftAP
mode. BLE's coexistence mode was enhanced according to the latest
libraries.

Please note that other sources required minor changes in order to
be compatible with the common sources.
2024-03-29 16:14:27 +08:00
Tiago Medicci Serrano
007dd34ce8 esp32s3/spiflash: Fix error to pause the other CPU during operation
Whenever a SPI flash operation will take place, it's necessary to
disable the cache and run no code from the flash. This includes
pausing the other CPU (when `CONFIG_SMP=y`). This commit prevents
an error to occur when the CPU core is evaluated before the task
is increased to the max priority.
2024-03-29 16:14:27 +08:00
Tiago Medicci Serrano
78fbc2fc64 esp32/spiflash: Fix error to pause the other CPU during operation
Whenever a SPI flash operation will take place, it's necessary to
disable the cache and run no code from the flash. This includes
pausing the other CPU (when `CONFIG_SMP=y`). This commit prevents
an error to occur when the CPU core is evaluated before the task
is increased to the max priority.
2024-03-29 16:14:27 +08:00
chenwen@espressif.com
ffc7442af2 xtensa/esp32s3: Add ESP32-S3 AES driver
1. Support AES-128/AES-256 encryption and decryption

Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-03-28 09:34:04 +08:00
chenwen@espressif.com
2911c3aed6 xtensa/esp32s3: Add 16-byte-align SPI-Flash encryption write
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-03-27 17:10:32 +08:00
Dong Heng
397396c587 xtensa/esp32s3: Fix one page program span over 2 pages
One page program can't span over 2 pages.
2024-03-27 17:08:17 +08:00
Tiago Medicci Serrano
075b0e5ac0 esp32s2: Update libc stubs to properly acquire/release locks.
Avoid using static mutex and recursive mutex as the resource to be
acquired/release. Instead, create a specific lock for each call if
it does not exist.
2024-03-26 13:53:39 -03:00
Tiago Medicci Serrano
d56e6de628 esp32: Update libc stubs to properly acquire/release locks.
Avoid using static mutex and recursive mutex as the resource to be
acquired/release. Instead, create a specific lock for each call if
it does not exist.
2024-03-26 13:53:39 -03:00
Tiago Medicci Serrano
44e2e9011f esp32s3: Update libc stubs to properly acquire/release locks.
Avoid using static mutex and recursive mutex as the resource to be
acquired/release. Instead, create a specific lock for each call if
it does not exist.
2024-03-26 13:53:39 -03:00
simbit18
ac2021b906 Fix Kconfig style
Replace help => ---help---
Remove spaces from Kconfig
Add comments
2024-03-21 22:28:49 +08:00
Marco Casaroli
d048caf1d2 arch/esp32 add openeth mac driver
This driver is used with QEMU, to make it possible
to use networking.

This is not the MAC in ESP32, however, it can be used with QEMU.

The code was shamelessly copied from 31dac92e5f
2024-03-12 08:31:06 -03:00
chenwen@espressif.com
277ca97b44 xtensa/esp32: Fix wrong interrupt number
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-03-12 14:36:50 +08:00
Xiang Xiao
64ea027b1a Replace PRIxPTR with %p and remove the cast of (uintptr_t)
The cast of (uintptr_t) is not necessary, and it is better to use %p

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2024-03-07 09:59:42 -03:00
chenwen@espressif.com
53f50c8183 xtensa/esp32s3: Configure DMA maximum buffer size based on access to different RAM
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-03-07 13:32:28 +08:00
chenwen@espressif.com
09960c5c7d xtensa/esp32s3: Fix the issue of erasing a wide range of flash sectors
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-03-06 18:13:20 +08:00
Yanfeng Liu
a66c7c3ee1 comments/docs: fix typos in comments
This fix some typos in comments.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2024-03-06 13:31:50 +08:00
trns1997
54e9e582d5 Use C++ standard lib from toolchain
Signed-off-by: trns1997 <trns1997@gmail.com>
2024-03-06 08:42:44 +08:00
Marco Casaroli
73c4f2f1e7 fix(esp32s3_spiflash_mtd): debug type specifiers
These log messages are wrong if we use CONFIG_FS_LARGEFILE.
2024-03-05 22:23:50 +08:00
Marco Casaroli
0c50af583d feat(esp32s3-bootloader): allow 32MB flash
The scripts already support, we are just
missing the entry in the config.
2024-03-01 16:51:47 -03:00
Marco Casaroli
447cc9698f use apps-or-nuttx-Make.defs for archs
This will allow apps to tweak build configuration of NuttX
2024-03-01 12:59:16 -03:00
ligd
2241969e5a SMP: fix crash when switch to new task which is still running
cpu0 thread0:                        cpu1:
sched_yield()
nxsched_set_priority()
nxsched_running_setpriority()
nxsched_reprioritize_rtr()
nxsched_add_readytorun()
up_cpu_pause()
                                     IRQ enter
                                     arm64_pause_handler()
                                     enter_critical_section() begin
                                     up_cpu_paused() pick thread0
                                     arm64_restorestate() set thread0 tcb->xcp.regs to CURRENT_REGS
up_switch_context()
  thread0 -> thread1
arm64_syscall()
    case SYS_switch_context
     change thread0 tcb->xcp.regs
    restore_critical_section()
                                     enter_critical_section() done
                                     leave_critical_section()
                                     IRQ leave with restore CURRENT_REGS
                                     ERROR !!!

Reason:
As descript above, cpu0 swith task: thread0 -> thread1, and the
syscall() execute slowly, this time cpu1 pick thread0 to run at
up_cpu_paused(). Then cpu0 syscall execute, cpu1 IRQ leave error.

Resolve:
Move arm64_restorestate() after enter_critical_section() done

This is a continued fix with:
https://github.com/apache/nuttx/pull/6833

Signed-off-by: ligd <liguiding1@xiaomi.com>
2024-03-01 21:05:00 +09:00
Tiago Medicci Serrano
b03c9cf5f8 esp32s3: Fix symbol collision between mbedTLS and the Wi-Fi driver
This commit closes #11738. Actual fix is tracked in:
https://github.com/espressif/esp-hal-3rdparty/pull/2
2024-02-29 20:47:19 +01:00
chao an
6d50274ebe nuttx/list: rename container_of to list_container_of from public header
Use private naming to avoid conflicts with user applications

In file included from libuv/src/unix/internal.h:25,
                 from libuv/src/unix/udp.c:23:
libuv/src/uv-common.h:57: warning: "container_of" redefined
   57 | #define container_of(ptr, type, member) \
      |
In file included from nuttx/include/nuttx/list.h:47,
                 from nuttx/include/nuttx/tls.h:40,
                 from nuttx/include/nuttx/sched.h:48,
                 from nuttx/include/nuttx/arch.h:87,
                 from nuttx/include/nuttx/userspace.h:35,
                 from nuttx/include/nuttx/mm/mm.h:30,
                 from nuttx/include/nuttx/kmalloc.h:34,
                 from nuttx/include/nuttx/lib/lib.h:31,
                 from nuttx/include/stdio.h:35,
                 from apps/system/libuv/libuv/include/uv.h:59,
                 from libuv/src/unix/udp.c:22:
nuttx/include/nuttx/nuttx.h:48: note: this is the location of the previous definition
   48 | #define container_of(ptr, type, member) \
      |

Signed-off-by: chao an <anchao@lixiang.com>
2024-02-29 19:44:54 +08:00
chenwen@espressif.com
1665114fd1 xtensa/esp32: Fix issue of system blocking when SPIRAM is used as stack
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-02-28 13:31:30 +08:00
chenwen@espressif.com
c14888e759 xtensa/esp32s3: Add the return value of SPI driver
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-02-28 13:30:18 +08:00
chenwen@espressif.com
638df3329b xtensa/esp32s3: Fix issue of system blocking when SPIRAM is used as stack
1. Fix issue of system blocking due to disable dcache.
   2. Support Ext-SRAM-Cache mmu mapping in SMP mode.

Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-02-26 12:38:30 -03:00
nuttxs
d2b4734756 Deinitialize ESP32-S3 SPI slave GDMA engine 2024-02-22 04:34:29 -08:00
simonatoaca
bb6f32d610 esp32-sparrow-kit: Add I2S support for the board's microphone
The board's microphone uses 24-bit i2s and this commit also fixes
the segmentation fault caused by the audio buffer overflow.

arch/xtensa/src/esp32/esp32_i2s.c: Fix bug regarding 24-bit audio and add AUDIOIOC_STOP to ioctl
drivers/audio/audio_i2s.c: Report number of channels on AUDIOIOC_GETCAPS
in boards/xtensa/esp32/esp32-sparrow-kit:
	/configs/nsh/defconfig: Add I2S configs
	/src/esp32-sparrow-kit.h: Add the signature of esp32_i2sdev_initialize()
	/src/esp32_bringup.c: Add call to esp32_i2sdev_initialize()

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>
2024-02-20 06:46:06 -08:00
Tiago Medicci Serrano
62a608b558 xtensa/esp_ws2812: Get actual RMT clock to encode WS2812 data
WS2812 data is encoded into RMT items according to the RMT clock
source. This commit makes it by using the actual clock source in
spite of a pre-defind value.
2024-02-19 19:02:34 -08:00
Eren Terzioglu
de948babbf xtensa/esp32s2: Fix esp32s2 wdt interrupt bug 2024-02-13 10:31:35 -03:00
Tomáš Pilný
3e85c1886e esp32/dac-one-shot: lower-half driver for ESP32 internal DAC
Enable with ./tools/configure.sh -l esp32-devkitc:dac
DAC channel 0 = GPIO 25
DAC channel 1 = GPIO 26
default path: /dev/dac0

Resolution 8 bits = values 0~255
Voltage: 0~Vref

The reference voltage 'Vref' here is input from the pin VDD3P3_RTC
which ideally equals to the power supply VDD (3.3V).
2024-02-02 09:23:28 -08:00
chenwen@espressif.com
ba1b96e9d9 xtensa/esp32s3: Add DMA peripheral to spi driver configuration
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-01-26 19:14:04 -08:00
chenwen@espressif.com
8bef8ee9d5 xtensa/esp32s3: Fix crash issue that occurs when deleting a semaphore in WPA3
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-01-26 04:45:26 -08:00
Tiago Medicci Serrano
641a0df27f esp32s3: Improve selection of the bootloader being used on Kconfig
- A pre-built IDF bootloader is used by default;
- `ESP32S3_PARTITION_TABLE` requires the IDF bootloader to be built
from sources.
- Native MCUboot also can be used to boot the device. It will be
built from sources and depends on !ESP32S3_PARTITION_TABLE.
2024-01-25 11:22:39 -03:00
Tiago Medicci Serrano
1e1ea7bb5d esp32s2: Improve selection of the bootloader being used on Kconfig
- A pre-built IDF bootloader is used by default;
- `ESP32S2_PARTITION_TABLE` requires the IDF bootloader to be built
from sources.
- Native MCUboot also can be used to boot the device. It will be
built from sources and depends on !ESP32S2_PARTITION_TABLE.
2024-01-25 11:22:39 -03:00
Tiago Medicci Serrano
ec3714c816 esp32: Improve selection of the bootloader being used on Kconfig
- A pre-built IDF bootloader is used by default;
- `ESP32_PARTITION_TABLE` requires the IDF bootloader to be built
from sources.
- Native MCUboot also can be used to boot the device. It will be
built from sources and depends on !ESP32_PARTITION_TABLE.
2024-01-25 11:22:39 -03:00
chenwen@espressif.com
bdd02cc624 xtensa/esp32s3: Add APIs to release DMA channel resources
Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
2024-01-23 17:16:16 -03:00
w2016561536
6b5ca79509 esp32s3/spi-dma: Fix spi dma transfer.
Fix esp32s3 spi dma transfer only transmit first byte and receive empty problem.
2024-01-23 04:05:52 -08:00
Tiago Medicci Serrano
0ecc3aaad2 esp32: Explicitly fail on boot-up for unsupported ESP32 versions.
ESP32 is supported on NuttX starting from chip revision 3.0. This,
however, didn't prevent the user from using older chip revisions,
which caused unexpected behaviors. This commit checks chip revision
before finishing booting NuttX.
2024-01-21 06:33:25 -08:00
Tiago Medicci Serrano
2954551ef6 esp32/hardware/esp32_efuse.h: Update macros for registers.
This commit is intended to update the EFUSE's register content and
update related configs:
 - Remove duplicated configs from `esp32_soc.h`;
 - Add missing header files from APB registers;
 - Add missing macro definitions from EFUSE;
 - Update related code to use the new macros;
2024-01-21 06:33:25 -08:00
Tiago Medicci Serrano
8752e6d863 esp32/hardware: Rename efuse_reg.h to esp32_efuse.h. 2024-01-21 06:33:25 -08:00