Skip to content

Add stm to docs matrix #2598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions docs/porting.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
We love CircuitPython and would love to see it come to more microcontroller
platforms. With 3.0 we've reworked CircuitPython to make it easier than ever to
platforms. Since 3.0 we've reworked CircuitPython to make it easier than ever to
add support. While there are some major differences between ports, this page
covers the similarities that make CircuitPython what it is and how that core
fits into a variety of microcontrollers.
Expand All @@ -19,7 +19,7 @@ prepping file systems and automatically running user code on boot. In
CircuitPython we've dubbed this component the supervisor because it monitors
and facilitates the VMs which run user Python code. Porting involves the
supervisor because many of the tasks it does while interfacing with the
hardware. Once its going though, the REPL works and debugging can migrate to a
hardware. Once complete, the REPL works and debugging can migrate to a
Python based approach rather than C.

The third core piece is the plethora of low level APIs that CircuitPython
Expand All @@ -42,6 +42,44 @@ to the port's directory (in the top level until the ``ports`` directory is
present). This includes the Makefile and any C library resources. Make sure
these resources are compatible with the MIT License of the rest of the code!

Circuitpython has a number of modules enabled by default in
``py/circuitpy_mpconfig.mk``. Most of these modules will need to be disabled in
``mpconfigboard.mk`` during the early stages of a port in order for it to
compile. As the port progresses in module support, this list can be pruned down
as a natural "TODO" list. An example minimal build list is shown below:

.. code-block:: makefile

# These modules are implemented in ports/<port>/common-hal:
CIRCUITPY_MICROCONTROLLER = 0 # Typically the first module to create
CIRCUITPY_DIGITALIO = 0 # Typically the second module to create
CIRCUITPY_ANALOGIO = 0
CIRCUITPY_BUSIO = 0
CIRCUITPY_NEOPIXEL_WRITE = 0
CIRCUITPY_PULSEIO = 0
CIRCUITPY_OS = 0
CIRCUITPY_NVM = 0
CIRCUITPY_AUDIOBUSIO = 0
CIRCUITPY_AUDIOIO = 0
CIRCUITPY_ROTARYIO = 0
CIRCUITPY_RTC = 0
CIRCUITPY_FREQUENCYIO = 0
CIRCUITPY_I2CSLAVE = 0
CIRCUITPY_DISPLAYIO = 0 # Requires SPI, PulseIO (stub ok)

# These modules are implemented in shared-module/ - they can be included in
# any port once their prerequisites in common-hal are complete.
CIRCUITPY_BITBANGIO = 0 # Requires DigitalIO
CIRCUITPY_GAMEPAD = 0 # Requires DigitalIO
CIRCUITPY_PIXELBUF = 0 # Requires neopixel_write or SPI (dotstar)
CIRCUITPY_RANDOM = 0 # Requires OS
CIRCUITPY_STORAGE = 0 # Requires OS, filesystem
CIRCUITPY_TOUCHIO = 0 # Requires Microcontroller
CIRCUITPY_USB_HID = 0 # Requires USB
CIRCUITPY_USB_MIDI = 0 # Requires USB
CIRCUITPY_REQUIRE_I2C_PULLUPS = 0 # Does nothing without I2C
CIRCUITPY_ULAB = 0 # No requirements, but takes extra flash

Step 2: Init
--------------
Once your build is setup, the next step should be to get your clocks going as
Expand Down
19 changes: 8 additions & 11 deletions docs/shared_bindings_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import re


SUPPORTED_PORTS = ["atmel-samd", "nrf", "mimxrt10xx"]
SUPPORTED_PORTS = ["atmel-samd", "nrf", "stm", "mimxrt10xx"]


def parse_port_config(contents, chip_keyword=None):
Expand Down Expand Up @@ -139,7 +139,10 @@ def get_excluded_boards(base):
re_board_chip = re.compile("CHIP_FAMILY\s=\s(\w+)")
chip_keyword = "CHIP_FAMILY"
elif port in ["nrf"]:
re_board_chip = re.compile("MCU_VARIANT\s=\s(\w+)")
re_board_chip = re.compile(r"MCU_VARIANT\s=\s(\w+)")
elif port in ["stm"]:
re_board_chip = re.compile(r"MCU_SERIES\s*=\s*(\w+)")
chip_keyword = "MCU_SERIES"

