Wykres commitów

397 Commity (bbd8760bd9a2302e5abee29db279102bb11d7732)

Autor SHA1 Wiadomość Data
Jim Mussared bbd8760bd9 all: Update Python formatting to ruff-format.
This updates a small number of files that change with ruff-format's (vs
black's) rules.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-11-03 13:30:41 +11:00
Damien George 971f1cf987 stm32/powerctrl: Add support for frequency scaling with HSI on H5 MCUs.
Signed-off-by: Damien George <damien@micropython.org>
2023-10-17 12:41:47 +11:00
Damien George e15882ad2b stm32/boards/STM32H573I_DK: Enable ETH and DAC peripherals.
Signed-off-by: Damien George <damien@micropython.org>
2023-10-17 11:44:16 +11:00
iabdalkader 8b12923da2 stm32/boards/ARDUINO_GIGA: Fix name of pins in board init.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-10-17 00:35:16 +11:00
iabdalkader 4074f828dd stm32/boards/ARDUINO_GIGA: Add QSPI fix/workaround to early init.
This workaround fixes an issue with some production boards that have
an older QSPI flash part revision, which can't handle floating pins.
Note those pins can be reconfigured and reused later.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-10-16 23:14:13 +11:00
iabdalkader da193c42f6 ports: Rename Arduino board LED pins to be consistent.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-10-02 11:57:46 +11:00
iabdalkader 6a6a90507d stm32/boards/ARDUINO_GIGA: Update board config.
Changes are:
- Disable internal flash storage and use the external QSPI for storage.
- Disable default bootloader entry mode.  The bootloader entry function
  exists in board_init.c.
