Get started with MicroPython

Introduction

I used MicroPython for the first time with Lego Spike. For beginners, I felt that it was a good environment to start embedded programs without having trouble building the environment and volatile, so I tried to try it on other boards, but I felt that it was not suitable for beginners because I had a hard time writing firmware. The procedure is summarized in the article.

Operation check environment

--PC: Windows (The same procedure should be used for Mac and Linux. Since it is a Windows user ....) --Install TeraTerm -(Optional) Install Ubuntu 18.04 LTS with WSL --You don't need it if you just need to run the program from the REPL (command line).

--Board: One of the following boards, the other board will be described later. - NUCLEO-F401RE - NUCLEO-F767 - NUCLEO-H743ZI

Installation

We will explain how to install the firmware using Windows as an example.

--Download the file according to the board - NUCLEO-F401RE - NUCLEO-F767 - NUCLEO-H743ZI

--The following is an explanation using F401RE as an example.

--Connect the board to your PC --The drive will be displayed as follows.

image.png

--Copy the downloaded file to the above folder --You can copy it by dragging and dropping.

Run by REPL (console / command line)

I will explain the procedure on Windows about the procedure for interactive execution, which is a feature of MicroPython.

--Connect the board to your PC --Check the port number --Start Device Manager (Windows-X + M) and check the connected port number.

image.png

--Start TeraTerm, specify the above COM port and press "OK". image.png

--After connecting, go to "Settings"-> "Serial Port", set the speed to 115200 as shown below, and select "Reset current connection". image.png

--Successful if you enter Ctrl-D on the console and the following is displayed image.png

--The rest is executed line by line or by pressing Ctrl-E to enter paste mode, pasting the code, and then pressing Ctrl-D.

Execution by file transfer

If you can use Python and pip on your PC, you can transfer and execute files. Use a tool called ampy.

--Installation

sudo pip install adafruit-ampy

--Environment variable settings

export AMPY_PORT=/dev/ttySxx (The number in xx is the com port number)

--Execute

ampy run xx.py

Build from source

-Here If you build and download the built firmware.bin as a target, it will work.

change history

Recommended Posts

Get started with MicroPython
Get started with MicroPython (on macOS)
Get started with Mezzanine
Get started with Django! ~ Tutorial ⑤ ~
Get started with Django! ~ Tutorial ④ ~
Get started with Django! ~ Tutorial ⑥ ~
Get started with Python! ~ ② Grammar ~
Get started with Python! ~ ① Environment construction ~
Link to get started with python
How to get started with Scrapy
How to get started with Django
Get started with machine learning with SageMaker
Get started with Python in Blender
Step notes to get started with django
I tried to get started with Hy
Get started with the documentation tool Sphinx
Get Started with TopCoder in Python (2020 Edition)
How Python beginners get started with Python with Progete
How to get started with laravel (Linux)
[Blender x Python] Let's get started with Blender Python !!
Django 1.11 started with Python3.6
Python hand play (let's get started with AtCoder?)
Get started Jupyter Notebook
The easiest way to get started with Django
1.1 Getting Started with Python
Getting Started with Golang 2
Getting started with apache2
Getting Started with Python
Getting Started with Django 1
Getting Started with Optimization
Get Tweets with Tweepy
MicroPython (mac) with ESP-WROOM-02
Getting Started with Golang 3
Get started with Python on macOS Big Sur
Get date with python
Getting Started with Numpy
Getting started with Spark
Getting Started with Python
Getting Started with Pydantic
Getting Started with Golang 4
Getting Started with Jython
A layman wants to get started with Python
[Cloud102] # 1 Get Started with Python (Part 1 Python First Steps)
Getting Started with Django 2
I tried to get started with blender python script_Part 01
I tried to get started with blender python script_Part 02
What I did to get started with Linux commands
Get country code with python
Translate Getting Started With TensorFlow
Get table dynamically with sqlalchemy
Getting Started with Python Functions
Getting Started with Tkinter 2: Buttons
Getting Started with Go Assembly
Get Twitter timeline with python
Get Youtube data with python
Get information with zabbix api
Getting Started with Python Django (4)
Getting Started with Python Django (3)
Get thread ID with python
Getting Started with Python Django (6)
Get image features with OpenCV