813 Commits

Author SHA1 Message Date
Alessandro Gatti
17d8234458 py/parse: Remove old esp32 compiler workaround.
The ESP32 port contains a workaround to avoid having a certain function
in `py/parse.c` being generated incorrectly.  The compiler in question
is not part of any currently supported version of ESP-IDF anymore, and the
problem inside the compiler (well, assembler in this case) has been
corrected a few years ago.

This commit removes all traces of that workaround from the source tree.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-09-27 00:03:16 +10:00
Seon Rozenblum
b08ddbba59 esp32/boards/UM_RGBTOUCH_MINI: Fix compile error with missing modules.
Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2024-09-20 15:57:52 +10:00
shiggy
6c73573b34 esp32/boards/OLIMEX_ESP32_EVB: Add Olimex ESP32 EVB board definition.
This is for boards not covered by the Olimex ESP32 PoE implementation.  The
major setting is about the PHY interface configuration.

Tested with esp-idf v5.0.4 and Olimex ESP32 EVB boards.

Signed-off-by: shiggy <mail@shiggytech.de>
2024-09-19 15:56:27 +10:00
Seon Rozenblum
9b5f99eb59 esp32/boards: Add UM_OMGS3 and UM_RGBTOUCH_MINI board definitions.
This adds two new UM boards: OMGS3 and RGB Touch Mini.  Also fixed the
NanoS3 deploy info.

Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2024-09-19 15:13:35 +10:00
Seon Rozenblum
d775db72b9 esp32/boards/UM_FEATHERS3NEO: Add FeatherS3 Neo board definition.
Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2024-09-19 15:06:04 +10:00
Angus Gratton
fee9d66e3a esp32: Disable hardware stack protection on ESP32-C3.
Workaround for what appears to be an upstream issue:
https://github.com/espressif/esp-idf/issues/14456

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-04 15:15:26 +10:00
Angus Gratton
a6c35aeee8 esp32: Fix ARDUINO_NANO_ESP32 build configuration.
Regression introduced by 5e692d04 now at MICROPY_HW_USB_CDC is set.

The ARDUINO_NANO_ESP32 specifically builds shared/tinyusb/mp_usb_cdc.c
for the 1200bps reset behaviour. However MicroPython esp32 doesn't yet
use the rest of the shared/tinyusb functionality.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-04 11:06:21 +10:00
Angus Gratton
5e692d0460 esp32: Add MICROPY_HW_USB_CDC macro for native USB-CDC serial.
This fixes issue of ESP32-S3 switching its config over to USB serial/JTAG
instead of native USB.

The the existing logic was hard to follow, adding this config macro makes
it easier to see which USB is in use and to have board definitions that
enable/disable different USB levels.

This commit also drops (nominal) support for manually setting
CONFIG_ESP_CONSOLE_USB_CDC in sdkconfig. No included board configs use this
and it didn't seem to work (if secondary console was set to the default USB
Serial/JTAG then there is no serial output on any port, and if secondary
console was set to None then linking fails.) Can be re-added if there's a
use case for it.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-03 14:28:26 +10:00
Angus Gratton
6ad6297ef7 esp32: Fix ESP32-C3 USB serial/jtag peripheral pre-IDF 5.1.
Regression in 0a11832cd in IDF 5.0.x where macro
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED is not defined.

With this patch, ESP32-S3 still USB Serial/JTAG incorrectly (now on all
ESP-IDF versions).

Closes #15701

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-09-03 10:27:28 +10:00
robert-hh
a38b4f4287 esp32/machine_uart: Implement UART.RX_IDLE based on machine.Timer.
The UART.IRQ_IDLE callback is called about two character times after the
last byte, or 1 ms, whichever is larger.  For the irq, timer 0 is used.

machine_timer.c had to be reworked to make it's mechanisms available for
machine_uart.c.

The irq.flags() value is change only at a requested event.  Otherwise keep
the state.

