Commit Graph

11793 Commits

Author SHA1 Message Date
iabdalkader 816b88ad07 mimxrt/Makefile: Update to work with latest TinyUSB.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-14 23:35:54 +10:00
iabdalkader 09a2ee8e7f renesas-ra/Makefile: Generate binary firmware output.
This patch generates a binary firmware image (*.bin) and removes the split
TEXT1/0_ADDR/SECTIONS because it's not configured for this port so it
generates broken binaries.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-14 23:34:18 +10:00
Scott Shawcroft a3d37122a7
Fix PSRAM address 2023-09-13 11:40:09 -07:00
Scott Shawcroft f357f4a3af
Size optimize 3 more boards 2023-09-13 11:40:09 -07:00
Scott Shawcroft 99726e255d
Switch to newlib nano 2023-09-13 11:40:09 -07:00
Scott Shawcroft 18fd0045f6
More kconfig updates 2023-09-13 11:40:09 -07:00
Scott Shawcroft 0a9ae1f6ba
Code size optimizations 2023-09-13 11:40:09 -07:00
Scott Shawcroft cb6b4d0d4a
Fix esp-camera. 32 was dropped so the path doesn't have esp32 in it. 2023-09-13 11:40:09 -07:00
Scott Shawcroft 5937f4c0c0
Hopefully finish updating kconfig 2023-09-13 11:40:09 -07:00
Scott Shawcroft 2a45d95f9d
Use correct flash defaults 2023-09-13 11:40:09 -07:00
Scott Shawcroft 4b29862d30
Clean up more s2 sdkconfig 2023-09-13 11:40:08 -07:00
Scott Shawcroft 1ab083fab7
Support target specific kconfig source 2023-09-13 11:39:51 -07:00
Scott Shawcroft 73e04e84a2
Split out flash and psram settings from sdkconfig 2023-09-13 11:39:10 -07:00
Scott Shawcroft 6043874969
Split out ram dependent configs 2023-09-13 11:36:33 -07:00
Scott Shawcroft feabf7b6ce
Use kconfiglib in sdkconfig update script 2023-09-13 11:36:33 -07:00
Scott Shawcroft e90c07ed87
More esp fixing 2023-09-13 11:36:31 -07:00
MicroDev 7a7f1e6efa
fix arch switch statement in ulp
Co-authored-by: Casey Webb <caseywebb@protonmail.com>
2023-09-13 11:35:14 -07:00
MicroDev ba22633fb0
temporarily disable `rgbmatrix` on `espressif` 2023-09-13 11:35:14 -07:00
MicroDev 3d2cfa162a
enable `paralleldisplay` on `esp32` and `esp32s3` 2023-09-13 11:35:14 -07:00
MicroDev 8feb3bad29
refactor board config files 2023-09-13 11:35:14 -07:00
MicroDev c38972b51c
update ulp implementation 2023-09-13 11:35:14 -07:00
MicroDev 242a720593
fix psram crash 2023-09-13 11:35:14 -07:00
MicroDev 7b9c87e432
update espressif ble sdkconfig 2023-09-13 11:35:14 -07:00
MicroDev 931ed7c6e5
conditionally include `esp_psram` and fix sdkconfig 2023-09-13 11:35:11 -07:00
MicroDev a18e015888
update idf to v5.0 2023-09-13 11:33:51 -07:00
Dan Halbert f13edcc583
Merge pull request #8396 from tirtharajsinha/8.2.x
fixing the wrong rx,tx gpio related issue in 8.2.x for board waveshare-esp32-s3-pico
2023-09-13 12:05:32 -04:00
Tirtharaj Sinha 5191071d5d fixing the wrong rx,tx gpio related issue. 2023-09-13 20:44:40 +05:30
Damien George dc99840b3a stm32/uart: Add support for UART10 when it's a USART.
Signed-off-by: Damien George <damien@micropython.org>
2023-09-13 16:48:15 +10:00
Damien George a4d28e5279 stm32/timer: Fix use of TIM8 on H5 MCU's.
Signed-off-by: Damien George <damien@micropython.org>
2023-09-13 16:48:15 +10:00
Damien George 67b1c81f69 stm32/powerctrlboot: Allow using PLL3 for USB clock on H5 MCU's.
A board should enable MICROPY_HW_CLK_USE_PLL3_FOR_USB to use this feature.

Signed-off-by: Damien George <damien@micropython.org>
2023-09-13 16:48:15 +10:00
Damien George 60e0ef6ef6 stm32/octospi: Add support for dual-line SPI interface.
And fix the case of 32-bit addresses in single-line mode.

