Commit Graph

362 Commits

Author SHA1 Message Date
David Lechner
7cc6df3303 stm32/boards/LEGO_HUB_NO6: Use named pins.
This changes all uses of pins to use the alias names of the pins.  This
makes the code easier to understand and will also allow sharing more code
with LEGO_HUB_NO7.

Signed-off-by: David Lechner <david@pybricks.com>
2022-08-05 23:57:35 +10:00
David Lechner
6152bbe3dd stm32/boards/LEGO_HUB_NO6: Fix typo in README.
This fixes a typo in the build directory path.

Signed-off-by: David Lechner <david@pybricks.com>
2022-08-05 23:57:15 +10:00
Angus Gratton
dd77dbd4f7 stm32/boards: Enable LTO by default on boards with smaller flash size.
Signed-off-by: Angus Gratton <gus@projectgus.com>
2022-06-28 10:32:39 +10:00
Angus Gratton
2c015375d1 stm32: Use a separate symbol name for the bootloader state pointer.
Prerequisite for enabling Link Time Optimisation.

The _bl_state address is the same as _estack, but _estack is referred to as
a uint32_t elsewhere in the code. LTO doesn't like it when the same symbol
has two different types.

Signed-off-by: Angus Gratton <gus@projectgus.com>
2022-06-28 10:25:08 +10:00
chrismas9
868f23b362 stm32/boards/NUCLEO_F091RC: Enable LFS1 filesystem.
And disable some less common features to make space for it.

Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2022-06-17 21:27:41 +10:00
chrismas9
fdbca3c143 stm32/boards/stm32f091xc.ld: Allocate space for a small filesystem.
Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
2022-06-17 21:27:32 +10:00
iabdalkader
0adf0dd3d7 stm32/modmachine: Allow boards to provide custom bootloader code.
And expose the machine_bootloader() C function so it can be used elsewhere.
2022-06-17 13:36:55 +10:00
Damien George
3452ee58d3 stm32/boards/LEGO_HUB_NO6: Add comment to readme about powering off.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-09 13:24:08 +10:00
Damien George
340872cfdd stm32/boards/LEGO_HUB_NO6: Add helper scripts to update app firmware.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-02 15:22:16 +10:00
Damien George
87ca431f3f stm32/boards/LEGO_HUB_NO6: Implement robust filesystem-load updates.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-02 14:30:51 +10:00
Damien George
d84ebc31f7 stm32/boards/LEGO_HUB_NO6: Use multi-colour LED for mboot status.
This gives more information to the user when doing updates from SPI flash.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-02 14:30:51 +10:00
Damien George
fae9205594 stm32/boards/LEGO_HUB_NO6: Add support for mboot to access SPI flash.
The following changes are made:
- Use software SPI for external SPI flash access when building mboot.
- Enable the mboot filesystem-loading feature, with FAT FS support.
- Increase the frequency of the CPU when in mboot to 96MHz, to increase the
  speed of SPI flash accesses and programming.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-02 14:30:51 +10:00
Damien George
36211baf0e stm32/boards/LEGO_HUB_NO6: Make all SPI flash transfers use 32-bit addr.
Signed-off-by: Damien George <damien@micropython.org>
2022-06-02 14:30:51 +10:00
Damien George
87fbceef26 stm32/mboot: Pass initial_r0 to early-init and get-reset-mode funcs.
This allows a board to modify initial_r0 if needed.

Also make default board behaviour functions always available, named as
mboot_get_reset_mode_default and mboot_state_change_default.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-02 14:30:51 +10:00
Damien George
5b700b0af9 all: Reformat remaining C code that doesn't have a space after a comma.
Signed-off-by: Damien George <damien@micropython.org>
2022-05-05 13:30:40 +10:00
Asensio Lorenzo Sempere
9d08eb0247 stm32/boards/NUCLEO_G0B1RE: Add NUCLEO_G0B1RE board definition.
This commit adds a board definition for NUCLEO_G0B1RE. This board has the
REPL on UART2 which is connected to the on-board ST-link USB-UART.

Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
2022-04-28 11:56:15 +10:00
Asensio Lorenzo Sempere
010012c7c3 stm32: Add support for G0 MCUs.
This commit adds support for the STM32G0 series of MCUs.

Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
2022-04-28 11:56:15 +10:00
iabdalkader
96ad86ed2b stm32/boards/ARDUINO_PORTENTA_H7: Add support for Arduino Portenta H7. 2022-04-28 10:42:47 +10:00
Damien George
5c32111fa0 ports: Reformat more C and Python source code.
These files that are reformatted only now fall under the list of files to
apply uncrustify/black formatting to.

