Commit Graph

12 Commits

Author SHA1 Message Date
Damien George
69089a532e esp32/boards: Enable further IRAM saving opts to fit ESP32-SPIRAM fw.
The amount of free IRAM in ESP32 SPIRAM builds is very small and went over
the limit due to commit 30b0ee34d3.  This
commit enables further optimisations to reduce IRAM usage.

Signed-off-by: Damien George <damien@micropython.org>
2023-12-06 12:35:45 +11:00
Angus Gratton
98fd78437c esp32: Allow malloc() to allocate from SPIRAM.
Also shrinks the "prefer internal" threshold to 8KB, any allocation larger
than this will try PSRAM first.

Change the mbedTLS config to use regular malloc() as well, instead of
internal only.  The default is set to internal-only due to to potential
physical security issue of readout via PSRAM on the original ESP32.
However, as MicroPython runs from plaintext flash and all other context is
in the MP heap of PSRAM then it's hard to see how worsens physical security
for MP.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-15 10:49:33 +10:00
Damien George
e4650125b8 esp32: Update port to support IDF v5.0.2.
This commit updates the esp32 port to work exclusively with ESP-IDF v5.
IDF v5 is needed for some of the newer ESP32 SoCs to work, and it also
cleans up a lot of the inconsistencies between existing SoCs (eg S2, S3,
and C3).

Support for IDF v4 is dropped because it's a lot of effort to maintain both
versions at the same time.

The following components have been verified to work on the various SoCs:

                ESP32     ESP32-S2  ESP32-S3  ESP32-C3
    build       pass      pass      pass      pass
    SPIRAM      pass      pass      pass      N/A
    REPL (UART) pass      pass      pass      pass
    REPL (USB)  N/A       pass      pass      N/A
    filesystem  pass      pass      pass      pass
    GPIO        pass      pass      pass      pass
    SPI         pass      pass      pass      pass
    I2C         pass      pass      pass      pass
    PWM         pass      pass      pass      pass
    ADC         pass      pass      pass      pass
    WiFi STA    pass      pass      pass      pass
    WiFi AP     pass      pass      pass      pass
    BLE         pass      N/A       pass      pass
    ETH         pass      --        --        --
    PPP         pass      pass      pass      --
    sockets     pass      pass      pass      pass
    SSL         pass      ENOMEM    pass      pass
    RMT         pass      pass      pass      pass
    NeoPixel    pass      pass      pass      pass
    I2S         pass      pass      pass      N/A
    ESPNow      pass      pass      pass      pass
    ULP-FSM     pass      pass      pass      N/A
    SDCard      pass      N/A       N/A       pass
    WDT         pass      pass      pass      pass

Signed-off-by: Damien George <damien@micropython.org>
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-06-23 15:34:22 +10:00
Damien George
26b17fd28a esp32/boards: Remove old IDF v3 sdkconfig values.
IDF v3 is no longer supported with the move to cmake.

Signed-off-by: Damien George <damien@micropython.org>
2021-02-15 16:40:03 +11:00
Jim Mussared
96008ff59a esp32: Support building with ESP IDF 4.0-beta1.
This commit adds support for a second supported hash (currently set to the
4.0-beta1 tag).  When this hash is detected, the relevant changes are
applied.

This allows to start using v4 features (e.g. BLE with Nimble), and also
start doing testing, while still supporting the original, stable, v3.3 IDF.

Note: this feature is experimental, not well tested, and network.LAN and
network.PPP are currently unsupported.
2019-09-17 12:25:36 +10:00
Jim Mussared
8db517f26d esp32: Add per-board configs, following other ports.
Replaces the `SDKCONFIG` makefile variable with `BOARD`.  Defaults to
BOARD=GENERIC.  spiram can be enabled with `BOARD=GENERIC_SPIRAM`

Add example definition for TINYPICO, currently identical to GENERIC_SPIRAM
but with custom board/SoC names for the uPy banner.
2019-08-16 00:22:29 +10:00
Damien George
69cb24a21d esp32/boards/sdkconfig: Disable WDT check of idle task on CPU1.
With dual-core enabled it's possible that the uPy task has full utilisation
of CPU1.  Fixes issue #4673.
2019-04-05 12:25:21 +11:00
Damien George
92149c8a79 esp32/boards: Enable dual core support by default.
Single core is still supported, just by adding CONFIG_FREERTOS_UNICORE=y to
a custom sdkconfig file.
2019-03-27 11:20:21 +11:00
Damien George
c33f538066 esp32/modmachine: Add support for changing the CPU frequency. 2019-02-07 22:51:55 +11:00
Damien George
6a95e74387 esp32: Use SPIRAM in mem-map mode so all of it can be used for uPy heap.
Also enable CONFIG_SPIRAM_IGNORE_NOTFOUND to allow boards with faulty or
missing SPIRAM to still boot.
2019-02-06 00:10:50 +11:00
Damien George
f431795caf esp32/boards: Use auto xtal freq config instead of default 40MHz.
Auto-detection of the crystal frequency is convenient and allows for a
single binary for many different boards.  But it can be unreliable in
certain situations so in production, for a given board, it's recommended to
configure the correct fixed frequency.
2019-01-28 20:42:12 +11:00
Damien George
3d49b157b8 esp32: Update to latest ESP IDF using sdkconfig and new ldgen procedure.
Configuration for the build is now specified using sdkconfig rather than
sdkconfig.h, which allows for much easier configuration with defaults from
the ESP IDF automatically applied.  sdkconfig.h is generated using the new
ESP IDF kconfig_new tool written in Python.  Custom configuration for a
particular ESP32 board can be specified via the make variable SDKCONFIG.

The esp32.common.ld file is also now generated using the standard ESP IDF
ldgen.py tool.
2019-01-28 12:44:03 +11:00