Signed-off-by: robert-hh <robert@hammelrath.com>
2024-08-29 16:34:33 +10:00
robert-hh
a04a14163b esp32/machine_uart: Implement Python UART IRQ with IRQ_RX and IRQ_BREAK.
Supported trigger events: IRQ_RX and IRQ_BREAK.  Hard IRQ is not supported.

Signed-off-by: robert-hh <robert@hammelrath.com>
2024-08-29 16:27:43 +10:00
Matt Trentini
b704ff66c3 esp32/boards: Remove all IDF3 variants.
IDF 3 builds are very old now (it seems like the last successful builds are
from 2021), and the current IDF 5 is stable.  So remove IDF 3 variants.

Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
2024-08-20 12:49:12 +10:00
Elvis Pfützenreuter
e9814e987b esp32/boards/LILYGO_TTGO_LORA32: Add OLED rst seq for board v1.0.
Signed-off-by: Elvis Pfützenreuter <epxx@epxx.co>
2024-08-16 16:28:46 +10:00
Matt Trentini
43f40f797f esp32/boards/M5STACK_ATOMS3_LITE: Add M5Stack AtomS3 Lite board.
Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
2024-08-16 16:17:43 +10:00
Angus Gratton
b6a3aa10f5 esp32: Remove the increased stack limit margin for ESP32-C3.
The extra limit for C3 dates from 6823514 which added C3 support.
Measuring the minimum stack margins that can pass the stress tests I
measured 768 bytes for ESP32-S3 and 512 bytes for ESP32-C3 on ESP-IDF
V5.2.2 and similar on V5.0.4. i.e. The ESP32-C3 actually needs less stack
margin not more!

I think the extra margin for ESP32-C3 probably arose from:

1. Some toolchain inefficiency in the IDF V4.x RISC-V compiler codegen,
that has since been improved.

OR

2. The race condition that was fixed in e3955f42 where sometimes the limit
wasn't set correctly at all. This seems to trigger more on C3, presumably
some timing artifact, and I'd believe that some binaries might be more
susceptible than others due to random factors.

OR

3. Commit 6007f3e2062cc65fc8416f241c682e37eb956c11 which enabled custom
NLR handling for ESP32-C3.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-16 14:22:51 +10:00
Angus Gratton
6565b3cb34 esp32: Fix Python cstack size for bluetooth irq callbacks.
This value should have been adjusted when the new cstack API was adopted in
e3955f421d1, as otherwise the stack limit is too small especially on
ESP32-C3 where the stack limit was 6144 - 2048 - 2048.

Some extra margin is needed for bluetooth irq because invoke_irq_handler()
isn't a top-level task function, NimBLE calls through multiple layers
first. Measuring this overhead on IDF V5.2.2 (by putting an abort() in
invoke_irq_handler() and then measuring the stack size) yielded 672 bytes
on ESP32-S3 and 612 bytes on ESP32-C3, similar to the size reported in
cd66aa05cf.

Sticking with 1024 bytes for added safety margin. This means on Xtensa the
total margin for the BLE task stays the same (2048 bytes) as before
switching to cstack.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-16 13:55:32 +10:00
Alessandro Gatti
0b75e180a3 esp32/mphalport: Print debug strings even before the GIL is ready.
If verbose debugging is enabled there is some stdout output happening
before the GIL is ready (for example, GC initialisation), and the code
assumed that no string printing occurred before the interpreter was fully
initialised.  Printing long strings would operate without holding the GIL,
which would crash if string output would happen too early in the startup
process.