Signed-off-by: Damien George <damien@micropython.org>
2022-04-20 16:17:35 +10:00
Damien George
707aaa350a stm32/boards/LEGO_HUB_NO6: Exclude BTstack code from formatting.
Signed-off-by: Damien George <damien@micropython.org>
2022-04-20 15:54:26 +10:00
iabdalkader
03c61916bc stm32/boards/ADAFRUIT_F405_EXPRESS: Use external SPI flash for storage.
Fixes issue #8553.
2022-04-20 15:37:14 +10:00
Chris Wilson
b50fe9a6da stm32/boards/SPARKFUN_MICROMOD_STM32: Fix incorrect UART and I2C config.
Based on testing with real hardware.
2022-04-19 10:42:37 +10:00
Dave Hylands
9d7c168bf5 stm32/boards/PYBD_SFx: Allow FROZEN_MANIFEST to be overridden.
Because mpconfigboard.mk used = rather then ?= it doesn't allow
FROZEN_MANIFEST to be overridden using a GNUmakefile or the manifest.
2022-04-11 16:19:45 +10:00
iabdalkader
36cac5e154 stm32/system_stm32: Allow boards to configure PLL VCI, VCO and FRACN.
This removes hard-coded PLL1/3 VCI, VCO and FRACN.
2022-04-11 16:12:53 +10:00
iabdalkader
bdbc9b395f stm32/system_stm32: Add H7 switched-mode-power-supply support.
- Add board-level configuration option to set the SMPS supply mode.
- Wait for valid voltage levels after configuring the SMPS mode.
- Wait for external supply ready flag if SMPS supplies external circuitry.
2022-04-11 16:12:53 +10:00
Damien George
43d50f006d stm32/mpconfigport.h: Let MICROPY_PY_IO_FILEIO take its default value.
This is enabled at MICROPY_CONFIG_ROM_LEVEL_EXTRA_FEATURES, which is the
default for stm32.  Not setting the value in mpconfigboard.h allows boards
to optionally configure it.

Signed-off-by: Damien George <damien@micropython.org>
2022-04-07 13:25:48 +10:00
Damien George
bf89e336b9 stm32/boards/PYBD_SF2: Turn on SD card in mboot init if SD enabled.
Signed-off-by: Damien George <damien@micropython.org>
2022-03-22 13:33:43 +11:00
iabdalkader
a16dcc8136 stm32/boards: Convert F4xx and F7xx to new flash FS config.
Following on from 35e70c1698.

Fixes issue #8390.
2022-03-17 13:06:45 +11:00
Christophe Priouzeau
130f7db1fc stm32/boards/NUCLEO_WB55: Add Arduino pin alias definitions.
Fixes issue #8295.

Signed-off-by: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
2022-02-18 14:45:49 +11:00
Damien George
a7530cbc03 stm32/boards/NUCLEO_L432KC: Disable MICROPY_OPT_COMPUTED_GOTO.
To save space, after recent fixes to L4 ADC made it overflow flash.

Signed-off-by: Damien George <damien@micropython.org>
2022-02-04 14:28:21 +11:00
Damien George
e306f2285b stm32/boards/NUCLEO_WL55: Add new board definition.
Signed-off-by: Damien George <damien@micropython.org>
2022-02-04 09:43:43 +11:00
Damien George
e0a0719416 stm32: Add initial support for STM32WL MCUs.
Signed-off-by: Damien George <damien@micropython.org>
2022-02-04 09:43:43 +11:00
Damien George
9127e63708 stm32/Makefile: Make stm32lib configurable.
The default stm32lib remains lib/stm32lib, but it can now be easily
overriden at build time by specifying STM32LIB_DIR, or STM32LIB_CMSIS_DIR
and STM32LIB_HAL_DIR.

