summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-08-31mimxrt: Integrate Bluetooth support with NimBLE bindings.iabdalkader
This commit adds the necessary functions to get NimBLE working with the mimxrt port. Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-08-31mimxrt: Integrate support for WiFi via the CYW43 driver.iabdalkader
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-31mimxrt/sdio: Add SDIO driver.iabdalkader
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-31mimxrt/machine_pin: Extend pin configuration functions.iabdalkader
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-30extmod/modssl_mbedtls: Clear sock member if error creating SSLSocket.Damien George
Otherwise if/when the finaliser runs for this newly created SSLSocket the mbedtls state will be freed again. Signed-off-by: Damien George <damien@micropython.org>
2023-08-30py/mpconfig: Enable SSL finalizers if finalizers are enabled.Jim Mussared
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-30py/profile: Remove the requirement to disable MICROPY_COMP_CONST.Jim Mussared
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-30tests/misc/sys_settrace_features.py: Fix to run on newer CPython.Jim Mussared
This test was failing on CPython 3.11 as it now emits `0` as the line number for the "call" event corresponding to import, where as in 3.6 it had `1` as the line number. We maintain the old behavior, but in order to make this test pass on both CPython versions, the trace handler now converts the `0` to a `1`. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-24esp8266/boards/ESP8266_GENERIC: Add image filename.Damien George
This image is now in micropython-media. Signed-off-by: Damien George <damien@micropython.org>
2023-08-24cc3200/Makefile: Build firmware.zip.Jim Mussared
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-23esp32/boards/ESP32_GENERIC_C3: Enable UART REPL.Jim Mussared
This should have been added in 4815af75bc0bc21e1e66b958fd4ee4e90c24ba10 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-23rp2: Rename PICO, PICO_W to RPI_PICO, RPI_PICO_W.Jim Mussared
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-23esp8266: Add board variant support.Jim Mussared
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-23esp32: Rename GENERIC* boards to ESP32_GENERIC*.Jim Mussared
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{esp32,rp2,stm32}/Makefile: Append board variant to BUILD.Jim Mussared
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-23ports/*/boards/*/board.json: Remove "id" field.Jim Mussared
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-23stm32: Use uppercase variant names.Jim Mussared
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-23rp2: Use uppercase variant names.Jim Mussared
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-23esp32: Use uppercase variant names.Jim Mussared
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-23nrf/boards: Rename all nRF boards to use uppercase.Jim Mussared
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-23stm32/modstm: Add MICROPY_PY_STM_CONST flag, clear it for STM32WL5.Angus Gratton
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-23stm32/subghz: Add STM32WL55 subghz radio interface to stm module.Angus Gratton
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-23stm32/dma: Fix DMA completion on WL55 boards.Angus Gratton
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-23stm32/powerctrlboot: Support STM32WL system clock from HSE+PLL.Angus Gratton
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-23stm32/spi: Add STM32WL5 SUBGHZ SPI peripheral.Angus Gratton
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-16mimxrt: Fix UART RTS/CTS assignments for the OLIMEX and Adafruit boards.robert-hh
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-16top: Enable ruff linter check for F821 undefined-name.Angus Gratton
Very helpful for catching typos or missing imports when writing code! Description can be found at https://beta.ruff.rs/docs/rules/undefined-name/ Parent commits contain various small fixes and inline ignores for this check. The only blanket exception is manifest files, which are numerous and evaluated with some global names pre-defined - these can be globally ignored. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-16tools/mpy-tool.py: Ignore linter failure in Python 2 compatibility code.Angus Gratton
Found by Ruff checking F821. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-16tools/mpy_ld.py: Pre-declare some local variables to appease linter.Angus Gratton
Spurious fix as the logic is structured such that these variables will be set before dereferenced, but this keeps Ruff happy (no more F821 undefined-name). Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-16renesas-ra/boards: Remove unreachable code in make-pins.py.Angus Gratton
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-16examples/hwapi: Add missing import for 96Boards Carbon example.Angus Gratton
Found by Ruff checking F821. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-16all: Add missing imports for micropython.const.Angus Gratton
Found by Ruff checking F821. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-16cc3200/tools: Fix exception raised on process failure.Angus Gratton
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-16mpy-cross: Fix source file name in file-not-found error.Angus Gratton
Found by Ruff with F821. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-08-16examples: Mark asm, pio, etc. as noqa: F821 (undefined-name).Angus Gratton
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-15mimxrt/hal: Make flash clock frequency configurable.Kwabena W. Agyeman
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
2023-08-15mimxrt/boards: Add support for GPIO control of SNVS pins.Kwabena W. Agyeman
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
2023-08-15mimxrt/machine_uart: Add support for UART hardware flow control.Kwabena W. Agyeman
Signed-off-by: "Kwabena W. Agyeman" <kwagyeman@live.com>
2023-08-15mimxrt/machine_uart: Add uart.deinit method and machine_uart_deinit_all.robert-hh
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-15mimxrt/hal/pwm_backport: Fix 0 and 65536 edge cases of PWM's duty_u16.robert-hh
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-15mimxrt/machine_pin: Fix bug when Pin.irq is called without a handler.robert-hh
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-15tools/autobuild: Automatically build all variants for each board.Jim Mussared
Removes the special-case for stm32. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-15esp32/partitions.csv: Rename to partitions-4MiB.csv.Jim Mussared
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-15esp32/boards/GENERIC_S3: Merge with GENERIC_S3_{SPIRAM,SPIRAM_OCT}.Jim Mussared
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-15esp32/boards/GENERIC_S2: Merge with ESP32_S2_WROVER.Jim Mussared
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-15esp32/boards/GENERIC_C3: Merge with GENERIC_C3_USB.Jim Mussared
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-15esp32/boards/GENERIC: Merge with GENERIC_{SPIRAM,OTA,D2WD,UNICORE}.Jim Mussared
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-15all: Remove query-variants make target.Jim Mussared
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-15esp32/Makefile: Implement `make submodules` to match other ports.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-08-15esp32/gccollect: Make level arg volatile to force recursive function.Damien George
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>