This commit addresses that issue, making sure verbose debugging output will
work even before the interpreter is fully initialised (as if it is not yet
ready there's no GIL to take care of).

Also, the threshold that would indicate whether a string is "long" (and
thus requiring a GIL release/lock operation) or not was hardcoded to 20
bytes.  This commit makes that configurable, maintaining 20 bytes as a
default.

Fixes issue #15408.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-08-16 13:45:03 +10:00
Matt Trentini
092078852e esp32/boards: Remove BLE from list of features for ESP32-S2.
Fixes issue #15618.

Signed-off-by: Matt Trentini <matt.trentini@gmail.com>
2024-08-16 13:36:22 +10:00
Angus Gratton
e71a324c14 esp32: Restore ESP32-C3 brownout detector settings to IDF defaults.
Commit a66bd7a48925d318e1dd6ada756df947ffacdc12 added the
ESP32_GENERIC_C3_USB board (now merged with ESP32_GENERIC_C3) and changed
the brownout detector from the default level 7 (~2.51V) to level 4
(~2.92V).

Raising the level again seems to fix random BOD resets on some of the
cheaper ESP32-C3 dev boards (that likely skimp on power supply
capacitance).

Specifically, this change prevents random resets running multi_bluetooth
tests on ESP32-C3 "SuperMini" board.

Also removed from the LOLIN_C3_MINI board as it seems this config is a copy
of the generic one.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-16 13:21:04 +10:00
Angus Gratton
0a11832cdd esp32: Use the ESP-IDF default esp_console config for ESP32-C3.
The ESP-IDF default on C3 is primary UART0, secondary USB serial/jtag.
Previously MicroPython configured the primary as USB Serial/JTAG and
manually worked with the UART0 console. However UART0 console stopped
working this way in v5.2.2.

The big change is that CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is no longer set,
as primary console is UART0. However
CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG is set and IDF provides a
macro CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED which is set if either
primary or secondary esp_console is USB serial/jtag. So need to use that
macro instead.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-14 15:58:18 +10:00
Angus Gratton
fbb02d3aee esp32: Add support for ESP-IDF v5.2.2.
Keeping older versions, however if the update goes well then these may be
dropped in the future.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-14 15:58:12 +10:00
Angus Gratton
35a056ad9c esp32/tools: Add metrics_esp32 size comparison script.
Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-14 15:58:05 +10:00
Angus Gratton
10601b04ea esp32/boards: Build using newlib nano formatting functions.
Saves code size, MicroPython doesn't appear to rely on any of the missing
formatters (64-bit integers, c99-style named arguments).

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-14 15:57:52 +10:00
Angus Gratton
74d04c0262 esp32/adc: Use new ADC calibration API in all cases.
Replaces the deprecated ESP32 calibration API with the "line" method
instead.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-14 15:57:26 +10:00
Angus Gratton
052693e449 esp32/boards: Reduce IRAM usage.
Disable unnecessary IRAM ISR functionality.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-14 15:57:16 +10:00
Andrea Milazzo
a4f9c0cc2a esp32/adc: Add support for v5.2.1 calibration api.
This new calibration routine exists for S3 in v5.1.1.  It works for all
platforms in 5.2.1.

Signed-off-by: Andrew Leech <andrew@alelec.net>
2024-08-14 15:57:09 +10:00
Angus Gratton
e3955f421d esp32: Fix thread stack limit margin, change to new cstack API.
This change moves that complexity out into the stack checker and fixes the
bug where stack margin wasn't set correctly by ESP32-C3 threads.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-14 12:56:46 +10:00
Glenn Moloney
288a036253 esp32/network_lan: Ensure LAN MAC address is valid at LAN init.
`get_lan()`: If the ethernet MAC address is uninitialised, set it to the
address reserved by the ESP32 for the ETH interface.

SPI LAN devices may be initialised with a MAC address of 00:00:00:00:00:00.
So check that a valid unicast MAC address has been set (using
`LAN.config(mac=...)`) when initialising the LAN interface.

Fixes #15425.

Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
2024-08-12 16:28:30 +10:00
Glenn Moloney
868d311a23 esp32/network_lan: Make LAN.active(state) succeed if already in state.
This PR ensures that `network.LAN.active(True/False)` will succeed if the
LAN is already in the desired state.

Currently, `lan.active(True)` will raise an `OSError` exception if the LAN
is already in the desired state.  This is inconsistent with
`network.WLAN.active(True/False)` and causes `lan.active(True)` to raise an
exception after a soft reset (causing common network startup scripts to
fail for LAN interfaces).

Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
2024-08-12 16:13:21 +10:00
Damien George
5ff6c12c65 esp32/main: Store native code as linked list instead of list on GC heap.
Finalisers that run during `gc_sweep_all()` may run native code, for
example if an open file is closed and the underlying block device is
implemented in native code, then the filesystem driver (eg FAT) may call
into the native code.

Therefore, native code must be freed after the call to `gc_sweep_all()`.
That can only be achieved if the GC heap is not used to store the list of
allocated native code blocks.  Instead, this commit makes the native code
blocks a linked list.

Signed-off-by: Damien George <damien@micropython.org>
2024-08-07 14:19:18 +10:00
Angus Gratton
6fead31832 esp32: Enable workaround for math.gamma(-inf) result.
Without this commit, math.gamma(-float("inf")) returns inf instead of
raising a math domain ValueError. Needed for float/math_domain_special.py
test to pass on esp32.

Root cause is an upstream libm bug, has been reported to ESP-IDF.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-07 14:10:46 +10:00
Angus Gratton
0d00d72b76 esp32/machine_i2s: Ensure 2 DMA buffers and improve I2S error handling.
ESP-IDF driver always requires at least two DMA buffers, so ensure that's
the case.

Failures during initialisation were being lost because ESP_ERROR_CHECK is
configured as a no-op, so the failure was deferred until read() or write()
was called on the port.  Raise an error from init, instead.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-02 10:30:14 +10:00
Angus Gratton
1754c587f9 esp32: Fix heap corruption triggered by bluetooth.active(0).
It seems like at some point Espressif NimBLE team changed
nimble_port_init and nimble_port_deinit to manage HCI init
internally:
https://github.com/espressif/esp-nimble/commit/f8a79b04c9743543b8959727d7

This change is included in all the IDF versions that MicroPython supports.

As a result, existing code that called esp_nimble_hci_deinit() explicitly
would trigger a use-after-free bug and heap corruption (specifically this
calls through to ble_transport_deinit() which calls os_mempool_free(). The
second time this writes out to a bunch of memory pools where the backing
buffers have already been freed.)

Symptoms were intermittent random crashes after de-activating Bluetooth
(running multi_bluetooth/ble_gatt_data_transfer.py could sometimes
reproduce). Setting Heap Poisoning to Comprehensive in menuconfig caused
the bug to be detected every time.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-08-01 11:01:05 +10:00
Alessandro Gatti
6007f3e206 esp32/mpconfigport: Enable the RV32 emitter for ESP32C3 targets.
The RV32 code emitter assumed that the arch-specific NLR was used
instead of the setjmp/longjmp based NLR code.  If the latter NLR
provider was chosen, the emitter would allocate space on the stack
for the NLR buffer but would not fill it in.

This change turns off setjmp()-based NLR and GCREGS for the ESP32C3
target, in favour of more platform-tailored alternatives.  As setjmp()
NLR is now disabled by default, the RV32 emitter can be safely enabled
by default as well for the target in question.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
2024-07-26 12:13:03 +10:00
robert-hh
594c4229b7 esp32/machine_timer: Limit timer numbers for ESP32C3.
The ESP32C3 has only two timers in one group.  In the code this is
reflected as two groups with one timer.

Signed-off-by: robert-hh <robert@hammelrath.com>
2024-07-23 14:55:35 +10:00
Angus Gratton
337742f6c7 esp32/mpthreadport: Fix uneven GIL allocation between Python threads.
Explicitly yield each time a thread mutex is unlocked.

Key to understanding this bug is that Python threads run at equal RTOS
priority, and although ESP-IDF FreeRTOS (and I think vanilla FreeRTOS)
scheduler will round-robin equal priority tasks in the ready state it does
not make a similar guarantee for tasks moving between ready and waiting.

The pathological case of this bug is when one Python thread task is busy
(i.e. never blocks) it will hog the CPU more than expected, sometimes for
an unbounded amount of time. This happens even though it periodically
unlocks the GIL to allow another task to run.

Assume T1 is busy and T2 is blocked waiting for the GIL. T1 is executing
and hits a condition to yield execution:

1. T1 calls MP_THREAD_GIL_EXIT
2. FreeRTOS sees T2 is waiting for the GIL and moves it to the Ready list
   (but does not preempt, as T2 is same priority, so T1 keeps running).
3. T1 immediately calls MP_THREAD_GIL_ENTER and re-takes the GIL.
4. Pre-emptive context switch happens, T2 wakes up, sees GIL is not
   available, and goes on the waiting list for the GIL again.

To break this cycle step 4 must happen before step 3, but this may be a
very narrow window of time so it may not happen regularly - and
quantisation of the timing of the tick interrupt to trigger a context
switch may mean it never happens.

Yielding at the end of step 2 maximises the chance for another task to run.

Adds a test that fails on esp32 before this fix and passes afterwards.

Fixes issue #15423.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-07-23 12:33:19 +10:00
robert-hh
ee1036023e extmod/machine_spi: Support firstbit=LSB for machine.SoftSPI.
Being able to send data out in LSB format can be useful, and having support
in the low-level driver is much better than requiring Python code to
reorder the bits before sending them / after receiving them.  In particular
if the hardware does not support the LSB format (eg RP2040) then one needs
to use the SoftSPI in LSB mode.

For this change a default definition of `MICROPY_PY_MACHINE_SPI_MSB/_LSB`
was added to `py/mpconfig.h`, making them available to all ports.  The
identical defines in `esp32/mpconfigport.h` were deleted.

Resolves issues #5340, #11404.

Signed-off-by: robert-hh <robert@hammelrath.com>
2024-07-12 22:59:31 +10:00
Damien George
0b58d02f70 esp32,esp8266: Use new mp_obj_new_str_from_cstr() function.
These were missed in the previous commit.

Signed-off-by: Damien George <damien@micropython.org>
2024-07-05 11:27:25 +10:00
Jon Foster
92484d8822 all: Use new mp_obj_new_str_from_cstr() function.
Use new function mp_obj_new_str_from_cstr() where appropriate.  It
simplifies the code, and makes it smaller too.

Signed-off-by: Jon Foster <jon@jon-foster.co.uk>
2024-07-04 15:55:03 +10:00
Damien George
43ebbec0c5 esp32: Rework board variant support to require mpconfigvariant file.
This commit reworks board variants on the esp32 port.  It's a simple change
that moves the board variant configuration from an "if" statement within
`mpconfigboard.cmake` into separate files for each variant, with the name
of the variant encoded in the filename: `mpconfigvariant_VARIANT.cmake`.

Optionally, the base variant can have its own options in
`mpconfigvariant.cmake` (this is an optional file, but all other variants
of the base must have a corresponding mpconfigvariant file).

There are two benefits to this:
- The build system now gives an error if the variant that you specified
  doesn't exist (because the mpconfigvariant file must exist with the
  variant name you specify).
