Commit Graph

493 Commits

Author SHA1 Message Date
Gustavo Henrique Nihei f78c6432d8 xtensa/esp32: 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 236ee5c80d xtensa/esp32: Rename linker scripts into more meaningful names
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
YAMAMOTO Takashi fc4493b7f1 esp32-devkitc/wamr_wasi_debug: enable native-lib stuff
* enable DLFCN.

* bump WAMR to a version which i happened to test.

* enable bulk-memory because it's required by recent versions of
  wasi-sdk, which i happened to use to build a test module.
  (test.wasm in the log below.)

Lightly tested with a stripped down version of WAMR native-lib example. [1]

```
nsh> mount -t littlefs /dev/esp32flash /mnt
nsh> iwasm --native-lib=/mnt/test_add.o /mnt/test.wasm
Hello World!
10 + 20 = 30
nsh> iwasm /mnt/test.wasm
[00:00:23:000 - 6]: warning: failed to link import function (env, test_add)
Hello World!
Exception: failed to call unlinked import function (env, test_add)
nsh>
```

[1] https://github.com/bytecodealliance/wasm-micro-runtime/tree/main/samples/native-lib
2022-12-02 13:47:20 +08:00
YAMAMOTO Takashi a43af6563b esp32-devkitc:wamr_wasi_debug kconfig maintainance
* disable too verbose wamr options.

* enable CONFIG_SCHED_WAITPID. because async execution on nsh prompt
  sometimes confuses me.

* enable toywasm. it's sometimes convenient to have another interpreter.
  note: wasm3 in nuttx apps doesn't have wasi enabled.
2022-12-01 23:28:33 +08:00
Lucas Saavedra Vaz a926445995 boards: Fix buttons GPIO IRQ on ESP boards 2022-11-28 17:24:57 -03:00
Lucas Saavedra Vaz cd5e536c40 boards/esp32-lyrat: Add buttons example 2022-11-28 17:24:57 -03:00
SuGliger 83a4b45dd4 boards/esp32-wrover-kit: Fix GPIO conflicts 2022-11-26 11:58:58 +08:00
SuGliger 9cdb865c9c boards/esp32-wrover-kit: Add Lua Interpreter defconfig 2022-11-26 11:58:58 +08:00
Robert-Ionut Alexa 9c6971279d esp32-sparrow-kit: enable support for MMCSD-SPI
Add the necessary configs to the default nsh config file in order to enable
support for MMCSD-SPI.

Signed-off-by: Robert-Ionut Alexa <robertalexa2000@gmail.com>
2022-11-23 19:52:34 +08:00
Robert-Ionut Alexa e0374c30e4 esp32-sparrow-kit: add support for the LTR308 light sensor
Add support to esp32-sparrow-kit for the LTR308 sensor. This patch also
enables the sensor in the default nsh config file.

Signed-off-by: Robert-Ionut Alexa <robertalexa2000@gmail.com>
2022-11-23 19:52:34 +08:00
Robert-Ionut Alexa 3351146c0b boards/xtensa/esp32: add initial commit for the ESP32-SPARROW-KIT
ESP32-SPARROW-KIT is built upon ESP32-WROVER-KIT by adding various
peripherals. This is an initial commits that only backports the code
as it is, without further changes.

Signed-off-by: Robert-Ionut Alexa <robertalexa2000@gmail.com>
2022-11-23 19:52:34 +08: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
Tiago Medicci Serrano d492a5b092 esp32s2/i2s: implement I2S receiver module
- Add ioctl method to enable allocating the apb buffer.
- Add RX methods to set data width, sample rate, channels and
for receiving data from the I2S peripheral.
- Update the i2schar defconfig to enable the I2S receiver.
- Add nxlooper defconfig to enable testing the RX interface.
- Add specific bindings on ESP32-S2  bringup to enable nxlooper
to work without the need of any specific codec.
2022-11-21 23:46:47 +08:00
Tiago Medicci Serrano 3b5ab27893 esp32/i2s: implement I2S receiver module
- Add ioctl method to enable allocating the apb buffer.
- Add RX methods to set data width, sample rate, channels and
for receiving data from the I2S peripheral.
- Update the i2schar defconfig to enable the I2S receiver.
- Add nxlooper defconfig to enable testing the RX interface.
- Add specific bindings on ESP32 bringup to enable nxlooper
to work without the need of any specific codec.
2022-11-15 17:01:47 -03:00
Alan Carvalho de Assis 013b15db2d esp32: Add support to LilyGO_TBeam V1.1 LoRa/GPS board 2022-11-13 22:59:50 +08:00
YAMAMOTO Takashi 0f2206e9a8 esp32-devkitc/wamr_wasi_debug: bump WAMR version 2022-11-09 18:20:05 +08:00
Xiang Xiao 352006af6d boards/esp32-lyrat: Remove CONFIG_MM_CIRCBUF=y from audio config
since this config is removed from:
commit a446b5816f
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Sun Nov 6 00:18:52 2022 +0800

    mm/circbuf: Remove MM_CIRCBUF option from Kconfig

    since the linker can remove the unused object file from the final image

    Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 18:24:07 -03:00
Xiang Xiao a446b5816f mm/circbuf: Remove MM_CIRCBUF option from Kconfig
since the linker can remove the unused object file from the final image

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-08 10:18:27 -03:00
Lucas Saavedra Vaz bcafc77cf8 boards/esp32-lyrat: Add support for the ES8388 codec 2022-11-08 10:03:18 -03:00
Masayuki Ishikawa 6bd285814d boards: esp32-devkitc: Update elf/defconfig
Summary:
- This commit adds the following configs to elf/defconfig
  +CONFIG_DEBUG_FULLOPT=y
  +CONFIG_DEBUG_SYMBOLS=y
  +CONFIG_STACK_COLORATION=y