Signed-off-by: Damien George <damien@micropython.org>
2023-09-13 16:48:15 +10:00
Damien George ee5e594472 stm32/dma: Add support for SPI1 DMA on H5 MCU's.
Signed-off-by: Damien George <damien@micropython.org>
2023-09-13 16:14:23 +10:00
Dan Halbert 9f1d52601e merge from 8.2.x 2023-09-12 20:14:30 -04:00
Bill Sideris 9acc542957
Deinit all the pins. 2023-09-12 23:25:01 +03:00
Dan Halbert 843fca1874
Merge pull request #8388 from bill88t/espcam-deinit
[ESPCAMERA] Deinit all the pins.
2023-09-12 12:53:08 -04:00
Dan Halbert 46bcd103a7 Revert "Reset UART on deinit, reduces power consumption" (from #8089)
This reverts commit ec1e7a03b3.
2023-09-12 11:24:49 -04:00
Dan Halbert 05267948b4 Revert "formatting" (from #8089)
This reverts commit 4bb475b930.
2023-09-12 11:24:02 -04:00
Andrew Leech ff70bd1197 stm32/timer: Fix deadtime config on Advanced Timer peripherals.
Newer MCU series have additional fields in the struct which need to be
initialised to zero, eg Break2AFMode on WB55.

This work was funded by Planet Innovation.

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2023-09-12 17:12:16 +10:00
Scott Shawcroft 4563c35908
Merge pull request #8385 from n3o59hf/add_m5stack_atoms3u
Add M5Stack AtomS3U
2023-09-11 13:46:03 -07:00
Bill Sideris 6e9c21baba
Deinit all the pins. 2023-09-11 23:35:54 +03:00
Jeff Epler 5a96696025
This board got a KICKIN marketing name 2023-09-11 13:46:08 -05:00
Elviss Kustans 92eaf6236f Add M5Stack AtomS3U 2023-09-09 01:38:08 +00:00
Scott Shawcroft 885dbec599
Merge pull request #8357 from eightycc/memorymap
Add memorymap support to RP2 port
2023-09-08 11:28:11 -07:00
Scott Shawcroft 0928a95bb2
Merge pull request #8351 from jepler/dotclockframebuffer
Dotclockframebuffer
2023-09-07 13:21:29 -07:00
Jeff Epler 0196401d08
reduce reserved psram 2023-09-07 13:01:16 -05:00
Jeff Epler eb060184c2
Add hack tablet 2023-09-07 12:59:42 -05:00
Bob Abeles 79edcbe97d second instance of misspelled 'unaligned' 2023-09-07 09:25:02 -07:00
Dan Halbert 4dd45b6dc6
Merge pull request #8374 from dhalbert/new-certificates-submodule
Update TLS certificates and use new certificates submodule
2023-09-07 10:19:05 -04:00
Dan Halbert aaa23df649
Merge pull request #8372 from tirtharajsinha/8.2.x
8.2.x backport waveshare-esp32-s3-pico
2023-09-07 08:50:59 -04:00
Dan Halbert bc44571384
Merge pull request #8375 from UnexpectedCircuitPython/fs3_changes
Added UM FeatherS3 second I2C STEMMAQT
2023-09-06 23:13:46 -04:00
Bob Abeles 1e178318cf review update, add RP2040 example 2023-09-06 19:59:40 -07:00
Seon Rozenblum e71c39736e Added UM FeatherS3 second I2C STEMMAQT 2023-09-07 12:13:37 +10:00
Dan Halbert 58a21326b2 Update to new certificates submodule. 2023-09-06 19:36:48 -04:00
Scott Shawcroft d7edec67ce 8.2.x backport Added Arduino Nano ESP32-S3 2023-09-06 11:43:07 -07:00
Tirtharaj Sinha 896be9edb3 added precommit 2023-09-06 23:12:47 +05:30
Tirtharaj Sinha 1eb8822feb added SCL and SDA 2023-09-06 22:47:34 +05:30
Tirtharaj Sinha 0c0b927843 added waveshare_esp32_s3_pico for circuitpython version 8.2.x 2023-09-06 21:48:41 +05:30
Jeff Epler 6153d23ed8
Fix build with no psram
these are conditionally-defined identifiers so have to use if defined.
2023-09-05 21:30:35 -05:00
Scott Shawcroft b100041bf7
Merge pull request #8190 from makermelissa/arduino-nano-esp32s3
Added Arduino Nano ESP32-S3
2023-09-05 14:31:08 -07:00
Scott Shawcroft 442f84d0e6
Merge pull request #8345 from tannewt/s3_watchdog
Forbidden pins are now correctly "in use" on ESP
2023-09-05 13:25:42 -07:00
Jeff Epler 5e26862b2c
Allow use of CONFIG_SPIRAM_USE_CAPS_ALLOC
.. and switch makerfabs tft7 over to it as a test.

We have our existing way of "reserving" PSRAM for esp-idf (we actually
control it all but add back the "reserved" part). However, this does
not work with off the shelf esp_lcd, which only will allocate a
framebuffer in PSRAM if CONFIG_SPIRAM_USE_CAPS_ALLOC (or CONFIG_SPIRAM_USE_ALLOC)
is defined, not if CONFIG_SPIRAM_USE_MEMMAP is.

This new way is possibly compatible with more esp-idf code, but it complicates
CircuitPython's initial startup since nothing until port_heap_init is
permitted to use the CP heap or supervisor allocator. In practice this
seems to be OK today.

Right now this doesn't change the setting across all boards with PSRAM and so
it does not revert esp-idf to its prior state. Instead, what I'm thinking is
that we can do it during or just after the IDF5 update when sdkconfig files
will be getting an overhaul anyway.
2023-09-05 12:43:22 -05:00
Jeff Epler b7d1147f67
Bump the stack size of the uart task
With DEBUG build and a consle UART, this would occur early during startup on makerfabs tft7:
```
I (0) cpu_start: Starting scheduler on APP CPU.
I (10) uart: queue free spaces: 20

***ERROR*** A stack overflow in task uart_event_task has been detected.


Backtrace: 0x403786f2:0x3fce9f40 0x403820a9:0x3fce9f60 0x403850da:0x3fce9f80 0x40383a7d:0x3fcea000 0x40382158:0x3fcea030 0x4038214e:0xa5a5a5a5 |<-CORRUPTED
```

Decoded backtrace was not enlightening:
```
0x403786f2: panic_abort at /home/jepler/src/circuitpython/ports/espressif/build-makerfabs_tft7/esp-idf/../../esp-idf/components/esp_system/panic.c:408
0x403820a9: esp_system_abort at /home/jepler/src/circuitpython/ports/espressif/build-makerfabs_tft7/esp-idf/../../esp-idf/components/esp_system/esp_system.c:137
0x403850da: vApplicationStackOverflowHook at /home/jepler/src/circuitpython/ports/espressif/build-makerfabs_tft7/esp-idf/../../esp-idf/components/freertos/port/xtensa/port.c:407
0x40383a7d: vTaskSwitchContext at /home/jepler/src/circuitpython/ports/espressif/build-makerfabs_tft7/esp-idf/../../esp-idf/components/freertos/tasks.c:3505
0x40382158: _frxt_dispatch at /home/jepler/src/circuitpython/ports/espressif/build-makerfabs_tft7/esp-idf/../../esp-idf/components/freertos/port/xtensa/portasm.S:436
0x4038214e: _frxt_int_exit at /home/jepler/src/circuitpython/ports/espressif/build-makerfabs_tft7/esp-idf/../../esp-idf/components/freertos/port/xtensa/portasm.S:231
0x00000000: ?? ??:0
```

Adding an additional 512 bytes of stack allowed CircuitPython to start
successfully.
2023-09-05 12:07:09 -05:00
Jeff Epler 6784e0e720
Ensure debug is defined earlier 2023-09-05 12:06:57 -05:00
Glenn Moloney 0bafdaf5f0 esp32: Skip validation of image on boot from deepsleep.
sdkconfig.base: Add CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y.
This reduces time to boot from deepsleep by at least 200ms and can
provide significant power savings for deepsleep-based battery
applications.

docs/library/esp32.rst: Add note cautioning not to enter deepsleep after
changing the boot partition, without first performing a hard reset.

Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
2023-09-05 22:36:06 +10:00
Damien George 671b38f944 mimxrt/sdio: Move config guard so headers are only included if used.
Otherwise it's a build error on certain MCU series.

Signed-off-by: Damien George <damien@micropython.org>
2023-09-05 11:03:08 +10:00
robert-hh 297892c4f4 mimxrt/machine_uart: Add a helper function to change the baudrate.
And use it in the Bluetooth bindings instead of setting the baudrate by a
call to the NXP lib.

Also fixes machine_uart.c to work with a baud rate of 921600.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-09-05 10:54:49 +10:00
Seon Rozenblum 8bd2494c95 esp32/boards/UM_FEATHERS3: Fix I2C pins in pins.csv.
Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2023-09-04 23:32:09 +10:00
Sebastian Romero bf35eefc62 esp32/boards/ARDUINO_NANO_ESP32: Clarify recovery instructions.
Signed-off-by: Sebastian Romero <s.romero@arduino.cc>
2023-09-04 10:55:31 +10:00
David Yang 545b94a8f5 unix/modjni: Fix build errors with type definitions and error strings.
- Superfluous comments in MP_DEFINE_CONST_OBJ_TYPE stop correct macro
  expanding.
- MP_ERROR_TEXT now gives mp_rom_error_text_t, but we want plain const
  char *.

Signed-off-by: David Yang <mmyangfl@gmail.com>
2023-09-04 10:22:19 +10:00
David Lechner ffb43b2dd3 py/modthread: Return thread id from start_new_thread().
In CPython, `_thread.start_new_thread()` returns an ID that is the same ID
that is returned by `_thread.get_ident()`.  The current MicroPython
implementation of `_thread.start_new_thread()` always returns `None`.

This modifies the required functions to return a value. The native thread
id is returned since this can be used for interop with other functions, for
example, `pthread_kill()` on *nix. `_thread.get_ident()` is also modified
to return the native thread id so that the values match and avoids the need
for a separate `native_id` attribute.

Fixes issue #12153.

Signed-off-by: David Lechner <david@pybricks.com>
2023-09-03 18:49:18 +10:00
Daniël van de Giessen c0d4c604e6 esp32/network_ppp: Block after deleting task.
When calling ppp.active(False) we could get a crash due to immediately
returning after asking FreeRTOS to delete the current task.

This commit adds a simple blocking loop, the same as used in all other
places where we call vTaskDelete(NULL).

Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2023-09-02 18:01:03 +10:00
Seon Rozenblum 6bd1404225 esp32/boards/UM_NANOS3: Add new UM NanoS3 board.
Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2023-09-02 17:55:24 +10:00
Seon Rozenblum 6ec2e8f643 esp32/boards: Add pins.csv to UM boards and other minor changes.
Signed-off-by: Seon Rozenblum <seon@unexpectedmaker.com>
2023-09-02 17:51:26 +10:00
robert-hh 9f1576f2ad rp2/machine_timer: Fix printing of timer period.
Showing the period alway as microsecond quantities, since tick_hz is
assumed as 1_000_000 if the period is given by freq=xxx.  If the period is
larger than 0xffffffff, the value is divided by 1000 and "000" is appended
in the display.  That works for periods up to about 50 days.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-09-02 17:09:51 +10:00
Melissa LeBlanc-Williams 7fe6cf5ed6 Set D13 to input with Pulldown 2023-09-01 15:03:08 -07:00
Melissa LeBlanc-Williams 8d6f9d06df merge branch main 2023-09-01 14:42:53 -07:00
Bob Abeles 1648a3db1e Fix IO register stores of multiple words 2023-09-01 11:23:30 -07:00
Jeff Epler 84aadf3a64
Update TFT experiment for rev b 2023-09-01 12:58:00 -05:00
Bob Abeles ab59e36613 Correct problems found by CI 2023-09-01 08:34:53 -07:00
Jim Mussared f52a2cd55a samd/modules/_boot.py: Add /lib to sys.path.
Needed for mip to find a default location to install to.

Like esp32, samd uses "/" as the mount point for the flash. Make _boot.py
add the entry after successfully mounting.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-09-02 00:09:26 +10:00
Daniël van de Giessen 3cc3e4e032
esp32/machine_uart: Release GIL for blocking reads.
If we're reading from an UART with a non-zero timeout, we can release the
GIL so that other threads/tasks may run while we are sleeping waiting for
data to arrive.

Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2023-09-01 14:23:54 +02:00
Daniël van de Giessen f8bd6778c8 esp32: Support JTAG console, free up UART.
CONFIG_USB_OTG_SUPPORTED is automatically set by the ESP-IDF when the chip
supports USB-OTG, which is the case for the ESP32-S2 and ESP32-S3.

When trying to use the JTAG console with these chips, it would not work
because our USB implementation will take over control over the USB port,
breaking the JTAG console in the process.

Thus, when the board is configured to use the JTAG console, we should not
enable our USB console support.

Additionally, this change also frees up UART0 when an USB-based console is
configured, since there's no reason to prevent (re)configuration of UART0
for other uses in that case.

Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2023-09-01 21:01:26 +10:00
Daniël van de Giessen ba8aad3d1d esp32/modnetwork: Add support for SO_BINDTODEVICE socket option.
This implements support for SO_BINDTODEVICE, which allows telling a socket
to use a specific interface instead of lwIP automatically selecting one.
This allows devices that have multiple connections (for example cellular
over PPP in addition to WLAN) to explicitly choose which data is send over
which connection, which may have different reliability and or (mobile data)
costs associated with using them.

The used lwIP network stack already has support for this, so all that was
needed was to expose this functionality in MicroPython.  This commit
exposes a new constant SO_BINDTODEVICE which can be set as an socket
option.  As a value it expects the name of the interface to bind to.  These
names can be retrieved using `.config('ifname')` implemented on each
interface type (including adding in this commit a `.config()` method to
PPP, which it didn't have before), which returns a string with the
interface name:

    >>> import machine
    >>> import network
    >>> network.WLAN(network.AP_IF).config('ifname')
    'lo0'
    >>> wlan = network.WLAN(network.AP_IF)
    >>> wlan.active(True) and wlan.config('ifname')
    'ap1'
    >>> wlan = network.WLAN(network.STA_IF)
    >>> wlan.active(True) and wlan.config('ifname')
    'st1'
    >>> ppp = network.PPP(machine.UART(0))
    >>> ppp.active(True) and ppp.config('ifname')
    'pp1'
    >>> ppp = network.PPP(machine.UART(0))
    >>> ppp.active(True) and ppp.config('ifname')
    'pp2'
    >>> ppp = network.PPP(machine.UART(0))
    >>> ppp.active(True) and ppp.config('ifname')
    'pp3'

Note that lo0 seems to be returned by lwIP if the interface is not yet
active.  The method can also return None in the case of PPP where the
entire lwIP interface doesn't yet exist before being activated.  Currently
no effort is made to unify those cases; it is expected that whatever we
receive from lwIP is valid.

When the socket option is set, this forces using a specific device:

    import socket
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.setsockopt(socket.SOL_SOCKET, socket.SO_BINDTODEVICE, 'st1')

setsockopt will throw (OSError: [Errno 19] ENODEV) if the specified
interface does not exist.

Tested with LAN, WLAN, and PPP; can specify which interface should be used
and when testing with, for example, HTTP requests to ifconfig.co the
returned IP address confirms a specific interface was used.

Signed-off-by: Daniël van de Giessen <daniel@dvdgiessen.nl>
2023-09-01 19:21:20 +10:00
Damien George 56e5a21312 esp32/modsocket: Add support for SO_BROADCAST socket option.
Signed-off-by: Damien George <damien@micropython.org>
2023-09-01 18:35:09 +10:00
Yuuki NAGAO 141750ff79 stm32/uart: Fix UART timeout issue with low baudrate on G4 MCUs.
With using UART FIFO, the timeout should be long enough that FIFO becomes
empty.  Since previous data transfer may be ongoing, the timeout must be
timeout_char multiplied by FIFO size + 1.

Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
2023-09-01 13:52:00 +10:00
Bob Abeles 66b3eccaf6 8334: RP2040 lacks raw memory map access 2023-08-31 20:25:20 -07:00
Oliver Joos a175f98a65 stm32/mboot: Fix fwupdate by replacing zlib with new deflate module.
Since commit 3533924c36 the zlib module has
been replaced by the new deflate module.  This commit updates the script
fwupdate.py to use the new deflate module.

Signed-off-by: Oliver Joos <oliver.joos@hispeed.ch>
2023-09-01 12:39:06 +10:00
Jeff Epler 5f12e0f9b8
Revert mistaken change 2023-08-31 14:53:31 -05:00
Jeff Epler 554f529fdf
Per review notes, make esp_lcd and esp32-camera unconditional 2023-08-31 14:52:54 -05:00
Jeff Epler 80a1d1a20a
Add support for a non-displayed left portion of screen 2023-08-31 14:52:26 -05:00
Melissa LeBlanc-Williams 06ccd41294
Remove frozen libs from Funhouse 2023-08-31 13:15:51 -05:00
robert-hh 81c19d93bc mimxrt/machine_uart: Support slow baud rates for UART.
Down to 50 baud (in reverence to Jean-Maurice-Émile Baudot).  Implemented
for the MIMXRT10xx MCU's only.  The MIMXRT1176 runs down to 300 baud.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-09-01 00:41:23 +10:00
robert-hh c86b9ec8bd mimxrt/boards: Fix use of MICROPY_HW_SDRAM_AVAIL in MIMXRT1176.ld.
MICROPY_HW_SDRAM_AVAIL is always defined.

Thanks to Ibrahim Abdakader for noticing.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-09-01 00:40:44 +10:00
robert-hh ce38784fa8 mimxrt/machine_uart: Fix and complete UART.deinit and uart_deinit_all.
The code did not check at deinit whether a UART was initialized.  That did
not matter for all MCU's except MIMXRT1176, which crashes at the second
soft reset in a row.

But since it is a general problem to use UART methods of a UART which has
been deinitialized, checks were added to all applicable methods for a clear
response instead of e.g. a crash.

Deinitialize UART using software reset.  It resets the UART but keeps it
accessible for software, avoiding an exception when UART registers are
accessed after a DeInit.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-09-01 00:27:13 +10:00
iabdalkader 3f5976e14a mimxrt/irq: Move all IRQ related definitions to dedicated header.
Following other ports, IRQ priorities and related functions are moved to
their own header, to simplify mpconfigport.h.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-01 00:02:19 +10:00
iabdalkader a453b4f31d drivers/cyw43: Make the CYW43 Bluetooth HCI driver more portable.
This commit allows other ports to reuse the CYW43 HCI driver, by replacing
all Bluetooth UART and control named pins with defines in config files and
using `mpbthci` abstract functions (i.e. `mp_bluetooth_hci_*`) instead of
the STM32 specific UART functions.

Note: the function `cywbt_wait_cts_low` does not need to switch the CTS
pin from alternate function to GPIO to read it.  At least on stm32, mimxrt
it's possible to just read the pin input.  For example, see the STM32F7
RM0410 section 6.3.11, and the `SION` for IMXRT.  So this function can
also be available for other ports if the pin mode switching is removed.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-01 00:02:00 +10:00
iabdalkader fc495240a6 mimxrt: Integrate Bluetooth support with NimBLE bindings.
This commit adds the necessary functions to get NimBLE working with the
mimxrt port.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-08-31 23:42:10 +10:00
iabdalkader 772a36098f mimxrt: Integrate support for WiFi via the CYW43 driver.
This commit adds the necessary configuration and hooks to get the CYW43
driver working with the mimxrt port.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-08-31 23:40:49 +10:00
iabdalkader 46d83d9748 mimxrt/sdio: Add SDIO driver.
This is a basic SDIO driver for the mimxrt port, that was added mainly to
support the CYW43 WiFi driver, and as such it only supports the commands
required by the CYW43 driver (but more commands can be added easily). The
driver performs non-blocking DMA transfers, and can detect and recover from
errors.

Note: because the mimxrt port is missing static alternate functions, named
pins and other pin related functions, currently the alternate functions for
USDHC 1 and 2 are hard-coded in the driver.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-08-31 23:39:34 +10:00
iabdalkader 6b407d5600 mimxrt/machine_pin: Extend pin configuration functions.
Add portable pin config macros to mphalport.h.  And add a function to
configure pins with more pin options such as alt function, pull, speed,
drive, interrupt mode, etc.

Note: this new `machine_pin_config()` function can replace
`machine_pin_set_mode()`, but the latter is left as-is to avoid breaking
anything.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-08-31 23:36:20 +10:00
Tirtharaj Sinha da3dfd7b5a added new board - esp32 s3 pico 2023-08-31 04:15:25 +05:30
Jeff Epler 1ef4e3c738
Add Adafruit TFT Experiment (rev A)
There will be a revision but get the basics in for now.

This successfully displays on a TL040HDS20-B1502A screen with:
```
import board
from framebufferio import FramebufferDisplay
from dotclockframebuffer import DotClockFramebuffer
from displayio import release_displays

tft_pins = board.TFT
tft_timings = {
    "frequency": 6_500_000,
    "width": 720,
    "height": 720,
    "hsync_pulse_width": 20,
    "hsync_front_porch": 40,
    "hsync_back_porch": 40,
    "vsync_pulse_width": 10,
    "vsync_front_porch": 40,
    "vsync_back_porch": 40,
    "hsync_idle_low": False,
    "vsync_idle_low": False,
    "de_idle_high": False,
    "pclk_active_high": False,
    "pclk_idle_high": False,
}

release_displays()
fb = DotClockFramebuffer(**tft_pins, **tft_timings)
disp = FramebufferDisplay(fb)
```
2023-08-30 15:05:07 -05:00
Jeff Epler 7dbf9a9b56
fix vprintf_adapter build error 2023-08-30 11:34:01 -05:00
Jeff Epler 9dcc0b5056
fix those pesky pid/vid duplicates 2023-08-30 10:58:52 -05:00
Jeff Epler fb15c7ca51
Fix timings table & remove redundant comment 2023-08-30 10:50:16 -05:00
Jeff Epler 9e0993af5b
Add espressif esp32s3 lcd devkit
This is not working/tested. The display requires an initialization sequence,
and its SPI bus is on the other side of an I2C GPIO expander making things
more difficult.
2023-08-30 10:31:47 -05:00
Jeff Epler 494aee62b3
Add makerfabs 7" 800x480 TFT
this is working, though it has to be down-clocked to 6.5MHz to prevent
display glitching
2023-08-30 10:30:54 -05:00
Jeff Epler ed9cacf41d
Add DotClockFramebuffer 2023-08-30 10:30:15 -05:00
Jim Mussared f3eccb154c py/mpconfig: Enable SSL finalizers if finalizers are enabled.
The rp2 port was enabling SSL and had finalizers enabled via the "extra
features" level, but missed explicitly enabling `MICROPY_PY_SSL_FINALISER`
(like esp32, stm32, and mimxrt did).

This commit makes `MICROPY_PY_SSL_FINALISER` default to enabled if
finalizers are enabled, and removes the explicit setting of this for
esp32, stm32, mimxrt (because they all use the "extra features" level).

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-30 12:38:13 +10:00
Jim Mussared b2b5bcce28 py/profile: Remove the requirement to disable MICROPY_COMP_CONST.
The only reason that const had to be disabled was to make the test output
match CPython when const was involved.  Instead, this commit fixes the test
to handle the lines where const is used.

Also:
- remove the special handling for MICROPY_PERSISTENT_CODE_SAVE in
  unix/mpconfigport.h, and make this automatic.
- move the check for MICROPY_PERSISTENT_CODE_SAVE to where it's used (like
  we do for other similar checks) and add a comment explaining it.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-30 10:58:04 +10:00
Scott Shawcroft 337b800ceb
Merge pull request #7151 from fonix232/feature/waveshare_rp2040_plus_support
feat: Add support for Waveshare RP2040-Plus
2023-08-29 13:00:37 -07:00
Scott Shawcroft 66bd679a64
Merge pull request #8323 from RetiredWizard/dvbaseW
Pimoroni PICO DV Base w/Pico W (network disabled)
2023-08-29 12:59:11 -07:00
Scott Shawcroft 9daccc08c5
Forbidden pins are now correctly "in use" on ESP
This removes duplicate code to make debug UART pins in use via
never reset. It is done through forbidden pins automatically now.

Fixes #8288
2023-08-28 15:55:14 -07:00
Scott Shawcroft 3605d891de
Merge pull request #8338 from pypewpew/async-samd21
Allow enabling async on samd21
2023-08-28 12:56:38 -07:00
Scott Shawcroft b20e211d29
Merge pull request #8293 from fonix232/port/esp32/m5paper
Add support for M5Stack M5Paper
2023-08-28 12:53:37 -07:00
Scott Shawcroft 2eb62f8238
Merge pull request #8305 from cleverca22/move-stack
raise kernel load addr and slip stack under kernel on both 32bit and 64bit
2023-08-28 12:52:38 -07:00
Jeremy Littler 9bdb576351
Add files via upload 2023-08-28 10:10:04 -04:00
Jeremy Littler c1144e66a8
Add files via upload 2023-08-28 10:09:06 -04:00
Jeff Epler b0967cb1a4
Use QSTR_GLOBAL_REQUIREMENTS to give explicit dependency for qstr generation
I investigated and found that this seems to be the best way to specify
a file that must be generated before "qstr processing" can occur.

Closes #8337
2023-08-27 16:16:40 -05:00
Radomir Dopieralski 34cb5f6dc0
Merge branch 'main' into async-samd21 2023-08-27 19:33:27 +02:00
Radomir Dopieralski 55fbbdcb52 Allow enabling async on samd21
It was just disabled, possibly because of size considerations, but it's
useful to be able to enable it explicitly for selected boards.

This requires some of the settings to use ?= instead of =, and fixing
a bug in the traceback module, where the chain variable is unused if
exception chaining is not enabled.
2023-08-27 19:28:44 +02:00
RetiredWizard 9eb61ef667 Enable WiFi, leave DV enable to usercode 2023-08-26 11:00:37 -04:00
Scott Shawcroft c395e1f9f7
Merge pull request #8332 from pypewpew/ugame22
Add new board uGame22
2023-08-25 13:22:16 -07:00
Michael Bishop 8d25faf30a raise kernel load addr and slip stack under kernel on both 32bit and 64bit 2023-08-25 15:56:40 -03:00
Radomir Dopieralski b9b04fcefa Add new board uGame22
Information about the board:
https://hackaday.io/project/186921-game-22

Hardware design repository:
https://github.com/python-ugame/ugame-22
2023-08-25 19:26:30 +02:00
Scott Shawcroft 233cf7fc6d
Merge pull request #8326 from bill88t/picow-stop-ap
Pico W wifi code improvements.
2023-08-25 09:49:04 -07:00
Scott Shawcroft ab70f8eace
Merge remote-tracking branch 'adafruit/main' into i2s_mclk 2023-08-24 15:07:14 -07:00
Damien George 1dedb65e64 esp8266/boards/ESP8266_GENERIC: Add image filename.
This image is now in micropython-media.

Signed-off-by: Damien George <damien@micropython.org>
2023-08-24 17:15:32 +10:00
Jim Mussared bc1af5ab7f cc3200/Makefile: Build firmware.zip.
This allows the cc3200 port to be build with the standard autobuild script
rather than the custom build-cc3200-latest.sh (which is now removed).

This also fixes the path inside the zip file (by using the `-j` flag to
zip).

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-24 15:44:20 +10:00
Bill Sideris 2cc05f7ac8
Picow-ap wifi improvements 2023-08-23 20:04:51 +03:00
Jim Mussared 326dfd2a85 esp32/boards/ESP32_GENERIC_C3: Enable UART REPL.
This should have been added in 4815af75bc
when the variants were combined. The original non-USB variant got this
implicitly, and therefore was not in mpconfigvariant.h

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-23 15:49:37 +10:00
Jim Mussared 873bd00ad4 rp2: Rename PICO, PICO_W to RPI_PICO, RPI_PICO_W.
PICO might not always be a unique name across all ports, and the
convention generally for other boards is to do VENDOR_BOARD.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-23 15:49:37 +10:00
Jim Mussared ef03ca8bf2 esp8266: Add board variant support.
This merges the existing GENERIC, GENERIC_1M, and GENERIC_512k boards
into variants of the new ESP8266_GENERIC board (renamed from GENERIC so
as not to clash with other ports).

Also moves the generation of the "OTA" variant (previously generated by
autobuild/build-esp8266-latest.sh) into the variant.

Following the convention established for the WEACTSTUDIO rp2 board, the
names of the variants are FLASH_1M and FLASH_512K (but rename the .ld files
to use MiB and kiB).

Updates autobuild to build esp8266 firmware the same way as other ports.
This requires renaming the output from firmware-combined.bin to just
firmware.bin.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-23 15:49:37 +10:00
Jim Mussared aa23698119 esp32: Rename GENERIC* boards to ESP32_GENERIC*.
Board names need to be unique across ports, and GENERIC clashes with
the ESP8266 (which will be renamed to ESP8266_GENERIC).

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-23 13:54:37 +10:00
Jim Mussared 97ffc53ec9 {esp32,rp2,stm32}/Makefile: Append board variant to BUILD.
This allows switching between variants without clobbering the build
output.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-23 13:54:37 +10:00
Jim Mussared 1a99f74063 ports/*/boards/*/board.json: Remove "id" field.
This was used to override the firmware filename generated by the build
server (to match the historical name before board definitions existed).

Now we're making everything use the board definition name (i.e. the
directory name).

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-23 13:54:37 +10:00
Jim Mussared c3093080b1 stm32: Use uppercase variant names.
This is to support a future change to add the variant name to the build
directory and therefore should be the same style as the board name.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-23 13:54:37 +10:00
Jim Mussared 45845acf6d rp2: Use uppercase variant names.
This is to support a future change to add the variant name to the build
directory and therefore should be the same style as the board name.

This only affects the WEACTSTUDIO board. Also standardises on a convention
for naming flash-size variants. Normally we would write e.g. 2MiB, but in
uppercase, it's awkward to write 2MIB, so instead use 2M, 512K, etc for
variant names, but use 2MiB when not constrained by case (e.g. a regular
filename).

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-23 13:54:37 +10:00
Jim Mussared b5836e7252 esp32: Use uppercase variant names.
This is to support a future change to add the variant name to the build
directory and therefore should be the same style as the board name.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-23 13:54:37 +10:00
Jim Mussared f007d0aa3d nrf/boards: Rename all nRF boards to use uppercase.
This is to match all the other ports.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-23 13:54:37 +10:00
RetiredWizard d333ae9f5d Local pre-commit run changes 2023-08-22 23:46:43 -04:00
RetiredWizard 6eccdd9e7d Pimoroni PICO DV Base w/Pico W (network disabled) 2023-08-22 23:10:07 -04:00
Angus Gratton 2919a9fbf3 stm32/modstm: Add MICROPY_PY_STM_CONST flag, clear it for STM32WL5.
MICROPY_PY_STM_CONST defaults to 1 if MICROPY_PY_STM is set.  Overriding to
0 disables the named register peripheral constants being including in the
stm32 module.

This saves about 7.5KB of code size for the STM32WL55, which is significant
as this SoC doesn't have a lot of flash.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-23 11:58:11 +10:00
Angus Gratton 02620c2236 stm32/subghz: Add STM32WL55 subghz radio interface to stm module.
This is the minimum C interface to allow a modem driver to be built in
Python.  Interface is simple, with the intention that the micropython-lib
driver is the main (only) consumer of it.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-23 11:58:11 +10:00
Angus Gratton 9e0f934cdf stm32/dma: Fix DMA completion on WL55 boards.
No IRQHandlers were compiled in for this board.

Includes small consolidation of the same DMAMUX_ENABLE line for STM32G4,
STM32WB, STM32WL.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-23 11:58:11 +10:00
Angus Gratton 2c62adb42c stm32/powerctrlboot: Support STM32WL system clock from HSE+PLL.
Switches default on the NUCLEO_WL55 board to use the HSE oscillator powered
from PB0_VDDTCXO pin.

Build-time configuration can select from MSI internal oscillator (previous
default), HSE via crystal, or HSE bypass with TCXO powered from PB0_VDDTCXO
pin (new default)

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-23 11:58:11 +10:00
Angus Gratton e6cfb77342 stm32/spi: Add STM32WL5 SUBGHZ SPI peripheral.
This is a "normal" SPI peripheral with no external pins, to avoid having to
grow spi_obj[] for just this one board map it as SPI ID 3 (board has SPI
IDs 1,2 already).

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-23 11:58:08 +10:00
Dan Halbert e08ad22ef6
Merge pull request #8317 from jepler/merge-82x
Merge 8.2.x into main
2023-08-22 17:28:30 -04:00
Dan Halbert 88c22d5052 remove last uses of 'u' prefix 2023-08-22 12:57:47 -04:00
Jeff Epler 24b7a4cde6
Merge remote-tracking branch 'origin/8.2.x' into merge-82x 2023-08-22 09:53:35 -05:00
Jeff Epler b589dc2589
Merge pull request #8091 from bill88t/update-picow
Update pico-sdk to 1.5.1
2023-08-22 09:51:20 -05:00
Jeff Epler 283889bb57
Merge pull request #8309 from dhalbert/fix-pimoroni-dvi-base
fix framebuffer size for pimoroni dvi base
2023-08-22 09:47:25 -05:00
Jozsef Kiraly 4f7e66df08 fix: pre-commit 2023-08-22 15:17:40 +01:00
Jozsef Kiraly bb1b827f55 fix: Split 16M and 4M variants 2023-08-22 15:06:37 +01:00
Jeff Epler c029d6a165
Merge remote-tracking branch 'origin/8.2.x' into merge-82x 2023-08-22 08:49:16 -05:00
Jozsef Kiraly 9a140dc3ee Update ports/raspberrypi/boards/waveshare_rp2040_plus/mpconfigboard.mk
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2023-08-22 14:15:59 +01:00
Jozsef Kiraly 127f09b28c Update ports/raspberrypi/boards/waveshare_rp2040_plus/mpconfigboard.mk 2023-08-22 14:15:59 +01:00
Jozsef Kiraly 648ec1c0ed feat: Add support for Waveshare RP2040-Plus 2023-08-22 14:15:59 +01:00
Jozsef Kiraly 2ec145ba6c fix: Minor fixes for M5Paper 2023-08-22 11:44:52 +01:00
Jeff Epler d62bf6631b
Use a different way to force building sdkconfig early
the `Makefile:...` version broke the shared bindings matrix generation, as
it would fail if esp-idf wasn't in the environment (and we wouldn't want
it to do that much work anyway)
2023-08-21 20:48:42 -05:00
Dan Halbert eba1f9d4fe fix framebuffer size for pimoroni dvi base 2023-08-21 19:36:28 -04:00
Jeff Epler f9e99bd3c3
Fix picow build 2023-08-20 11:30:36 -05:00
Jeff Epler c122ca18fd
restore missing board.c file 2023-08-20 11:20:57 -05:00
Jeff Epler bb8e0ae76e
turn off some modules to save flash space 2023-08-20 11:18:46 -05:00
Jeff Epler d94ff9d1cf
turn off audiopwmio to save flash space 2023-08-20 11:14:41 -05:00
Jeff Epler 44c26d9d41
Ensure sdkconfig.h is built early, by making Makefile depend on it
Here's why this helps fix the build error:
If this file does not exist or is out of date, then it is generated
and then the Makefile is re-read.