- No more error-prone if-logic needed in the .cmake files.

The way to build a variant is unchanged, still via:

    $ make BOARD_VARIANT=VARIANT

Signed-off-by: Damien George <damien@micropython.org>
2024-06-28 11:23:55 +10:00
Felix Dörre
b555d6ccaf esp32/network_ppp: Implement network.PPP.ipconfig method.
Signed-off-by: Felix Dörre <felix@dogcraft.de>
2024-06-04 12:45:01 +10:00
Felix Dörre
1f23ab1e3d esp32,mimxrt,stm32: Implement ipconfig() for more network interfaces.
Implements:
- esp32: network.ipconfig()
- esp32: network.LAN.ipconfig()
- esp32: network.WLAN.ipconfig()
- mimxrt: network.LAN.ipconfig()
- stm32: network.LAN.ipconfig()

Signed-off-by: Felix Dörre <felix@dogcraft.de>
2024-06-04 12:45:01 +10:00
Damien George
84a8f7ea6d shared/tinyusb: Allow ports to use 1200bps-touch without other CDC code.
This fixes the build for some esp32 and nrf boards (for example
`ARDUINO_NANO_33_BLE_SENSE` and `ARDUINO_NANO_ESP32`) due to commit
c98789a6d8e05acb608afe4b30cf3ca563419b2d.  Changes are:

- Allow the CDC TX/RX functions in `mp_usbd_cdc.c` to be enabled
  separately to those needed for `MICROPY_HW_USB_CDC_1200BPS_TOUCH`.

- Add `MICROPY_EXCLUDE_SHARED_TINYUSB_USBD_CDC` option as a temporary
  workaround for the nrf port to use.

- Declare `mp_usbd_line_state_cb()` in a header as a public function.

- Fix warning with type cast of `.callback_line_state_changed`.

Signed-off-by: Damien George <damien@micropython.org>
2024-06-02 23:27:33 +10:00
Andrew Leech
c98789a6d8 shared/tinyusb: Add common CDC TX/RX functions.
There are a few TinyUSB CDC functions used for stdio that are currently
replicated across a number of ports.  Not surprisingly in a couple of cases
these have started to diverge slightly, with additional features added to
one of them.

This commit consolidates a couple of key shared functions used directly by
TinyUSB based ports, and makes those functions available to all.

Signed-off-by: Andrew Leech <andrew@alelec.net>
2024-05-31 19:45:42 +10:00
Jared Hancock
a196468c47 esp32: Add support for TCP_NODELAY.
This adds support for the TCP_NODELAY socket option for lwIP sockets.
Generally, TCP sockets use the Nagle algorithm and will send data when
an ACK is received or after all previously-sent data has already been
ACKed.

