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.
--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
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.
--Copy the downloaded file to the above folder --You can copy it by dragging and dropping.
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.
--Start TeraTerm, specify the above COM port and press "OK".
--After connecting, go to "Settings"-> "Serial Port", set the speed to 115200 as shown below, and select "Reset current connection".
--Successful if you enter Ctrl-D on the console and the following is displayed
--The rest is executed line by line or by pressing Ctrl-E to enter paste mode, pasting the code, and then pressing Ctrl-D.
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
-Here If you build and download the built firmware.bin as a target, it will work.
Recommended Posts