I don't know why this worked before but stopped now; it must have
to do with the rework of header generation in the MP build system.
2023-08-20 11:08:43 -05:00
Jeff Epler e74ef8b960
ringbuf_alloc no longer has a long-lived argument 2023-08-20 10:15:56 -05:00
Jeff Epler a3a9c7a098
fix typo 2023-08-20 10:15:55 -05:00
Jeff Epler 6598fc0c42
pre-commit modifies these additional files on my system (WHY?) 2023-08-19 13:45:06 -05:00
Dan Halbert 10a022db87 consolidate and shorten some error messages 2023-08-19 12:39:54 -04:00
Dan Halbert e43c2fb7ba pre-commit uncrustify 2023-08-18 22:53:14 -04:00
Dan Halbert d9ed21ea07 pre-commit 2023-08-18 13:30:45 -04:00
Dan Halbert 6851faacaa Merge remote-tracking branch 'adafruit/main' into merge-micropython-v1.19.1 2023-08-18 13:29:39 -04:00
Dan Halbert bfccb77ec1 asyncio test fixes and asyncio library updates 2023-08-18 13:16:16 -04:00
Jozsef Kiraly 37352cf7ec fix: Apply pre-commit patch 2023-08-18 11:22:26 +01:00
Scott Shawcroft f93022b142
Two tweaks to mclk 2023-08-17 14:28:33 -07:00
Jozsef Kiraly 37d807509f port: Add M5Stack M5Paper board target 2023-08-17 21:22:26 +01:00
Scott Shawcroft 8c5c73df38
Add I2S MCLK support to iMX RT 2023-08-17 11:39:14 -07:00
Jeff Epler d0f313c1e8
Merge pull request #8270 from makermelissa/better-alphablend
Better alphablend features
2023-08-16 17:43:17 -05:00
robert-hh a18d62e067
mimxrt: Fix UART RTS/CTS assignments for the OLIMEX and Adafruit boards.
At the Adafruit Metro M7 the pin GPIO_AD_13 is used for JTAG. Therefore
it is not configured for RTS at UART 2 and 3.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-08-16 10:06:59 +02:00
Angus Gratton 974f99482c renesas-ra/boards: Remove unreachable code in make-pins.py.
Looks like copy-paste from the stm32 make-pins.py, references a function
that is not present in the renesas-ra version.

