-4
\$\begingroup\$

I'm trying to make working a STM32F411 stick board from Amazon.

It's not really clear how to run MicroPython program on this board, which seems to be a WeAct Black Pill V2.0 clone.

I've searched on internet but I found nothing really related excepted on MicroPython website.

One you have downloaded the appropriate DFU file it can be flashed directly to your pyboard using a DFU programmer. You can enter the DFU bootloader on the pyboard by executing machine.bootloader() at the MicroPython REPL.

But the explanation is really short, without any details.

What are the steps to create the firmware and to flash it on the board?

\$\endgroup\$
7
  • 2
    \$\begingroup\$ I’m voting to close this question because it appears to be some sort of blog post. \$\endgroup\$ Commented Sep 3 at 21:25
  • 1
    \$\begingroup\$ Regarding the so-called "blog post", it's completely unrelated. I just had a lot of difficulty programming this board, having found no comprehensive tutorial online. When I solved my problem, I just wanted to share this knowledge. \$\endgroup\$ Commented Sep 4 at 10:11
  • 1
    \$\begingroup\$ I have suppressed the blog link which has been added by another user in my answer on stackoverflow (where the question has been closed because off-topic). This is why I copy past the question and answer here (stackoverflow.com/questions/79634654/…) \$\endgroup\$ Commented Sep 4 at 10:38
  • 3
    \$\begingroup\$ I think it is a great idea to encounter a problem, figure out how to solve it, and then publish your solution in a way that helps others. However, your question as written is not particularly detailed about the problem. It may still appear to users searching for related issues, but it would be better Q&A if your question showed 1) what you were trying to do; 2) what you expected to happen; 3) what happened instead. \$\endgroup\$ Commented Sep 4 at 16:06
  • 1
    \$\begingroup\$ As far as "technical discrimination" goes, questions that are likely to help many users are generally well-regarded. Questions that are narrow in scope tend to be less so. There's no problem asking about firmware/hardware compatibility when presented well. Here, I see two potential issues: 1) Asking about installing software can a gray area because it is frequently an end-user (usage) experience, rather than an engineering (design) issue. 2) "WeAct" is extremely specific and the brand link led to a security risk warning. Does your problem occur with other STM32F4 platforms? \$\endgroup\$ Commented Sep 4 at 16:21

1 Answer 1

-2
\$\begingroup\$

First, I got troubles when connecting a board to a USB-C PC port (burn the board!), so now I use a USB-A port charger (which is only 5 V).

That's not really clear when you buy the board on the Internet, but MicroPython firmware is not installed by default on WeAct boards.

Here is how you can build and flash the firmware to make it working.

 

Prerequisites:

  • Use a PC running Linux with apt,
  • if needed install git, dfu-util and gcc-arm-none-eabi packages:

         apt install git dfu-util gcc-arm-none-eabi

 

Steps:

  1. clone the MicroPython repository: git clone https://github.com/micropython/micropython

  2. go to the boards subfolder: cd micropython/ports/stm32/boards/

  3. clone the WeAct board definition: git clone https://github.com/mcauser/WEACT_F411CEU6.git

  4. cd ..

  5. make submodules

  6. make BOARD=WEACT_F411CEU6: this should produce build-WEACT_F411CEU6/firmware.dfu file

  7. add a udev rule:

    1. sudo nano /etc/udev/rules.d/99-weact.rules

    2. set this content : SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", GROUP="plugdev", MODE="660"

  8. plug the board in and perform:

    1. press and hold the BOOT0 button

    2. press and hold the NRST button

    3. wait 0.5 seconds

    4. release the NRST button

    5. release the BOOT0 button

  9. dfu-util -l should list the board

  10. flash micropython firmware via DFU: sudo make BOARD=WEACT_F411CEU6 deploy

  11. disconnect/reconnect the USB cable, and it should work

 

How can we verify that it works?

  1. There should be a new ttyACM0 device (ls /dev/ttyA*)

  2. there should be a mounted device with some files, like main.py and boot.py

  3. when connecting to ttyACM0, you should have a REPL Python interface

 

How can we program it?

You can use, for example, Thonny IDE. See, e.g., on GitHub.

(I do not know if it's the better option as I just starting now.)

 

What's the 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) 
\$\endgroup\$
2
  • \$\begingroup\$ So nowhere it is stated that prerequisites include that you run Linux, use a distribution which uses apt, no mention of installing git or dfu-util either. I do wonder what else is missing. \$\endgroup\$ Commented Sep 3 at 21:49
  • \$\begingroup\$ @jsotola, thanks for your comment. I moved the step 5 as a prerequisite \$\endgroup\$ Commented Sep 4 at 18:44

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.