Impact:
- None

Testing:
- Tested with esp32-devkitc (QEMU and board)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-11-08 10:03:00 -03:00
Lucas Saavedra Vaz 22ce6e8a9c boards/xtensa: Added support for the ESP32-S2-Kaluga-1 board 2022-11-07 14:23:09 -03:00
Gustavo Henrique Nihei f0cf1ea69e boards/esp32s3: Improve documentation on the IRAM upper limit definition
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-11-08 00:49:03 +08:00
Gustavo Henrique Nihei 3cb6d103c5 xtensa/esp32s3: Extend IRAM region according to IDFboot v4.4.2
This change syncs the NuttX application image IRAM upper limit to the
start of the IRAM region used by the IDF 2nd stage bootloader.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-11-08 00:49:03 +08:00
Masayuki Ishikawa bbe2fd3b80 boards: Fix the CI build errors for telnetd
Summary:
- This commit fixes the CI build errors regressed by
  https://github.com/apache/incubator-nuttx/pull/7351

Impact:
- None

Testing:
- Build only

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-11-07 16:06:00 +01:00
Xiang Xiao 4e43fef5cd boards: Update telnetd related config after apps/nshlib change
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-07 15:24:29 +09:00
Tiago Medicci Serrano 9ecc345c02 esp32/i2s: use internal buffer to handle multiple audio formats 2022-11-05 00:37:00 +08:00
Lucas Saavedra Vaz c06b881812 boards/esp32: Fix invalid IRAM option in linker script 2022-11-03 22:24:18 +01:00
Lucas Saavedra Vaz a5d3a6b126 xtensa/esp32s2: Move linker scripts to folder common to all boards 2022-11-03 22:22:54 +01: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
Xiang Xiao 28947517ca sched/spawn: Rename task_spawnattr_[get|set]stack[size|addr] to posix_spawnattr_[get|set]stack[size|addr]
since they can be not only used in task_spawn but also in posix_spawn

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-11-01 09:51:18 +09:00
Alan Carvalho de Assis 99cfffc96a esp32: Add MAX6675 temperature sensor support 2022-10-30 12:05:19 +08:00
Tiago Medicci Serrano 1d0a37cd10 xtensa/esp32: fix if define convention to use parentheses 2022-10-22 15:18:35 +08:00
Tiago Medicci Serrano ebf9af662e xtensa/esp32s2: add support for the CS4344 audio codec
Include i2schar and audio defconfigs for ESP32-S2-Saola-1 board.
2022-10-22 15:18:35 +08:00
Tiago Medicci Serrano 16b99ee013 xtensa/esp32s2: add initial support for I2S
Add initial support for the I2S peripheral on ESP32S2.
Add I2S character driver and generic I2S audio driver.
Include i2schar defconfig for ESP32-S2-Saola-1 board.
2022-10-22 15:18:35 +08:00
Alan Carvalho de Assis 11ca921b71 esp32s2-saola-1: Add SPI example using max6675 2022-10-20 10:11:26 +08:00
Lucas Saavedra Vaz b0f96fc204 esp32/i2c: Add macros to conform with other peripherals and fix typos
Fix coding style

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-19 20:31:29 -03:00
Xiang Xiao 6b31918b42 Remove the unnecessary cast for main_t, NULL and argv
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 08:51:45 +02:00
Xiang Xiao 7923ea3bef boards: Refresh defconfig after the default value of FS_PROCFS_EXCLUDE_xxx
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-18 15:10:26 +09:00
Alan Carvalho de Assis 0dfd1f004d esp32-devkitc: Add board support to Rotary Encoder
Reviewed-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-10-17 00:30:53 +02:00
Xiang Xiao 78f6a02bc8 boards: Remove the duplicated prototype of CONFIG_INIT_ENTRYPOINT
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-16 19:02:44 +02:00
Tiago Medicci Serrano 5089c5d2fd esp32: fix wapi stack size on board examples
Fix the error on issue 7193:
(https://github.com/apache/incubator-nuttx/issues/7193)
2022-10-07 14:44:30 +08:00
Gustavo Henrique Nihei 73678c4839 xtensa/esp32: Allow allocation of user data in SPI RAM
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-10-04 21:32:42 +02:00
Xiang Xiao 2a574427c6 boards: Remove CONFIG_NETDEVICES=y from board defconfig
since it's enabled by default now

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-01 19:12:15 +02:00
Tiago Medicci Serrano 06bc2220b9 xtensa/esp32: add support for the CS4344 audio codec
Include i2schar and audio drivers defconfigs for ESP32-DevKitC board.
2022-09-30 17:23:17 -03:00
Tiago Medicci Serrano 18c715ba92 xtensa/esp32: add initial support for I2S
Add initial support for the I2S peripheral on ESP32.
Add I2S character driver and generic I2S audio driver.
Include i2schar defconfig for ESP32-DevKitC board.
2022-09-30 17:23:17 -03:00
Xiang Xiao 0fa17f32f2 drivers/telnet: Remove io work thread
The thread isn't really needed but complicate the workflow

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-30 12:54:29 +09:00
Xiang Xiao 70290b6e38 arch: Change the linker generated symbols from uint32_t to uint8_t *
and remove the duplicated declaration

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-24 21:26:56 +02:00