- Remove OSC enable/disable macros (this board doesn't have an OSC).

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2023-09-29 16:56:06 +10:00
Damien George 88564c1406 stm32/uart: Generalise UART source clock calculation for H5 and H7 MCUs.
This gets the calculation working properly for H5 MCUs, and fixes the
switch statement to switch on csel&7 instead of csel&3.

Signed-off-by: Damien George <damien@micropython.org>
2023-09-28 17:30:38 +10:00
Damien George 82b4ab7576 stm32/boards: Move includes to after defines in all hal_conf.h files.
The include of HAL headers should come after the HAL configuration defines,
so that the headers can see whether the defines were made or not, to
provide defaults and configure various things.

Signed-off-by: Damien George <damien@micropython.org>
2023-09-28 17:30:38 +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
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 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
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
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 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
Jim Mussared 3533924c36 extmod/moddeflate: Add deflate module providing the DeflateIO class.
This provides similar functionality to the former zlib.DecompIO and
especially CPython's gzip.GzipFile for both compression and decompression.

This class can be used directly, and also can be used from Python to
implement (via io.BytesIO) zlib.decompress and zlib.compress, as well as
gzip.GzipFile.

Enable/disable this on all ports/boards that zlib was previously configured
for.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-21 19:32:40 +10:00
Jim Mussared add1200343 all: Remove the zlib module.
This will be replaced with a new deflate module providing the same
functionality, with an optional frozen Python wrapper providing a
replacement zlib module.

binascii.crc32 is temporarily disabled.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-07-21 18:48:29 +10:00
Angus Gratton 4548928449 stm32/boards/B_L072Z_LRWAN1: Lower default ROM level to "Core".
Re-enable some features required for the board to still build and the lora
driver to run.

This board only has 192KB of flash total, so default stm32 build is very
close to the limit.

Before:

LINK build-B_L072Z_LRWAN1/firmware.elf
   text    data     bss     dec     hex filename
 184352      68   14112  198532   30784 build-B_L072Z_LRWAN1/firmware.elf

(12256 bytes free)

After:

LINK build-B_L072Z_LRWAN1/firmware.elf
   text    data     bss     dec     hex filename
 155028      68   14052  169148   294bc build-B_L072Z_LRWAN1/firmware.elf

(41580 bytes free)

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-07-20 21:48:10 +10:00
Angus Gratton 3aabdf2f6b stm32/boards/B_L072Z_LRWAN1: Add pin definitions for internal SX1262.
Includes fixing the SCK connection pin.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2023-07-20 21:47:55 +10:00
Yuuki NAGAO 7ca3c1d892 stm32: Add USB support for STM32L1 MCUs.
Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com>
2023-06-27 22:28:31 +09:00
Jim Mussared 2fbc08c462 extmod/asyncio: Rename uasyncio to asyncio.
The asyncio module now has much better CPython compatibility and
deserves to be just called "asyncio".

This will avoid people having to write `from uasyncio import asyncio`.

Renames all files, and updates port manifests to use the new path. Also
renames the built-in _uasyncio to _asyncio.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-06-19 17:33:03 +10:00
Damien George 6f74146bc1 stm32/boards/STM32H573I_DK: Add H5 board definition files.
Signed-off-by: Damien George <damien@micropython.org>
2023-06-15 11:09:37 +10:00
Damien George ec4232b32e stm32/boards: Add ld, af.csv and hal_conf_base.h files for H5 MCUs.
Signed-off-by: Damien George <damien@micropython.org>
2023-06-15 11:09:37 +10:00
Damien George 30100e9b3d stm32/boards: Use default spibdev config where appropriate.
Signed-off-by: Damien George <damien@micropython.org>
2023-06-08 23:01:03 +10:00
Jim Mussared a1fbb1980c extmod/modtimeq: Remove timeq module.
This is a MicroPython-specific module that existed to support the old
version of uasyncio.  It's undocumented and not enabled on all ports and
takes up code size unnecessarily.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-06-08 17:54:28 +10:00
Jim Mussared 5fd042e7d1 all: Replace all uses of umodule in Python code.
Applies to drivers/examples/extmod/port-modules/tools.

This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-06-08 17:54:24 +10:00
Jim Mussared f5f9edf645 all: Rename UMODULE to MODULE in preprocessor/Makefile vars.
This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-06-08 17:54:11 +10:00
Damien George b57b079bbe stm32/boards/NUCLEO_L4A6ZG: Add new board definition.
Signed-off-by: Damien George <damien@micropython.org>
2023-05-24 11:25:53 +10:00
Jim Mussared 0ba08e6299 stm32/boards/NUCLEO_G474RE: Make it easier to enable USB.
This work was funded through GitHub Sponsors.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-05-24 11:13:23 +10:00
brave ulysses ad216be5f1 stm32/boards/stm32h723_af.csv: Fix ADC AF definitions.
These were incorrectly added in d995c01042.
The fix here includes the full differential ADC definitions.

Signed-off-by: brave ulysses <brave_ulysses@email.com>
2023-05-19 22:12:05 +10:00
Jim Lipsey 7333c06d05 stm32/boards/ARDUINO_PORTENTA_H7: Enable FDCAN.
Add pin definitions to enable FDCAN support using the pyb.CAN() class.
2023-05-09 13:25:03 +10:00
Christian Clauss 79e57473b2 all: Fix various Python coding inconsistencies found by ruff.
This fixes:
- type-comparison (E721): do not compare types, use isinstance().
- string-dot-format-missing-arguments (F524): .format call is missing
  argument(s) for placeholder(s): {message}.
- f-string-missing-placeholders (F541).
- is-literal (F632): Use != to compare constant literals.

The last one is fixed by just comparing for truthfulness of `state`.
2023-05-02 16:14:45 +10:00
Damien George b1229efbd1 all: Fix spelling mistakes based on codespell check.
Signed-off-by: Damien George <damien@micropython.org>
2023-04-27 18:03:06 +10:00
Sebastian Romero 0a3600a9ad stm32/boards/ARDUINO_NICLA_VISION: Fix incorrect bootloader PID. 2023-03-31 17:11:14 +11:00
Damien George 31e7a0587d stm32/boards/NUCLEO_G0B1RE: Add config for USB and mboot.
But leave these disabled.

Signed-off-by: Damien George <damien@micropython.org>
2023-03-22 16:38:03 +11:00
Damien George 31638473b7 stm32/mboot: Add support for G0 MCUs.
Signed-off-by: Damien George <damien@micropython.org>
2023-03-22 16:38:03 +11:00
Damien George c7923b1139 stm32: Add support for USB on G0 MCUs.
Signed-off-by: Damien George <damien@micropython.org>
2023-03-22 16:38:03 +11:00
Damien George 051e2900d9 stm32/boards/NUCLEO_H723ZG: Add new H723 board.
The following have been tested and are working:
- 550MHz CPU frequency
- UART REPL via ST-Link
- USB REPL and mass storage
- 3x LEDs and 1x user button
- Ethernet

Signed-off-by: Damien George <damien@micropython.org>
2023-03-21 14:05:59 +11:00
Damien George d995c01042 stm32/boards: Add ld and af.csv for H723.
Signed-off-by: Damien George <damien@micropython.org>
2023-03-21 14:02:49 +11:00
Damien George 42511b5291 stm32/boards/NUCLEO_H743ZI2: Fix MCU tag in board.json file.
Signed-off-by: Damien George <damien@micropython.org>
2023-03-20 15:24:45 +11:00
iabdalkader a197823eb7 ports: Fix MCU tags in Arduino board.json files. 2023-03-20 15:22:24 +11:00
Christian Clauss 4376c969f6 all: Fix Python comparison to None and True, and use "not in".
These are basic PEP8 recommendations.
2023-03-10 13:32:24 +11:00
iabdalkader 8307046406 stm32/boards: Include "senml" in manifest for ARDUINO boards. 2023-03-09 10:37:06 +11:00
Andrew Leech 2eca86e8fa stm32/powerctrl: Add sleep RCC semaphore management for WB55 MCUs.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2023-03-08 11:33:00 +11:00
iabdalkader 40a49f5a7a stm32/boards/ARDUINO_GIGA: Add support for Arduino Giga H7 board. 2023-03-08 00:55:51 +11:00
iabdalkader b6904cba76 stm32/boards/ARDUINO_NICLA_VISION: Add support for Arduino Nicla Vision. 2023-03-08 00:55:38 +11:00
iabdalkader d18de7ec81 stm32/boards/ARDUINO_PORTENTA_H7: Update board config files.
Changes are:
- Freeze micropython-lib time module to get strftime.
- Reserve the last 1MB of QSPI flash for (optional) WiFi firmware storage.
- Disable SD card mount on boot.
- Enable high-speed BLE firmware download.
2023-03-08 00:51:33 +11:00