Found by Ruff checking F821.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-16 16:16:40 +10:00
Angus Gratton 801910fc83 all: Add missing imports for micropython.const.
Found by Ruff checking F821.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-16 16:13:27 +10:00
Angus Gratton ef864a4aa4 cc3200/tools: Fix exception raised on process failure.
subprocess.CalledProcessError() constructor arguments aren't documented,
but these are them.  Even if they change, it's an improvement over a
non-existent exception name!

Found by Ruff checking F821.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-16 16:13:11 +10:00
Angus Gratton 861fbf6ab5 examples: Mark asm, pio, etc. as noqa: F821 (undefined-name).
These files all use decorators (@asm_thumb, @asm_pio) that add names to the
function scope, that the linter cannot see.

It's useful to clear them in the file not in pyproject.toml as example code
will be copied and adapted elsewhere, and those developers may also use
Ruff (we hope!)

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-16 16:12:33 +10:00
Kattni Rembor 8b147ac748 Add SD_CS pin to Metro ESP32-S3 board definition. 2023-08-15 18:30:59 -04:00
Kattni Rembor 3012c275e7 Add SD_CS pin. 2023-08-15 18:09:42 -04:00
Jeff Epler 843fdbb250
Add a missing MP_PROTO_IMPLEMENT 2023-08-15 13:25:25 -05:00
Jeff Epler 94b89b7e57
enable exception chaining so we can run the test 2023-08-15 11:54:48 -05:00
Kwabena W. Agyeman 00855eeb36 mimxrt/hal: Make flash clock frequency configurable.
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
2023-08-15 23:45:22 +10:00
Kwabena W. Agyeman cb7e133dbe mimxrt/boards: Add support for GPIO control of SNVS pins.
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
2023-08-15 23:35:33 +10:00
Kwabena W. Agyeman afe2ca1a0a mimxrt/machine_uart: Add support for UART hardware flow control.
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
2023-08-15 23:21:33 +10:00
robert-hh e43c669b4a mimxrt/machine_uart: Add uart.deinit method and machine_uart_deinit_all.
The call to machine_uart_deinit_all() is needed to avoid a crash after soft
reset, if a UART had been used and data arrives before it is instantiated
again.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-08-15 23:08:30 +10:00
robert-hh a9a219d8bf mimxrt/hal/pwm_backport: Fix 0 and 65536 edge cases of PWM's duty_u16.
It should be that:
- duty_u16=0: output low, no pulse
- duty_u16=65536: output high, no pulse