port_dir = "ports/{}".format(port)

Expand All @@ -158,10 +161,10 @@ def get_excluded_boards(base):
contents = board.read()

board_chip = re_board_chip.search(contents)
#print(entry.name, board_chip.group(1))
if not board_chip:
board_chip = "Unknown Chip"
else:
#print(entry.name, board_chip.group(1))
board_chip = board_chip.group(1)

# add port_config results to contents
Expand All @@ -172,18 +175,12 @@ def get_excluded_boards(base):
check_dependent_modules = dict()
for module in modules:
board_is_excluded = False
# check if board uses `SMALL_BUILD`. if yes, and current
# check if board turns off `FULL_BUILD`. if yes, and current
# module is marked as `FULL_BUILD`, board is excluded
small_build = re.search("CIRCUITPY_SMALL_BUILD = 1", contents)
small_build = re.search("CIRCUITPY_FULL_BUILD = 0", contents)
if small_build and base[module]["full_build"] == "1":
board_is_excluded = True

# check if board uses `MINIMAL_BUILD`. if yes, and current
# module is marked as `DEFAULT_BUILD`, board is excluded
min_build = re.search("CIRCUITPY_MINIMAL_BUILD = 1", contents)
if min_build and base[module]["default_value"] == "CIRCUITPY_DEFAULT_BUILD":
board_is_excluded = True

# check if module is specifically disabled for this board
re_pattern = r"CIRCUITPY_{}\s=\s(\w)".format(module.upper())
find_module = re.search(re_pattern, contents)
Expand Down
4 changes: 2 additions & 2 deletions ports/atmel-samd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ else

# Do a default shrink for small builds.
ifndef CFLAGS_INLINE_LIMIT
ifeq ($(CIRCUITPY_SMALL_BUILD),1)
ifeq ($(CIRCUITPY_FULL_BUILD),0)
CFLAGS_INLINE_LIMIT = 50
endif
endif
Expand All @@ -125,7 +125,7 @@ else

CFLAGS += -flto -flto-partition=none

ifeq ($(CIRCUITPY_SMALL_BUILD),1)
ifeq ($(CIRCUITPY_FULL_BUILD),0)
CFLAGS += --param inline-unit-growth=15 --param max-inline-insns-auto=20
endif

Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/8086_commander/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q128JV_SQ"

LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0

Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/datum_distance/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/datum_imu/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/datum_light/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/datum_weather/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/meowmeow/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/ndgarage_ndbit6/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0

2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/nfc_copy_cat/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "GD25Q16C"
LONGINT_IMPL = NONE

CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/pewpew10/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

CIRCUITPY_PEW = 1
CIRCUITPY_ANALOGIO = 1
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CHIP_FAMILY = samd51
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE

CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
# TODO: Turn off analogio for now for space reasons, but restore it
# when frozen module gets smaller.
CIRCUITPY_ANALOGIO = 0
Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CIRCUITPY_RTC = 0
CIRCUITPY_SAMD = 0
CIRCUITPY_USB_MIDI = 1
CIRCUITPY_TOUCHIO = 0
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
# Make more room.
SUPEROPT_GC = 0

Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/pyruler/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0

Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/seeeduino_xiao/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/shirtty/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
CIRCUITPY_I2CSLAVE = 1
CIRCUITPY_TOUCHIO = 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ CHIP_FAMILY = samd21
INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE

CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ EXTERNAL_FLASH_DEVICE_COUNT = 1
EXTERNAL_FLASH_DEVICES = "W25Q32FV"
LONGINT_IMPL = MPZ

CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
SUPEROPT_GC = 0
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0

Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/uchip/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = NONE
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CHIP_FAMILY = samd21

INTERNAL_FLASH_FILESYSTEM = 1
LONGINT_IMPL = MPZ
CIRCUITPY_SMALL_BUILD = 1
CIRCUITPY_FULL_BUILD = 0

SUPEROPT_GC = 0

Expand Down
Loading