Signed-off-by: Damien George <damien@micropython.org>
2022-02-04 09:43:43 +11:00
Herwin Grobben
8f68e26f79 stm32: Add support for G4 MCUs, and add NUCLEO_G474RE board defn.
This commit adds support for the STM32G4 series of MCUs, and a board
definition for NUCLEO_G474RE.  This board has the REPL on LPUART1 which is
connected to the on-board ST-link USB-UART.
2022-02-01 16:21:01 +11:00
Damien George
df3f59ca4b ports: Update board.json files to link to new board images.
Signed-off-by: Damien George <damien@micropython.org>
2022-01-07 11:33:28 +11:00
Matt Trentini
f2b5c99fde stm32/boards/OLIMEX_H407: Fix typo in OLIMEX H407 board.json.
Appears incorrectly as E407 in the download manager.
2021-12-20 12:32:46 +11:00
iabdalkader
bedd9c5463 stm32/boards/make-pins.py: Generate empty ADC table if needed.
If ADCx pins are hidden, print an empty table to prevent linker errors.
2021-12-20 09:41:46 +11:00
Damien George
6995cf03dd stm32/sdcard: Add config option to force MM card capacity.
The current ST HAL does not support reading the extended CSD so cannot
correctly detect the capacity of high-capacity cards.  As a workaround, the
capacity can be forced via the MICROPY_HW_MMCARD_LOG_BLOCK_NBR config
option.

Signed-off-by: Damien George <damien@micropython.org>
2021-12-14 10:48:01 +11:00
Damien George
88ac5a3116 stm32: Update L4 code to build with latest stm32lib and L4 HAL 1.17.0.
Signed-off-by: Damien George <damien@micropython.org>
2021-12-14 10:48:01 +11:00
Damien George
0892ebe091 stm32/boards: Enable MICROPY_HW_ENABLE_SERVO on various boards.
Fixes issue #8059.

Signed-off-by: Damien George <damien@micropython.org>
2021-12-10 23:19:20 +11:00
Damien George
5fc55999b2 stm32/boards: Remove unused MICROPY_HW_ENABLE_TIMER config.
Signed-off-by: Damien George <damien@micropython.org>
2021-12-10 23:19:00 +11:00
Damien George
10c6f03cbe stm32/boards: Remove stray '+' characters at start of lines in ld files.
Signed-off-by: Damien George <damien@micropython.org>
2021-12-10 23:15:25 +11:00
Damien George
c613f5bb49 stm32/boards/LEGO_HUB_NO6: Set filesystem label as HUB_NO6.
Signed-off-by: Damien George <damien@micropython.org>
2021-12-09 16:51:35 +11:00
Jim Mussared
92f54fe8d9 stm32/boards/NUCLEO_WB55: Fix LED ordering.
These were commented correctly by their colour, but in the wrong order with
respect to the PCB silkscreen.

Fixes issue #8054.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-12-09 14:03:35 +11:00
Damien George
23a150789d stm32/boards/make-pins.py: Use cpu pins to define static alt-fun macros.
Instead of board pins, so that pins which have only the CPU specified in
pins.csv can still be used with mp_hal_pin_config_alt_static().

Signed-off-by: Damien George <damien@micropython.org>
2021-11-30 10:25:41 +11:00
Damien George
0c9f5b388e stm32: Include HAL MMC code in F4 builds.
So that the MMC driver can be used on F4 MCUs.

