From 60935c29ebb6140401dc4136c7592d501345a1b9 Mon Sep 17 00:00:00 2001 From: applecuckoo Date: Sun, 28 May 2023 16:01:59 +1200 Subject: [PATCH 1/3] Fix up EFR32 port readme --- README.rst | 1 + ports/silabs/README.md | 85 ++++++++++----------- ports/silabs/res/{Thony.png => Thonny.png} | Bin 3 files changed, 43 insertions(+), 43 deletions(-) rename ports/silabs/res/{Thony.png => Thonny.png} (100%) diff --git a/README.rst b/README.rst index 1a6dc2c33e..c07591ef3b 100644 --- a/README.rst +++ b/README.rst @@ -235,6 +235,7 @@ litex alpha mimxrt10xx alpha nrf stable raspberrypi stable +efr32 alpha stm ``F4`` stable | ``others`` beta unix alpha ================ ============================================================ diff --git a/ports/silabs/README.md b/ports/silabs/README.md index 626b8e7788..1186690911 100644 --- a/ports/silabs/README.md +++ b/ports/silabs/README.md @@ -1,4 +1,5 @@ -# Circuitpython on EFR32 # +# CircuitPython on EFR32 # + ![GitHub](https://img.shields.io/badge/Technology-Bluetooth_BLE-green) ![GitHub](https://img.shields.io/badge/CircuitPython-8.1.0--beta.0-green) ![GitHub](https://img.shields.io/badge/GSDK-v4.2.1-green) @@ -10,68 +11,69 @@ This port brings the Silicon Labs EFR32 series of MCUs to Circuitpython. Refer to **mpconfigport.mk** for a full list of enabled modules sorted by family. -## How this port is organized: ## +## How this port is organized ## -- **boards/** contains the configuration files for each development board and breakout available on the port, as well as system files and both shared and SoC-specific linker files. Board configuration includes a pin mapping of the board, oscillator information, board-specific build flags, and setup for some other peripheral where applicable. +- **boards/** contains the configuration files for each development board and breakout available on the port, as well as system files and both shared and SoC-specific linker files. Board configuration includes a pin mapping of the board, oscillator information, board-specific build flags, and setup for other peripherals where applicable. - **common-hal/** contains the port-specific module implementations, used by shared-module and shared-bindings. - **peripherals/** contains peripheral setup files and peripheral mapping information, sorted by family and sub-variant. Most files in this directory can be generated with the python scripts in **tools/**. - **supervisor/** contains port-specific implementations of internal flash and serial, as well as the **port.c** file, which initializes the port at startup. -- **tools/** contains Silicon Labs configurator (SLC) tool, python scripts for generating peripheral and pin mapping files in **peripherals/** and **board/**. +- **tools/** contains the Silicon Labs Configurator (SLC) tool, python scripts for generating peripheral and pin mapping files in **peripherals/** and **board/**. At the root level, refer to **mpconfigboard.h** and **mpconfigport.mk** for port specific settings and a list of enabled modules. ## Prerequisites ## + Please ensure you set up your build environment appropriately, as per the guide. You will need: -- Linux: https://learn.adafruit.com/building-circuitpython/linux -- Windows Subsystem for Linux (WSL): https://learn.adafruit.com/building-circuitpython/windows-subsystem-for-linux -- MacOS: Not supported yet +- Linux: +- Windows Subsystem for Linux (WSL): +- macOS: Not supported yet Install necessary packages - $ sudo apt install default-jre gcc-arm-none-eabi wget python3 python3-pip git git-lfs gettext uncrustify - $ sudo python -m pip install --upgrade pip + sudo apt install default-jre gcc-arm-none-eabi wget python3 python3-pip git git-lfs gettext uncrustify + sudo python -m pip install --upgrade pip -## Board supported ## +## Supported boards ## | Board | Code | Build CMD | | --------------------------- | ------------ | ------------------------------------------ | | xG24 Dev Kit | brd2601b | devkit_xg24_brd2601b | | xG24 Explorer Kit | brd2703a | explorerkit_xg24_brd2703a | -| Sparkfun Thing Plus MGM240P | brd2704a | sparkfun_thingplus_matter_mgm240p_brd2704a | +| SparkFun Thing Plus MGM240P | brd2704a | sparkfun_thingplus_matter_mgm240p_brd2704a | ## Build instructions ## -Ensure your clone of Circuitpython is ready to build by following the [guide on the Adafruit Website](https://learn.adafruit.com/building-circuitpython/build-circuitpython). This includes installing the toolchain, synchronizing submodules, and running `mpy-cross`. +Ensure your clone of CircuitPython is ready to build by following the [guide on the Adafruit Learning System](https://learn.adafruit.com/building-circuitpython/build-circuitpython). This includes installing the toolchain, synchronizing submodules, and running `mpy-cross`. -Clone the source code of CircuitPython from Github: +Clone the source code of CircuitPython from GitHub: - $ git clone https://github.com/SiliconLabs/circuitpython.git - $ cd circuitpython - $ make fetch-submodules + git clone https://github.com/adafruit/circuitpython.git + cd circuitpython + make fetch-submodules Checkout the branch or tag you want to build. For example: - $ git checkout main + git checkout main -Following the guideline below to install required packages for SLC tool: - https://www.silabs.com/documents/public/user-guides/ug520-software-project-generation-configuration-with-slc-cli.pdf +Follow the guide below to install the required packages for the Silicon Labs Configurator (SLC): + Once the one-time build tasks are complete, you can build at any time by navigating to the port directory: - $ make BOARD=explorerkit_xg24_brd2703a + make BOARD=explorerkit_xg24_brd2703a You may also build with certain flags available in the makefile, depending on your board and development goals: - $ make BOARD=explorerkit_xg24_brd2703a DEBUG=1 + make BOARD=explorerkit_xg24_brd2703a DEBUG=1 -Clean project by using: +Clean the project by using: - $ make BOARD=explorerkit_xg24_brd2703a clean + make BOARD=explorerkit_xg24_brd2703a clean -## Bring-up on the board ## +## Running CircuitPython ## -### Getting a REPL prompt ### +### Connecting to the Serial Console ### Connect the devkit to the PC via the USB cable. The board uses serial for REPL access and debugging because the EFR32 chips has no USB support. @@ -81,31 +83,28 @@ On Windows, we need to install a serial console e.g., PuTTY, MobaXterm. The JLin #### Linux #### -Open a terminal and issue the following command:  +Open a terminal and issue the following command: - $ ls /dev/ttyACM* + ls /dev/ttyACM* -Then note down the correct name and substitute com-port-name in the following command with it:  +Then note down the correct name and substitute com-port-name in the following command with it: - $ screen /dev/'com-port-name' + screen /dev/'com-port-name' ### Using the REPL prompt ### After flashing the firmware to the board, at your first connecting to the board, you might see a blank screen. Press enter and you should be presented with a Circuitpython prompt, >>>. If not, try to reset the board (see instructions below). -You can now type in simple commands such as:  +You can now type in simple commands such as: -```sh ->>> print("Hello world!")  - -Hello world -``` + >>> print("Hello world!")  + Hello world! If something goes wrong with the board, you can reset it. Pressing CTRL+D when the prompt is open performs a soft reset. ### Recommended editors ### -**Thonny** is a simple code editor that works with the Adafruit CircuitPython boards.  +**Thonny** is a simple code editor that works with the Adafruit CircuitPython boards. Config serial: Tools > Options > Interpreter > Select MicroPython > Select Port Jlink CDC UART Port @@ -115,18 +114,18 @@ At the boot stage, two scripts will be run (if not booting in safe mode). First, After code.py has finished executing, a REPL prompt will be presented on the serial port. Other files can also be executed by using the **Thonny** editors or using **Ampy** tool. -![Thony](./res/Thony.png) +![Thonny](./res/Thonny.png) With the boards which support USB mass storage, we can drag the files to the board file system. However, because the EFR32 boards don’t support USB mass storage, we need to use a tool like **Ampy** to copy the file to the board. You can use the latest version of **Ampy** and its  command to copy the module directories to the board. -Refer to the guideline below for installing the **Ampy** tool:  +Refer to the guide below for installing the **Ampy** tool: -https://learn.adafruit.com/micropython-basics-load-files-and-run-code/install-ampy   + -## Modules supported ## +## Built-in modules available ## | Board | Modules Available| | --------------------------- | ---------------- | -| xG24 Dev Kit | _asyncio, _bleio, _pixelmap, adafruit_ble, adafruit_bus_device, adafruit_pixelbuf, adafruit_register, aesio,analogio, array, atexit, binascii, bitmaptools, board, builtins, busio, collections, digitalio, displayio,errno, fontio, framebufferio, gc, getpass, gifio, json, math, microcontroller, micropython, msgpack, nvm, onewireio, os, pwmio, rainbowio, random, re, rtc, select, sharpdisplay, storage, struct, supervisor, sys, terminalio, time, traceback, ulab, uselect, vectorio, watchdog, zlib | -| xG24 Explorer Kit | _asyncio, _bleio, _pixelmap, adafruit_ble, adafruit_bus_device, adafruit_pixelbuf, adafruit_register, aesio,analogio, array, atexit, binascii, bitmaptools, board, builtins, busio, collections, digitalio, displayio,errno, fontio, framebufferio, gc, getpass, gifio, json, math, microcontroller, micropython, msgpack, nvm, onewireio, os, pwmio, rainbowio, random, re, rtc, sdcardio, select, sharpdisplay, storage, struct, supervisor, sys, terminalio, time, traceback, ulab, uselect, vectorio, watchdog, zlib | -| Sparkfun Thing Plus MGM240P | _asyncio, _bleio, _pixelmap, adafruit_ble, adafruit_bus_device, adafruit_pixelbuf, adafruit_register, aesio,analogio, array, atexit, binascii, bitmaptools, board, builtins, busio, collections, digitalio, displayio,errno, fontio, framebufferio, gc, getpass, gifio, json, math, microcontroller, micropython, msgpack, nvm, onewireio, os, pwmio, rainbowio, random, re, rtc, sdcardio, select, sharpdisplay, storage, struct, supervisor, sys, terminalio, time, traceback, ulab, uselect, vectorio, watchdog, zlib | +| xG24 Dev Kit | _asyncio, _bleio, _pixelmap, adafruit_ble, adafruit_bus_device, adafruit_pixelbuf, adafruit_register, aesio, analogio, array, atexit, binascii, bitmaptools, board, builtins, busio, collections, digitalio, displayio, errno, fontio, framebufferio, gc, getpass, gifio, json, math, microcontroller, micropython, msgpack, nvm, onewireio, os, pwmio, rainbowio, random, re, rtc, select, sharpdisplay, storage, struct, supervisor, sys, terminalio, time, traceback, ulab, uselect, vectorio, watchdog, zlib | +| xG24 Explorer Kit | _asyncio, _bleio, _pixelmap, adafruit_ble, adafruit_bus_device, adafruit_pixelbuf, adafruit_register, aesio, analogio, array, atexit, binascii, bitmaptools, board, builtins, busio, collections, digitalio, displayio, errno, fontio, framebufferio, gc, getpass, gifio, json, math, microcontroller, micropython, msgpack, nvm, onewireio, os, pwmio, rainbowio, random, re, rtc, sdcardio, select, sharpdisplay, storage, struct, supervisor, sys, terminalio, time, traceback, ulab, uselect, vectorio, watchdog, zlib | +| SparkFun Thing Plus MGM240P | _asyncio, _bleio, _pixelmap, adafruit_ble, adafruit_bus_device, adafruit_pixelbuf, adafruit_register, aesio, analogio, array, atexit, binascii, bitmaptools, board, builtins, busio, collections, digitalio, displayio, errno, fontio, framebufferio, gc, getpass, gifio, json, math, microcontroller, micropython, msgpack, nvm, onewireio, os, pwmio, rainbowio, random, re, rtc, sdcardio, select, sharpdisplay, storage, struct, supervisor, sys, terminalio, time, traceback, ulab, uselect, vectorio, watchdog, zlib | diff --git a/ports/silabs/res/Thony.png b/ports/silabs/res/Thonny.png similarity index 100% rename from ports/silabs/res/Thony.png rename to ports/silabs/res/Thonny.png From 40a31390aa6da1222892b00ecb67b3c6a81b53d3 Mon Sep 17 00:00:00 2001 From: applecuckoo Date: Wed, 7 Jun 2023 07:30:02 +1200 Subject: [PATCH 2/3] Remove available modules section --- ports/silabs/README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ports/silabs/README.md b/ports/silabs/README.md index 1186690911..6c2043e522 100644 --- a/ports/silabs/README.md +++ b/ports/silabs/README.md @@ -120,12 +120,4 @@ With the boards which support USB mass storage, we can drag the files to the boa Refer to the guide below for installing the **Ampy** tool: - - -## Built-in modules available ## - -| Board | Modules Available| -| --------------------------- | ---------------- | -| xG24 Dev Kit | _asyncio, _bleio, _pixelmap, adafruit_ble, adafruit_bus_device, adafruit_pixelbuf, adafruit_register, aesio, analogio, array, atexit, binascii, bitmaptools, board, builtins, busio, collections, digitalio, displayio, errno, fontio, framebufferio, gc, getpass, gifio, json, math, microcontroller, micropython, msgpack, nvm, onewireio, os, pwmio, rainbowio, random, re, rtc, select, sharpdisplay, storage, struct, supervisor, sys, terminalio, time, traceback, ulab, uselect, vectorio, watchdog, zlib | -| xG24 Explorer Kit | _asyncio, _bleio, _pixelmap, adafruit_ble, adafruit_bus_device, adafruit_pixelbuf, adafruit_register, aesio, analogio, array, atexit, binascii, bitmaptools, board, builtins, busio, collections, digitalio, displayio, errno, fontio, framebufferio, gc, getpass, gifio, json, math, microcontroller, micropython, msgpack, nvm, onewireio, os, pwmio, rainbowio, random, re, rtc, sdcardio, select, sharpdisplay, storage, struct, supervisor, sys, terminalio, time, traceback, ulab, uselect, vectorio, watchdog, zlib | -| SparkFun Thing Plus MGM240P | _asyncio, _bleio, _pixelmap, adafruit_ble, adafruit_bus_device, adafruit_pixelbuf, adafruit_register, aesio, analogio, array, atexit, binascii, bitmaptools, board, builtins, busio, collections, digitalio, displayio, errno, fontio, framebufferio, gc, getpass, gifio, json, math, microcontroller, micropython, msgpack, nvm, onewireio, os, pwmio, rainbowio, random, re, rtc, sdcardio, select, sharpdisplay, storage, struct, supervisor, sys, terminalio, time, traceback, ulab, uselect, vectorio, watchdog, zlib | + \ No newline at end of file From 4d5caff0ed39fd53ad3c0a016e04e5c6a9e89c24 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 8 Jun 2023 13:02:24 -0400 Subject: [PATCH 3/3] fix missing newline --- ports/silabs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/silabs/README.md b/ports/silabs/README.md index 1637a9a4bf..17423f57a3 100644 --- a/ports/silabs/README.md +++ b/ports/silabs/README.md @@ -120,4 +120,4 @@ With the boards which support USB mass storage, we can drag the files to the boa Refer to the guide below for installing the **Ampy** tool: - \ No newline at end of file +