If the TCP_NODELAY option is set for a socket, every write to the socket
will trigger a packet to be sent.

Signed-off-by: Jared Hancock <jared@greezybacon.me>
2024-05-23 20:47:17 -05:00
Daniël van de Giessen
c10a74b162 esp32/panichandler: Print support information on panic.
When a fatal error occurs it's important to know which precise version it
occurred on in order to be able to decode the crash dump information such
as the backtrace.

By wrapping around the built-in IDF panic handler we can print some extra
information whenever a fatal error occurs.  The message links to a new wiki
page which contains additional information on how to debug ESP32 issues,
and links to the bug reporting issue template.

Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2024-05-16 12:25:45 +10:00
Rick Sorensen
63c30a2dfc esp32/modesp32: Add mcu_temperature() function for C3/S2/S3 devices.
For ESP32C3/S2/S3 IDFv5 exposes new internal temperature API which is
different to the base ESP32, IDFv4.

Thanks to @robert-hh for cleaner code and testing sensor capability in
these devices.

See discussion #10443.

Signed-off-by: Rick Sorensen <rick.sorensen@gmail.com>
2024-05-07 17:29:22 +10:00
iabdalkader
e8dd519e2d esp32/network_wlan: Add interface and security WLAN constants.
Following the same change to extmod network interfaces.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-03-28 13:01:55 +11:00
Daniël van de Giessen
a0efe2d368 esp32/main: Check if main GC heap allocation failed.
If the heap allocation fails we will crash if we continue, so at least we
can show a clear error message so one can figure out memory allocation was
the problem (instead of just seeing some arbitrary null pointer error
later).

Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2024-03-25 12:19:00 +11:00
Jim Mussared
acbdbcd95e esp32: Workaround IDF issue placing ISR ringbuf functions in IRAM.
This workaround makes sure that all ringbuf functions that may be called
from an ISR are placed in IRAM.  See
https://github.com/espressif/esp-idf/issues/13378

Note that this means that all esp32-og builds get non-ISR ringbuf functions
placed in flash now, whereas previously it was just the spiram variant.
This might be a good thing (e.g. free up some IRAM for native/viper).

Fixes issue #14005.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2024-03-22 12:14:27 +11:00