Signed-off-by: Damien George <damien@micropython.org>
2021-11-30 10:21:18 +11:00
Damien George
7e61a12eb1 stm32: Add support for F479 MCUs.
Signed-off-by: Damien George <damien@micropython.org>
2021-11-30 10:21:18 +11:00
Damien George
35e70c1698 stm32/boards: Convert F413,F439,H743,L4xx,WB55 to new flash FS config.
Signed-off-by: Damien George <damien@micropython.org>
2021-11-29 13:20:35 +11:00
David Michieli
6259aa50eb stm32/boards/NUCLEO_WB55: Update rfcore_firmwre for new WS.
Adds a fix to behavior occuring since WS 1.11 where the FUS returns
misleading statuses during WS upgrade.
2021-11-25 23:28:58 +11:00
Frédéric Pierson
d49df423e0 stm32/boards/NADHAT_PYBF405: Rename board to GARATRONIC_NADHAT_F405.
To add the manufacturer as a prefix to the board name, for consistency with
other Garatronic boards.
2021-11-25 21:10:43 +11:00
Frédéric Pierson
fdb925c4c1 stm32/boards: Add PYBSTICK26 F411 board definition. 2021-11-25 21:09:57 +11:00
Damien George
90554d03c0 stm32/boards: Build NUCLEO_WB55 and STM32F769DISC without mboot enabled.
This is to make the builds for all nucleo/discovery boards uniform, so they
can be treated the same by the auto build scripts.

The CI script is updated to explicitly enable mboot and packing, to test
these features.

