Commit Graph

73 Commits

Author SHA1 Message Date
Tiago Medicci Serrano 17447622bf esp32s3/wifi: support the Wi-Fi to work with protected build
- Added Wi-Fi related symbols to the kernel-space linker;
- Allocate more RAM to the kernel (to be useb by the Wi-Fi driver).
- Create a specific defconfig.
2023-08-02 21:38:44 +02:00
Tiago Medicci Serrano 1197a80741 esp32s3: Enhance protected build linker scripts and memory layout
Instead of setting kernel/user space instruction and data ROM as
hard-coded values on linker, set them according to the max size
of the kernel image set by CONFIG_ESP32S3_KERNEL_IMAGE_SIZE. This
is done by making KIROM, UIROM, KDROM and UDROM dependent on the
kernel size value. Also, override CONFIG_NUTTX_USERSPACE config
according to CONFIG_ESP32S3_KERNEL_IMAGE_SIZE by using a custom
PREBUILD definition.
2023-08-02 21:38:44 +02:00
Xiang Xiao 0eeca0f375 build: Replace "$(shell $(INCDIR) $(CC) ...)" with $(INCDIR_PREFIX)
to unify the way to get include directories

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-23 00:11:25 +03:00
simbit18 f930b4f6f5 Fix Kconfig style
Remove TABs from Kconfig files
Replace help => ---help---
Add comments
2023-06-20 12:54:50 -03:00
Alan Carvalho de Assis 985e2beae0 esp32s3-devkit: Add NSH terminal over USB Device (not USB-JTAG-Serial) 2023-06-19 11:02:08 +08:00
Lucas Saavedra Vaz fa5db655cd boards/xtensa/esp32s3-devkit: Revert NSH defconfig deletion
Restore the NSH defconfig
2023-06-16 14:35:18 -03:00
Dong Heng d492823128 xtensa/esp32s3: Add USB OTG device driver 2023-06-14 18:04:27 -03:00
Tiago Medicci Serrano 223c5a3722 xtensa/esp32_esp32s2_esp32s3: enable syslog bufferring
By enabling the syslog buffering on xtensa-based devices, it's
possible to ensure concurrent tasks will not mess with the syslog
messages.
2023-06-02 10:17:54 +08:00
Tiago Medicci Serrano 1bc4b8d7b2 esp32s3/wifi: enable SMP by default on Wi-Fi-related defconfigs
In order to enhance the Wi-Fi performance, enable SMP by default to
make use of the dual-core functionality of the ESP32-S3.
2023-05-24 00:37:46 +08:00
Tiago Medicci Serrano c60d59d825 esp32s3: add dedicated interrupt stack for ESP32-S3 by default
This config also prevents crashes due to the commit 6be363f, which
fix a race condition in multi-threaded write/read of the serial
driver, but increases stack size.
2023-05-23 13:39:50 +08:00
Tiago Medicci Serrano b680abd04b esp32s3/wifi: use `wapi`s init config to save Wi-Fi data
Instead of using Espressif's emulated NVS to save Wi-Fi data, use
`wapi`s wireless configure initialization mechanism for saving
Wi-Fi data. It 1) avoids creating a specific storage partition
just to save Wi-Fi data (ESP32-S3's storage partition is used
instead); 2) avoids initialization problems of the emulated NVS
when SMP is enabled (the Wi-Fi driver tries to initialize it before
the actual partition is initialized); and 3) enables reconnecting
using `wapi reconnect` command and connect the device automatically
on bringup if `CONFIG_NETUTILS_NETINIT` is selected.
2023-05-12 01:09:09 +08:00
Alan Carvalho de Assis 37f318c038 boards/esp32s3: Add RTC initialization 2023-05-06 11:43:01 +08:00
Dong Heng bd122915f0 xtensa/esp32s3: Support octal lines mode SPIRAM 2023-05-05 18:38:12 +08:00
Tiago Medicci Serrano a86a9dc09e esp32s3/wifi: fix Wi-Fi's NVS-like storage long filename error
While using NVS-like storage of the Wi-Fi driver, an error was
thrown while trying to access a file whose name was longer than
the mounted SPIFFS `CONFIG_SPIFFS_NAME_MAX`.
2023-05-03 23:23:31 +08:00
Gustavo Henrique Nihei 9affcb8673 boards: Update tickless defconfigs with ostest for testability
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-04-06 19:29:23 +03:00
Lucas Saavedra Vaz 1b87c86619 boards: Update and fix configs for ESP boards 2023-03-25 12:23:35 +02:00
Tiago Medicci Serrano d4b11a960f esp32s3/wifi: add support to softAP (softAP and softAP + STA mode) 2023-03-16 19:07:25 +01:00
Tiago Medicci Serrano 8f2cdc4e60 esp32s3/wifi: add support for Wi-Fi (Station mode)
1) Wi-Fi driver libs from Espressif ESP-IDF release/v5.0;
2) Station mode only;
3) WPA2-PSK and WPA3-SAE enabled;