That previously did not apply to all of the three PWM mechanisms of this
port.  This commit fixes it.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-08-15 23:06:12 +10:00
robert-hh a9821c0185 mimxrt/machine_pin: Fix bug when Pin.irq is called without a handler.
When called without a handler, the IRQ data was not cleared.  That caused a
crash at the second soft reset in a row.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-08-15 23:03:37 +10:00
Jim Mussared 96258d3716 esp32/partitions.csv: Rename to partitions-4MiB.csv.
To be consistent with the other partitions files (which have the "-
{2,8,16,32}MiB" suffix). Also renames partitions-ota.csv.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-15 17:38:02 +10:00
Jim Mussared afd407af8f esp32/boards/GENERIC_S3: Merge with GENERIC_S3_{SPIRAM,SPIRAM_OCT}.
These are now variants of the GENERIC_S3 board.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-15 17:38:02 +10:00
Jim Mussared b25a67590d esp32/boards/GENERIC_S2: Merge with ESP32_S2_WROVER.
Unsure of the history of the ESP32_S2_WROVER board (and why it wasn't
named GENERIC_S2_...) but now it's a variant of the generic S2 board.

Also removes the non-existent CONFIG_USB_AND_UART from all S2 boards.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-15 17:38:02 +10:00
Jim Mussared 4815af75bc esp32/boards/GENERIC_C3: Merge with GENERIC_C3_USB.
As the IDF no longer supports earlier revisions of the C3 by default, we
now just explicitly support rev 3+ and enable USB (which wasn't supported
in earlier revisions).

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-15 17:37:44 +10:00
Jim Mussared 2fbf42d3ad esp32/boards/GENERIC: Merge with GENERIC_{SPIRAM,OTA,D2WD,UNICORE}.
These are now variants of the GENERIC board.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-15 17:37:44 +10:00
Jim Mussared 9573d31071 all: Remove query-variants make target.
This is difficult to implement on cmake-based ports, and having the list
of variants in mpconfigboard.{cmake,mk} duplicates information that's
already in board.json.

This removes the existing query-variants make target from stm32 & rp2
and the definition of BOARD_VARIANTS from the various board files.

Also renames the cmake variable to MICROPY_BOARD_VARIANT to match other
variables such as MICROPY_BOARD. The make variable stays as
BOARD_VARIANT.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-15 17:37:44 +10:00
Jim Mussared ad123ed013 esp32/Makefile: Implement `make submodules` to match other ports.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-15 17:37:44 +10:00
Damien George fa1ea21f75 esp32/gccollect: Make level arg volatile to force recursive function.
Otherwise the compiler may inline the gc_collect_inner() function and/or
remove the recursion, which is necessary to spill all the windowed
registers to the C stack.

Signed-off-by: Damien George <damien@micropython.org>
2023-08-15 16:12:54 +10:00
Angus Gratton 05dcb8be99 esp32: Enable automatic Python heap growth.
Via MICROPY_GC_SPLIT_HEAP_AUTO feature flag added in previous commit.

Tested on ESP32 GENERIC_SPIRAM and GENERIC_S3 configurations, with some
worst-case allocation patterns and the standard test suite.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-15 10:50:46 +10: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
Dan Halbert 3d48e87e60 jepler: fix 18 tests (redo commit to be correct) 2023-08-14 18:34:32 -04:00
Dan Halbert 545d434239 Revert "jepler: fix 18 tests"
This reverts commit 5ad35004cb.
2023-08-14 18:21:50 -04:00
Dan Halbert 5ad35004cb jepler: fix 18 tests 2023-08-14 17:53:38 -04:00
Dan Halbert b73f05fe64 turn off viper tests; thanks jepler 2023-08-14 16:43:07 -04:00
Scott Shawcroft 7567f71709
Merge pull request #8280 from dglaude/8.2.x-backport-metro-esp32s3
8.2.x backport metro esp32s3
2023-08-14 11:50:41 -07:00
Dan Halbert c823b9b2f6 force mpversion.h build early in silabs 2023-08-14 11:28:13 -04:00
Dan Halbert 8cf5b6e707 fixes to unix port support; thanks @jepler 2023-08-14 09:51:52 -04:00
Dan Halbert d582407b06 pre-commit fixes 2023-08-14 00:59:22 -04:00
Dan Halbert 2171e67c1b merge latest adafruit/main 2023-08-13 19:43:54 -04:00
Dan Halbert 27c7807693 silabs build needs work; other builds are working 2023-08-13 19:05:16 -04:00
Melissa LeBlanc-Williams 9d69ddc583 Add D0 and D1 2023-08-14 00:20:47 +02:00
Melissa LeBlanc-Williams 4c62db2d05 Add D pins 2023-08-14 00:20:24 +02:00
Melissa LeBlanc-Williams 8dd52430b6 Change to octal ram 2023-08-14 00:18:50 +02:00
Melissa LeBlanc-Williams 1b3993a29e Added initial Adafruit Metro ESP32-S3 2023-08-14 00:17:24 +02:00
Vladimír Smitka acd8896094 Fix RGB/BGR color order 2023-08-13 17:42:23 +02:00
Vladimir Smitka 2819c88207 Formatting 2023-08-13 17:41:16 +02:00
Vladimir Smitka d652c8d25c Add PicoPad support 2023-08-13 17:39:59 +02:00
Dan Halbert 10b94796c0 wip; fix more m_malloc and gc_alloc 2023-08-11 00:30:34 -04:00
Dan Halbert fe0e2f13bc wip; fix qstr processing 2023-08-10 20:06:32 -04:00
Jim Mussared 24a6e951ec ports: Simplify board feature tags in board.json.
This commit:
- Finds a common set of board feature tags and maps existing features to
  that reduced set.
- Removes some less-useful board feature tags.
- Ensures all MCUs are specified correctly.
- Ensures all boards have a vendor (and fixes some vendor names).

This is to make the downloads page show a less intimidating set of filters.

Work done in conjunction with Matt Trentini <matt.trentini@gmail.com>.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-10 14:54:03 +10:00
Scott Shawcroft 472e6bca4d
Merge pull request #8223 from jepler/sm-mayeexec
rp2: Add StateMachine(may_exec=, offset=)
2023-08-09 10:44:02 -07:00
Melissa LeBlanc-Williams db23a9c9fe Disable floppyio for feather m4 express + update docstring 2023-08-09 09:15:17 -07:00
Melissa LeBlanc-Williams 7a4edfaa9f Override D13 pin 2023-08-09 08:19:34 -07:00
Melissa LeBlanc-Williams ab638d4bf2 Merge branch 'main' of https://github.com/adafruit/circuitpython into arduino-nano-esp32s3 2023-08-09 08:08:03 -07:00
Dan Halbert 7432bbce65
Merge pull request #8271 from FrameworkComputer/rp2040-no-audio
raspberrypi: Allow build without audio
2023-08-09 08:53:35 -04:00
Daniel Schaefer 3c66a55341 raspberrypi: Allow build without audio
Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-08-09 17:28:41 +08:00
Dan Halbert 2ff8667e75 wip; remove long-lived functionality; remove PR#2614
Trinket M0 compile has no compilation errors, but has link errors to fix.
2023-08-08 20:41:17 -04:00
Jeff Epler 10330b273c
Divide 'introspect_t' into inputs & outputs
leave as a single structure because it's more efficient to call
functions with 4 or fewer arguments, and having two struct pointers
would make `consider_instruction` have 5 arguments instead.
2023-08-08 10:44:12 -05:00
Dan Halbert 0d2c3c3f08 wip: continuing compilation fixes; mp_obj_alloc everywhere 2023-08-07 20:45:57 -04:00
Jeff Epler e06f836e95
add may_exec to parameter list 2023-08-07 16:28:35 -05:00
Jeff Epler 755fdfab7a
rename variable based on review 2023-08-07 16:26:57 -05:00
Jeff Epler 2077ac150b
Apply suggestions from code review
Co-authored-by: Scott Shawcroft <scott@tannewt.org>
2023-08-07 11:51:52 -05:00
Damien George ef71028f77 extmod/modselect: Add optimisation to use system poll when possible.
A previous commit removed the unix-specific select module implementation
and made unix use the common one.

This commit adds an optimisation so that the system poll function is used
when polling objects that have a file descriptor.  With this optimisation
enabled, if code registers both file-descriptor-based objects, and non-
file-descriptor-based objects with select.poll() then the following occurs:

- the system poll is called for all file-descriptor-based objects with a
  timeout of 1ms

- then the bare-metal polling implementation is used for remaining objects,
  which calls into their ioctl method (which can be in C or Python)

In the case where all objects have file descriptors, the system poll is
called with the full timeout requested by the caller.  That makes it as
efficient as possible in the case everything has a file descriptor.

Benefits of this approach:

- all ports use the same select module implementation

- the unix port now supports polling of all objects and matches bare metal
  implementations

- it's still efficient for existing cases where only files and sockets are
  polled (on unix)

- the bare metal implementation does not change

- polling of SSL objects will now work on unix by calling in to the ioctl
  method on SSL objects (this is required for asyncio ssl support)

Note that extmod/vfs_posix_file.c has poll disable when the optimisation is
enabled, because the code is not reachable when the optimisation is used.

Signed-off-by: Damien George <damien@micropython.org>
2023-08-07 12:11:40 +10:00
Damien George df08c38c28 unix/modselect: Remove unix-specific implementation of select module.
The unix port has a custom select module which only works with objects that
have a file descriptor, eg files and sockets.  On the other hand, bare
metal ports use the common extmod/modselect.c implementation of the select
module that supports polling of arbitrary objects, as long as those objects
provide a MP_STREAM_POLL in their ioctl implementation (which can be done
in C or Python).

This commit removes the unix-specific code and makes unix use the common
one provided by extmod/modselect.c instead.  All objects with file
descriptors implement MP_STREAM_POLL so they continue to work.

Signed-off-by: Damien George <damien@micropython.org>
2023-08-07 12:09:38 +10:00
Blake Ramsdell 432f928286 Add RUNMODE_UF2 handling for SAMD 2023-08-06 13:46:34 +00:00
Damien George 6a179019e8 unix/modsocket: Add poll support for missing ERR,HUP,NVAL poll values.
Signed-off-by: Damien George <damien@micropython.org>
2023-08-06 11:54:06 +10:00
Jeff Epler c918d8048d
correct more error detection 2023-08-05 14:46:50 -05:00
Jeff Epler 9a354a4eb8
fix checking for in-pin 2023-08-05 14:24:11 -05:00
Jeff Epler a6e8619940
fix 'uses extra pin' message 2023-08-05 14:24:03 -05:00
Jeff Epler 8c45abbd89
pass correct may_exec buffer length 2023-08-05 14:23:26 -05:00
Melissa LeBlanc-Williams 1d3b2b019a Update settings to match micropython 2023-08-04 08:54:22 -07:00
Melissa LeBlanc-Williams 3158315ac3 Merge branch 'main' of https://github.com/adafruit/circuitpython into arduino-nano-esp32s3 2023-08-04 08:48:37 -07:00
Jeff Epler 84d8224a54
set reserved psram for pycamera 2023-08-04 08:38:07 -05:00
Dan Halbert 465d1c673e wip 2023-08-03 23:29:00 -04:00
Jeff Epler d57f3c888d
Merge pull request #8242 from tannewt/check_host_init
Two small changes
2023-08-03 14:38:44 -05:00
Jeff Epler 67c5563eec
Apply -Wno-undef to just the needed file & remove incorrect -I arg 2023-08-03 10:20:25 -05:00
elpekenin 40e833c746 [Fix] Wrong fix of cache use for STM32 2023-08-02 20:13:52 +02:00
Scott Shawcroft 9cc4b4cd37
Merge pull request #8245 from jepler/esp32-camera-backlight-solarize
pycamera: backlight, solarize
2023-08-02 10:00:21 -07:00
Jeremy Littler f7cc20e936
Update pins.c 2023-08-02 11:01:44 -04:00
Jeremy Littler f9b98ce54d
Update pins.c 2023-08-02 10:57:46 -04:00
Jeremy Littler b88e359b00
Update pins.c 2023-08-02 10:41:46 -04:00
Jeremy Littler 37dbe3e24a
Update pins.c 2023-08-02 10:32:40 -04:00
Jeremy Littler 94ed725fd3
Update mpconfigboard.h 2023-08-02 10:24:58 -04:00
Jeff Epler 4e01e6bbe5
adafruit-esp32s3-camera: set up backlight at boot & add solarize
the backlight situation will be revisited with the next board prototype,
but it's good to prove this can be done.

Depends on https://github.com/adafruit/esp32-camera/pull/6 which should
be merged before this.
2023-08-02 08:09:13 -05:00
Jeff Epler 2b0f1cd087
espressif: fix dependencies in esp-idf modules
while developing esp-camera I had the problem that firmware.elf was
not regenerated if the only file I edited was in the esp32-camera
submodule.

By telling make that $(IDF_CMAKE_TARGETS), the list of .a fliles
produced by ninja-building esp-idf, depend on esp-idf-stamp and that
firmware.elf in turn depends on these files, the ninja build is re-run
on each make, which is reasonably quick if nothing needs to be rebuilt.
2023-08-02 07:52:45 -05:00
Scott Shawcroft 8baff0bf88
Merge pull request #8133 from dronecz/main
Add ES3ink board definition
2023-08-01 13:31:46 -07:00
Scott Shawcroft 0bf50d2d6e
Merge pull request #8215 from makermelissa/adafruit-metro-esp32s3
Added initial Adafruit Metro ESP32-S3
2023-08-01 13:30:06 -07:00
Scott Shawcroft 539f34f7fd
Three small changes
1. Raise an exception when creating a USB device when host isn't
  initialized.
2. Mark RP2040 dtcm_bss as NOLOAD since it doesn't need to be
  loaded (just zeroed.)
3. Fix submodule location for ulab to Jeff's copy.
2023-08-01 13:16:38 -07:00
Dan Halbert 0d4bc8c163 initial v1.19.1 merge; not compiled yet 2023-08-01 13:50:05 -04:00
Scott Shawcroft cfbfd53b00
Merge pull request #8235 from elpekenin/fix/stm32-cache-skip
Redo of #8228
2023-08-01 10:16:24 -07:00
Scott Shawcroft aecaab779b
Merge pull request #8241 from MakerClassCZ/picopad-rgb-fix
Fix RGB/BGR color order for Picopad
2023-08-01 09:55:36 -07:00
Jeff Epler 272a2dcdb0
Merge pull request #8218 from jepler/esp32-camera
Update the camera board to use ESP32-S3 microcontroller
2023-07-31 14:48:50 -05:00
Vladimír Smitka a9c828011a
Fix RGB/BGR color order 2023-07-31 12:22:27 +02:00
KB Sriram d5daa7ad27 boards/beetle-esp32-c3: fix sdkconfig minor typo.
Fixes https://github.com/adafruit/circuitpython/issues/8239
2023-07-30 22:13:10 -07:00
elpekenin 1ece85ee1e Fix logic (i think) 2023-07-28 23:49:45 +02:00
Melissa LeBlanc-Williams e931a526f1 Merge branch 'main' of https://github.com/adafruit/circuitpython into arduino-nano-esp32s3 2023-07-27 19:27:16 -07:00
Melissa LeBlanc-Williams 45b1c42be5 Add D0 and D1 2023-07-27 19:26:37 -07:00
Jeff Epler 6083de017a
fix method name in docstr 2023-07-27 20:09:13 -05:00
Dan Halbert f466a4373e
Merge pull request #8222 from tannewt/fat_window_align
Align fatfs window buffer for tinyusb
2023-07-27 20:35:23 -04:00
Melissa LeBlanc-Williams ffb1cf116d Add D pins 2023-07-27 16:46:15 -07:00
Melissa LeBlanc-Williams 3d210bfa45 Merge branch 'main' of https://github.com/adafruit/circuitpython into adafruit-metro-esp32s3 2023-07-27 16:33:19 -07:00
Jeff Epler 92e2134009
rp2: StateMachine: Allow loading programs at fixed offsets 2023-07-27 15:47:04 -05:00
Jeff Epler 5780d9a3d2
rp2: Add StateMachine.may_exec
and also sanity-check the init instructions, thanks to the newly
factored-out checker.

Closes: #8221
2023-07-27 15:47:01 -05:00
Scott Shawcroft e45a61f57e
Align fatfs window buffer for tinyusb
Also, update tinyusb.
2023-07-27 09:15:58 -07:00
Brett Cannon 01c758e26a unix/README: Fix Markdown link markup.
Signed-off-by: Brett Cannon <brett@python.org>
2023-07-27 21:40:41 +10:00
Jeff Epler 020e4d2e0c
update camera submodule 2023-07-26 12:55:44 -05:00
Dan Halbert 5cc42d5041
Merge pull request #8126 from jepler/update-ulab-6.3.2
update ulab to 6.3.2
2023-07-26 11:54:42 -04:00
Dan Halbert fd83a09078
Merge pull request #8214 from MakerClassCZ/picopad
Add PicoPad support
2023-07-26 11:49:46 -04:00
Jeff Epler 46d7771152
tinyuf2 adopted the partition scheme called "1ota"
.. which irritated our partition table parser in build_memory_info, so
make it work again.
2023-07-26 09:41:10 -05:00
Jeff Epler c516870f89
switch camera to use the no-ota partition scheme
this gives us a comfortable few hundred kB flash space left for the app

1398912 bytes used,  763776 bytes free in flash firmware space out of 2162688 bytes (2112.0kB).
2023-07-26 08:38:59 -05:00
Jeff Epler 9edd8957a1
Add a "4MB without OTA" partition scheme
This is needed on the camera board, because we have a lot of code.
2023-07-26 08:38:30 -05:00
Jeff Epler f503b37b2b
espressif: allow setting FLASH_SDKCONFIG at board level 2023-07-26 08:32:25 -05:00
Jeff Epler 9a18524c30
simplify circuitpy_mpconfig with enable-if-any, -all
and make corresponding simplifications in shared-bindings-matrix,
but directly using the final defines from CFLAGS instead of the
status quo.

The net changes are to disable audiocore & audiomixer on some espressif
devices that have no audio output at all. Other than that, the
shared-bindings-matrix seems to be identical.
2023-07-25 19:56:08 -05:00
Melissa LeBlanc-Williams 6030d87025 Change to octal ram 2023-07-25 16:30:21 -07:00
Jeff Epler fd60cccb06
Re-enable ulab at the expense of some other modules
.. and gate audiomixer based on audiocore (should be no net change)

.. and get rid of now-redundant enables in the espressif mpconfigport
2023-07-25 16:01:11 -05:00
ladyada 45b6c84cdd Merge branch 'main' of github.com:ladyada/circuitpython 2023-07-25 16:13:47 -04:00
ladyada 767b7a0506 compiling 2023-07-25 16:12:53 -04:00
Limor "Ladyada" Fried 1303fe5378
Merge branch 'adafruit:main' into main 2023-07-25 16:10:42 -04:00
Jeff Epler 318191433d
disable gifio on feather_m4_can 2023-07-25 14:03:47 -05:00
Vladimir Smitka 58d6c3ac9d Formatting 2023-07-25 19:25:27 +02:00
Jeff Epler 6a5e4e6652
turn off terminalio in a few more builds for space 2023-07-25 11:19:16 -05:00
Jeff Epler 509ddf2f89
samd: disable some modules so updated ulab fits
* floppyio: disable on itsybitsy m4, metro m4 express & airlift, pybadge, pygamer, wio terminal
* gifio: disable on itsybitsy m4 express
* framebufferio: disable on treills m4 express, wio terminal
* terminalio: disable on metro m4 express/airlift for ja/ko/ru
2023-07-25 10:48:35 -05:00
Jeff Epler adc2dab3a9
disable ulab on pyb_nano_v2 2023-07-25 09:35:55 -05:00
Jeff Epler 8579766ede
Optimize ulab for size on samd51/same51 2023-07-25 09:35:49 -05:00
Vladimir Smitka c781204105 Add PicoPad support 2023-07-25 14:40:53 +02:00
silabs-ChatNguyen 8d87c1810e Change system clock to 78Mhz 2023-07-25 13:25:02 +07:00