Signed-off-by: Damien George <damien@micropython.org>
2021-11-22 17:12:16 +11:00
Lorenzo Cappelletti
8f0e304e65 stm32/boards: Add new board MikroElektronika Quail, and F427 support.
Quail (https://www.mikroe.com/quail, PID: MIKROE-1793) is based on an
STM32F427VI CPU, featuring 2048 kB of Flash memory and 192 kB of RAM.  An
on-board Cypress S25FL164K adds 8 MB of SPI Flash.

Quail has 4 mikroBUS(TM) sockets for Mikroe click(TM) board connectivity,
along with 24 screw terminals for connecting additional electronics and two
USB ports (one for programming, the other for external mass storage).

4 UARTs, 2 SPIs and 1 I2C bus are available for communication.

Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
2021-11-19 16:33:13 +11:00
Lorenzo Cappelletti
16c7a80874 stm32/boards/MIKROE_CLICKER2_STM32: Add more detail to board.json.
Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
2021-11-19 16:32:53 +11:00
MikeTeachman
6d5296e65e stm32,esp32: In machine_i2s, make object reference arrays root pointers.
This change eliminates the risk of the IRQ callback accessing invalid data.
Discussed here:
https://github.com/micropython/micropython/pull/7183#discussion_r660209875

Signed-off-by: Mike Teachman <mike.teachman@gmail.com>
2021-11-13 12:22:42 +11:00
Mike Causer
590ec2ca6e stm32/boards: Add images to board.json for Adafruit and VCC_GND boards. 2021-10-28 09:52:59 +11:00
Jim Mussared
e359b077dd ports: Add board.json for all boards.
This will be used by https://micropython.org/download/ to generate the
full listing of boards and firmware files.

Optionally supports a board.md for additional customisation of the
download page, as well as deploy.md for flashing instructions.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-10-27 14:04:53 +11:00
roland van straten
9eff4029ab stm32/boards: Add PF11-BOOT0 to stm32f091_af.csv.
PF11 is added so it can be used as GPIO.
2021-09-21 18:11:42 +10:00
Ned Konz
99bb52047c stm32/boards/NUCLEO_H743ZI: Enable VfsLfs2 on NUCLEO_H743ZI(2) boards. 2021-09-21 18:02:19 +10:00
Ned Konz
8c214ed200 stm32: Extended flash filesystem space to 512K on H743 boards.
The H743 has equal sized pages of 128k, which means the filesystem doesn't
need to be near the beginning.  This commit moves the filesystem to the
very end of flash, and extends it to 512k (4 pages).

Signed-off-by: Damien George <damien@micropython.org>
2021-09-21 18:02:14 +10:00
Chris Fiege
6e39f2cc1e stm32/boards: Add OLIMEX H407 board definition.
This change adds the OLIMEX H407 support to the STM32 port.  The H407
(https://www.olimex.com/Products/ARM/ST/STM32-H407/) is simliar to the
already existing E407
(https://www.olimex.com/Products/ARM/ST/STM32-E407) but does not support
Ethernet and has a full-size USB-A port instead of a Mini-USB socket.

Both boards use the STM32F407ZGT6 CPU.

This port is basically a copy of the E407 but with changed pinmux:
* Removed Ethernet pin definition
* Removed UART1 (pins are used for other functions)
* Removed UART3 flow control pins (pins are used for other functions)
* Removed SD-Card detect pin (since it is not connected on the H407)

A REPL on UART3 is connected to the U3BOOT-header, a 3-pin header with RX,
TX and GND that is intended for the serial terminal.

Tested:
* Micro-SD Card is detected when inserted on RESET
* REPL on UART3 works
* Serial port on the mini USB socket

Signed-off-by: Chris Fiege <cfi@pengutronix.de>
2021-09-19 16:58:58 +10:00
Damien George
c51cc46bf8 stm32/boards/make-pins.py: Allow empty lines and comments in pins.csv.
Signed-off-by: Damien George <damien@micropython.org>
2021-09-16 12:53:16 +10:00
Damien George
a6907c779a stm32/boards/make-pins.py: Allow a CPU pin to be hidden.
This change allows a CPU pin to be hidden from the user by prefixing it
with a "-" in the pins.csv file for a board.  It will still be available in
C code, just not exposed to Python.

Signed-off-by: Damien George <damien@micropython.org>
2021-09-16 12:53:16 +10:00
Jan Staal
9e2423e730 stm32: Add support for H7A3(Q)/H7B3(Q), and STM32H73B3I_DK board defn.
This commit is based upon prior work of @dpgeorge and @koendv.

MCU support for the STM32H7A3 and B3 families MCUs:
- STM32H7A3xx
- STM32H7A3xxQ (SMPS)
- STM32H7B3xx
- STM32H7B3xxQ (SMPS)

Support has been added for the STM32H7B3I_DK board.

Signed-off-by: Jan Staal <info@janstaal.com>
2021-09-16 12:29:28 +10:00
Damien George
0a51073724 stm32/boards: Remove trailing spaces, and add newline at end of file.
Signed-off-by: Damien George <damien@micropython.org>
2021-09-10 16:09:03 +10:00
Tobias Thyrrestrup
4c31d0ab60 stm32/boards/LEGO_HUB_NO6: Remove user paths from cc2564 init file.
Signed-off-by: Tobias Thyrrestrup <tt@LEGO.com>
2021-09-10 16:00:21 +10:00
Daniel Gorny
b71c621f46 stm32/boards/OLIMEX_E407: Add Ethernet RMII support. 2021-09-10 15:52:03 +10:00
Boris Vinogradov
97bbc0bb91 stm32/boards/VCC_GND_H743VI: Add board definition for VCC_GND_H743VI. 2021-09-10 15:49:26 +10:00
Damien George
25f30eb8a6 stm32/boards/LEGO_HUB_NO6: Add comment re constraints on SPI flash cfg.
Signed-off-by: Damien George <damien@micropython.org>
2021-09-02 00:03:41 +10:00
Damien George
6f19b9c08d stm32/boards/LEGO_HUB_NO6: Add make commands to backup/restore firmware.
Signed-off-by: Damien George <damien@micropython.org>
2021-08-31 00:16:39 +10:00
Damien George
bac791c5fd stm32/boards/LEGO_HUB_NO6: Skip first 1MiB of SPI flash for storage.
The first 1MiB is used by the built-in bootloader and is best left as-is.

Signed-off-by: Damien George <damien@micropython.org>
2021-08-31 00:16:39 +10:00
Damien George
e3eed26d0b stm32/boards/LEGO_HUB_NO6: Change SPI flash storage to use hardware SPI.
Signed-off-by: Damien George <damien@micropython.org>
2021-08-31 00:16:39 +10:00
Jim Mussared
b51e7e9d01 stm32: Disable computed goto on constrained boards.
Saves ~1kiB.  Add comment to this effect to mpconfig.h.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-20 20:18:52 +10:00
Jim Mussared
e64cda5295 stm32: Add implementation of machine.bitstream.
Hand-written version for M0, and cycle-counter version for everything else.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-19 22:50:32 +10:00
Ned Konz
a0cd18c1a5 stm32/boards/NUCLEO_H743ZI2: Add modified version of NUCLEO_H743ZI.
This commit creates a new stm32 board for the NUCLEO_H743ZI2, which is the
current version of this from ST.  This is a modified copy of the
NUCLEO_H743ZI board, and the ZI2 board differs in a few minor ways:

- LED2 has moved from PB7 to PE1 and is now yellow rather than blue
- the USB power enable has moved from PG6 to PG10
- the USER button is now pulled down
2021-08-10 23:38:05 +10:00
Damien George
3b32b3d1b3 stm32/usbd_cdc_interface: Rename USBD_CDC_xx opts to MICROPY_HW_USB_xx.
Signed-off-by: Damien George <damien@micropython.org>
2021-08-07 23:13:58 +10:00
Tobias Thyrrestrup
7a1edb91cb stm32/boards/LEGO_HUB_NO6: Add board definition for LEGO_HUB_NO6.
Add basic support for LEGO HUB NO.6 (e.g. LEGO SPIKE Prime, LEGO MINDSTORMS
Robot Inventor).

See README.md for details.

Thanks to @dpgeorge for helping put this together.

Signed-off-by: Tobias Thyrrestrup <tt@LEGO.com>
2021-07-31 10:25:18 +10:00
Damien George
224ac355cd stm32/boards/NUCLEO_F439ZI: Add board definition for NUCLEO_F439ZI.
Signed-off-by: Damien George <damien@micropython.org>
2021-07-27 16:46:10 +10:00
Matúš Olekšák
0f0006f4e1 stm32/boards/STM32F429DISC: Set correct UART2 pins and add UART3/6. 2021-07-26 14:38:39 +10:00
Damien George
fef2114404 stm32/uart: Fix LPUART1 baudrate set/get.
It needs to use a different function because the formula to compute the
baudrate on LPUART1 is different to a normal UART.

Fixes issue #7466.

Signed-off-by: Damien George <damien@micropython.org>
2021-07-26 13:53:50 +10:00
Chris Wilson
aecb697c72 stm32/boards: Add support for SparkFun STM32 MicroMod Processor board.
Signed-off-by: Chris Wilson <christopher.david.wilson@gmail.com>
2021-07-23 22:03:16 +10:00
Sashkoiv
753b08cae6 stm32/boards/NUCLEO_F446RE: Enable CAN bus support. 2021-07-23 00:06:13 +10:00
Damien George
831cc4a61d stm32/boards/NUCLEO_F446RE: Fix I2C1 pin assignment to match datasheet.
Thanks to @aureliano2nd.

Signed-off-by: Damien George <damien@micropython.org>
2021-07-13 15:25:27 +10:00
Mike Teachman
8a5bfe44a5 esp32,stm32: Add new machine.I2S class for I2S protocol support.
This commit adds I2S protocol support for the esp32 and stm32 ports, via
a new machine.I2S class.  It builds on the stm32 work of blmorris, #1361.

Features include:
- a consistent I2S API across the esp32 and stm32 ports
- I2S configurations supported:
  - master transmit and master receive
  - 16-bit and 32-bit sample sizes
  - mono and stereo formats
  - sampling frequency
  - 3 modes of operation:
    - blocking
    - non-blocking with callback
    - uasyncio
  - internal ring buffer size can be tuned
- documentation for Pyboards and esp32-based boards
- tested on the following development boards:
  - Pyboard D SF2W
  - Pyboard V1.1
  - ESP32 with SPIRAM
  - ESP32

Signed-off-by: Mike Teachman <mike.teachman@gmail.com>
2021-07-05 23:42:25 +10:00
Damien George
86ef965352 stm32/adc: Simplify and generalise how pin_adcX table is defined.
The ADC_FIRST_GPIO_CHANNEL and ADC_LAST_GPIO_CHANNEL macros are no longer
needed.  Instead the pin_adcX table (X = 1, 2, 3) is now generated to be
the exact size needed for a given MCU, and MP_ARRAY_SIZE(pin_adcX) is used
to determine the upper bound.

This commit also allows CPU pins to be excluded from ADC configuration if
they are hidden by prefixing their name with a "-".

Signed-off-by: Damien George <damien@micropython.org>
2021-07-05 16:03:11 +10:00
Damien George
cf849d84b9 stm32/boards: Enable MICROPY_HW_SPIFLASH_ENABLE_CACHE on VCC_GND boards.
Because these boards use the SPI flash cache in their bdev.c configuration.

Signed-off-by: Damien George <damien@micropython.org>
2021-06-10 22:48:17 +10:00
Damien George
211c3e41f1 stm32/boards/PYBD_SF2: Disable GCC 11 warnings for array bounds.
With GCC 11 there is now a warning about array bounds of OTP-mac, due to
the OTP being a literal address.

Signed-off-by: Damien George <damien@micropython.org>
2021-05-27 23:57:51 +10:00
Damien George
62f75376dd stm32/boards/NUCLEO_L432KC: Fix FS size and enable LFS1 filesystem.
Signed-off-by: Damien George <damien@micropython.org>
2021-05-27 12:18:41 +10:00
Mike Causer
47b778332a all: Replace busses with buses.
"buses" is the widely accepted plural form of "bus".
2021-05-20 23:22:03 +10:00
Mike Causer
1ca66efbf7 stm32/boards: Add VCC_GND_F407ZG board. 2021-05-20 23:17:51 +10:00
Mike Causer
c24003abec stm32/boards: Add VCC_GND_F407VE board. 2021-05-20 23:15:56 +10:00
David Lechner
ca0c75f504 stm32/boards: Change default LSI_VALUE to 32000 for F4 MCUs.
In the STM32 HAL libraries, the default value for LSI_VALUE for F4 MCUs is
32 kHz.

Signed-off-by: David Lechner <david@pybricks.com>
2021-05-04 16:53:40 +10:00
iabdalkader
baa712b7f0 stm32/boards/PYBD_SF2: Enable RF switch compile option. 2021-04-30 10:16:15 +10:00
Damien George
cf7e71fa43 stm32/sdcard: Allow configuring the SDMMC periph used for SD/MMC card.
This can now be selected by setting MICROPY_HW_SDCARD_SDMMC, which defaults
to 1, ie SDMMC1.  This commit also renames the SD pin configuration macros
from MICROPY_HW_SDMMC2_xxx to MICROPY_HW_SDCARD_xxx, as well as renaming
MICROPY_HW_SDMMC_BUS_WIDTH to MICROPY_HW_SDCARD_BUS_WIDTH.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-30 00:58:17 +10:00
Damien George
6e0f9b9262 stm32/boards/pllvalues.py: Support wider range of PLL values for F413.
Signed-off-by: Damien George <damien@micropython.org>
2021-04-20 23:33:33 +10:00
Damien George
25c029ce9f stm32/boards: Split UARTx_RTS_DE into UARTx_RTS/UARTx_DE in pin defs.
So these alternate functions can be parsed by the build scripts and used in
application code.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-13 23:58:20 +10:00
aziubin
7546d3cf73 stm32/boards/NUCLEO_L476RG: Add 5 remaining UARTs.
STM32L476RG MCU of NUCLEO_L476RG board has 6 UART/USART units in total
(USART1, USART2, USART3, UART4, UART5 and LPUART1), but only UART2,
connected to REPL, was defined and available in Python code.
Defined are all 5 remaining UART/USART units including LPUART1.

Signed-off-by: Alexander Ziubin aziubin@googlemail.com
2021-04-09 15:00:55 +10:00
Damien George
cb396827f5 stm32/boards/pllvalues.py: Relax PLLQ constraints on STM32F413 MCUs.
Signed-off-by: Damien George <damien@micropython.org>
2021-04-07 12:47:21 +10:00
Damien George
25ae169e6e stm32: Include .ARM section in firmware for C++ exception handling.
Support for C++ was added in 97960dc7de but
that commit didn't include the C++ exception handling table in the binary
firmware image.  This commit fixes that.

Signed-off-by: Damien George <damien@micropython.org>
2021-04-06 12:11:15 +10:00
Damien George
03a64f2077 stm32/boards/NUCLEO_WB55: Enable LPUART1 on PA2/PA3.
Signed-off-by: Damien George <damien@micropython.org>
2021-02-21 15:49:33 +11:00