Not yet supported (WIP):
- SoftAP mode;
- 802.11k, 802.11v and 802.11R;
- Power Save mode;
- BLE Coexistance;
2023-03-10 10:59:14 +02:00
Tiago Medicci Serrano 1fc73087da esp32s3: add reset/shutdown handler to run registered callbacks 2023-03-10 10:59:14 +02:00
Lucas Saavedra Vaz 35f830b19a boards: Add CoreMark config to ESP boards 2023-03-08 13:11:13 +08:00
Alan Carvalho de Assis 63a847ebca esp32s3-devkit: Add support LED PWM initialization 2023-02-08 11:02:19 +08:00
Alan Carvalho de Assis f2b53d7234 Add board config example to test random number generator 2023-01-27 13:16:35 +08:00
Gustavo Henrique Nihei e77e12e145 espressif: Stabilize MCUboot support on Espressif chips
MCUboot support is no longer behind EXPERIMENTAL for the following
chips:
- ESP32
- ESP32-S2
- ESP32-S3
- ESP32-C3

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-01-24 08:44:22 +09:00
Alan Carvalho de Assis f0289577bf boards: Update all boards config after updating NSH_CMDPARMS 2023-01-23 03:04:51 +08:00
Alan Carvalho de Assis 1be9d7c57f esp32s3-devkit: Initialize EFUSE driver 2023-01-20 15:40:46 +08:00
Almir Okato 8f3c425067 xtensa/esp32s3: Enable booting from MCUboot bootloader
Add support for booting from MCUboot bootloader on ESP32-S3.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-12-15 00:42:13 +08:00
Gustavo Henrique Nihei ca16e9bbd5 xtensa/esp32s3: Simplify board linker script selection
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-12-08 21:55:29 +08:00
Gustavo Henrique Nihei 1ecaa4e672 xtensa/esp32s3: Configure the PMS peripheral for Protected Mode
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-12-07 03:07:45 +08:00
Gustavo Henrique Nihei bfc40c74d0 xtensa/esp32s3: Add support for Protected Mode
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-12-07 03:07:45 +08:00
Lucas Saavedra Vaz a926445995 boards: Fix buttons GPIO IRQ on ESP boards 2022-11-28 17:24:57 -03:00
Tiago Medicci Serrano d3ffeb40a7 libc/machine/xtensa: make longjmp safe against context switch
In order to turn longjmp context-switch safe, it's necessary
to disable interrupts before modifying windowbase and windowstart.
Otherwise, after a context switch, windowstart and windowbase
would be different, leading to a wrongly set windowstart bit due to
longjmp writing it based on the windowbase before the context switch.
This corrupts the registers at the next window overflow reaching
that wrongly set bit.

*Background:*
This PR is related to an issue first observed on ESP-IDF
https://github.com/espressif/esp-idf/issues/5229 and it was, then,
checked on NuttX using a test application.

*The test application:*
To check if the problem affects ESP32, ESP32-S2 and ESP32-S3 on
NuttX, it was created an application based on:
https://en.cppreference.com/w/c/program/longjmp

The application creates 16 tasks (`#define NUMBER_OF_TASKS  16`)
that implements the following daemon:

```
static int setjmp_longjmp_daemon(int argc, char *argv[])
{
  for (int i = 0; i < NUMBER_OF_TASKS * 2; i++)
    {
      jmp_buf env;

      volatile int count = 0;
      if (setjmp(env) != UINT16_MAX)
        {
          foo(&env, ++count);
        }
    }

  sem_post(&g_sem);

  return EXIT_SUCCESS;
}
```

The main function also initializes a semaphore to avoid application
exiting before tasks return successfully:

```
  sem_init(&g_sem, 0, -NUMBER_OF_TASKS);
```

Finally, the round-robin interval was lowered to 1ms to raise the
chances of the longjmp being interrupted by a context switch
(`CONFIG_RR_INTERVAL=1).

This setup was able to reproduce the problem prior to this patch
being applied.
2022-11-22 19:34:44 +01:00
chao an 624d69ee05 boards: enter/leave critical section should in pairs
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-22 08:19:24 +09:00
Gustavo Henrique Nihei 1befe6076f xtensa/esp32s3: Move linker scripts to folder common to all boards
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-11-02 16:04:00 +01:00
Gustavo Henrique Nihei 1014c3e795 esp32s3: Fix Data allocation offset within shared Internal SRAM1
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-08-25 10:06:31 +08:00
Alan Carvalho de Assis a8cf7aea39 esp32s3-devkit: Add support to discrete 5-way joystick 2022-07-24 16:33:42 +08:00
Abdelatif Guettouche 6de170b154 boards/xtensa: Remove outdated information.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-07-12 01:10:31 +08:00
Alan Carvalho de Assis cd3e93ef17 esp32s3-devkit: Add support to ST7735 SPI LCD 2022-07-09 01:36:41 +08:00
Gustavo Henrique Nihei 30636b3c97 esp32s3-devkit: Add support for BMP180 pressure sensor
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-06-30 00:32:17 +03:00
Gustavo Henrique Nihei 036e3375e8 esp32s3-devkit: Add support for I2C chardev driver
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-06-30 00:32:17 +03:00
YAMAMOTO Takashi 864f43b562 esp32*: Disable CONFIG_RAW_BINARY
Because it uses the same filename as esp32 Config.mk. (nuttx.bin)
2022-05-27 13:41:51 +03:00
Alan Carvalho de Assis d4b0fc9eb4 xtensa/esp32s3: Add basic support to SPI
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
Co-authored-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-05-25 16:10:29 -03:00
Ville Juven 5800dd2af5 boards/xxx: Remove CONFIG_SCHED_ATEXIT/ONEXIT from all defconfigs 2022-05-25 15:28:43 +08:00
Xiang Xiao 1f920e55d3 Move warning option from Make.defs to Toolchain.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-15 15:40:35 +03:00
Xiang Xiao aeb9c5d822 boards: Move -fno-strict-aliasing from Make.defs to Toolchain.defs
and migrate MAXOPTIMIZATION into ARCHOPTIMIZATION

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-01 11:36:41 +03:00
Xiang Xiao b12c0a1e31 boards: Remove -std=c++1x from Make.defs
let the implementation of standard library choice what they want

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-29 21:08:14 -03:00
Xiang Xiao 8f8ee25a9c boards: Move -g from Make.defs to Toolchain.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-25 16:23:03 +03:00
Xiang Xiao 75326e563d boards: Move -fno-common from Make.defs to Toolchain.defs
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-25 07:57:29 +03:00
Xiang Xiao 547c85b0ae boards: Switch the elf link script to binfmt/libelf/gnu-elf.ld
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-24 17:02:37 +02:00
chao.an 1c8e12406e compile/opt: add config DEBUG_LINK_MAP
Selecting this option will pass "-Map=$(TOPDIR)$(DELIM)nuttx.map" to ld
when linking NuttX ELF. That file can be useful for verifying
and debugging magic section games, and for seeing which
pieces of code get eliminated with DEBUG_OPT_UNUSED_SECTIONS.

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-22 01:37:23 +08:00
chao.an 64d7326ed5 compile/opt: add config DEBUG_OPT_UNUSED_SECTIONS
Enable this option to optimization the unused input sections with the
linker by compiling with " -ffunction-sections -fdata-sections ", and
linking with " --gc-sections ".

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-04-22 01:37:23 +08:00