It's not really clear how to install MicroPython on WeAct boards. This might help
Answer
First I got troubles when connecting board to usb-C PC port (burn the board !), so now I use USB-A port (which is only 5V).
That's not really clear when you buy the board on internet, but microPython firmware is not installed by default on WeAct boards.
Steps :
clone micropython repository :
git clone https://github.com/micropython/micropython
go to boards subfolder :
cd micropython/ports/stm32/boards/
clone WeAct board definition :
git clone https://github.com/mcauser/WEACT_F411CEU6.git
cd ..
install gcc-arm :
apt install gcc-arm-none-eabi
make submodules
make BOARD=WEACT_F411CEU6
: this should producebuild-WEACT_F411CEU6/firmware.dfu
fileadd udev rule :
sudo nano /etc/udev/rules.d/99-weact.rules
set this content :
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", GROUP="plugdev", MODE="660"
plug the board in and perform :
press and hold BOOT0 button
press and hold NRST button
wait 0.5s
release NRST button
release BOOT0 button
dfu-util -l
should list the boardflash micropython firmware via DFU :
sudo make BOARD=WEACT_F411CEU6 deploy
unconnect/reconnect usb cable => it should work
.
How to verify that it works ?
There should be a new
ttyACM0
device (ls /dev/ttyA*
)there should be a mounted device with some files like
main.py
andboot.py
when connecting to
ttyACM0
, you should have REPL python interface
.
How to program ?
You can use for example Thonny IDE :
https://github.com/thonny/thonny/wiki/MicroPython
(do not know if it's the better option as I just starting now)
.
What's blinky program ?
from pyb import LED
import time
led = LED(1)
while True:
led.on()
time.sleep(0.25)
led.off()
time.sleep(0.5)
.
Hope it will help !