Espruino on STM32F4 discovery board

Posted on
  • Hi to all.

    I flash Espruino firmware on STM32F4 discovery board
    with success. Also I installed Virtual COM port drivers with success
    but I have problem to connect my board with Espruino Web IDE, I can't see
    COM port of my board. What is the problem?
    Thanks in advance
    BR
    IvanJ

  • I not mention that I use Win 7 64-bit.

  • Hello,

    I'm trying to flash firmware on popular "blackpill" board.
    I tried espruino_2v08_nucleof411re.bin firmware and flash via Espurino IDE.
    I event can't flash firmware ...
    Tried via UART cable, STLinkV2 and USB bootloader ... :(

    @IvanJ - how did you managed to flash firmaware?

  • Hi did you find good .bin file for microcontroler on black pill board on Espruino download list of firmvers?
    If you do/can I will be glad to describe you whole flash process I will add pictures too but you must have right firmvare aka .bin file.

  • When I mean good I mean right .bin file for this microcontroler on board.

  • I'm trying to flash firmware on popular "blackpill" board.

    Black Pill was always called this one https://stm32-base.org/boards/STM32F103C­8T6-Black-Pill.html - a variant of blue pill.

    But you most probably mean these ones - two variants STM32F401 or STM32F411
    https://www.cnx-software.com/2019/12/24/­stm32-black-pill-board-features-stm32f4-­cortex-m4-mcu-optional-spi-flash/ ? The author probably didn't know about black pill and created confusion.

    EDIT: looks like there are even more of those boards -
    Their github project https://github.com/WeActTC/MiniF4-STM32F­4x1 links to
    https://www.aliexpress.com/item/40003466­95587.html which has 3.0 boards upgraded to 96/512KB for 401. So now there are 3 variants of ram/flash sizes - 64/256 96/512 (401) 128/512 (411)

  • Hi Guys,

    1. first you need to download STM32 Cube Programmer from STM site
    2. then you need connect STM32F4 discovery board with both USB connectors
    3. if you install STM32 Cube Programmer then start it (with board plugged on both USB's)
      you will see this picture after it starts up...

    4. click Connect (upper right corner)
    5. if you are lucky you will see this picture

    6. then you click button Erasing & Programming (it is one on the left with arrow pointing hard drive or soething...) the you will see next picture

    7. click Browse and find File path to you .bin file, your firmware for board
    8. when you find it first click Full Chip Erase when it finish then click option Start programming
    9. then you need to install Virtual COM port drivers from STM site when you finish installation of
      it then find on which virtual com port is your board (my is on COM30)
    10. open Putty or similar program, and open com port after that you must see picture
      after you RESET your board

    11. write reset() command in Putty window and press Enter
    12. if you lucky you will see picture


    that it is

    note: also you need ST LINK drivers !!!

    I have problem with COM port on Espruino Web IDE, I can't connect my board with IDE

  • Which web-ide you use? There is (at least) the in-browser version at https://www.espruino.com/ide/ You need to enable web-serial, and that requires a recent chrome-based browser (for example Edge and Vivaldi does work)

    There is the Chrome web app https://chrome.google.com/webstore/detai­l/espruino-web-ide/bleoifhkdalbjfbobjack­fdifdneehpo (should work without any extra steps)

    And there is the native NWJS based app (that should also work without extra steps)

  • hi
    yes I do it but it still does not working


    image upload

  • But Native is working I am so excited!!!
    How can I upload my code to the board?

    image upload

  • I get it...this button in IDE with arrow pointing up is upload...ok
    silly me

  • Upload button in the middle!
    Or you can just type in the left side, and your code is executed right away on the Discovery board.


    1 Attachment

    • upl.png
  • Thanks!

  • I have board with STM32F411CEU6. Not sure which firmware to use -> I'm trying now with espruino_2v08_nucleof411re.bin

  • Thank you @IvanJ - I followed your steps, upload firmware via STM Cube went without any issues, installed Virtual COM, see COM7 (STMicroelectronics), but when I try to connect with putty or other terminal - there is nothing (no messages, no prompt).

    I'm currently doing all of this using UART (on PA9/PA10).
    Will try over ST-LINK ...

  • When you open Putty just press Enter on keyboard and type
    reset() and press Enter again.
    You will see...

  • but when I try to connect with putty or other terminal - there is nothing (no messages, no prompt).

    the board file for that fw is here https://github.com/espruino/Espruino/blo­b/master/boards/NUCLEOF411RE.py so it has serial console on pins a2,a3

    virtual com is feature of onboard stlink debugger on the nucleo board so it won't work for your WeAct blackpill board, unless you have external stlink with virtual com too and connect it to pins a2,a3

  • Also, the Nucleo and Espruino boards (Original, Pico and Wifi) have an 8MHz xtal, the WeAct has a 25MHz, so the crystal frequency has to be changed / build tweaked.

  • Had this board in drawer somewhere, haven't used it yet. So I took it, soldered SWD pins, flashed the nucleo fw and indeed it doesn't work, nothing on a2/a3. Then made a build of micropython from https://github.com/mcauser/WEACT_F411CEU­6 and that one works fine so board is OK.

    Then I tried to change timing as per this and it almost worked - the blue led was on after poweron. Took some time to enable USB too but now it sort of works. What doesn't work is setting button and LED as inverted. There is example in NUCLEO411 board file but it does nothing for me. So led is still on and LED1.set() turns it off and for button I need to manually enable pullup and then it works but is still inverted.

    board file
    https://gist.github.com/fanoush/7553104f­a7c8c596fe91f276d3f297fd
    clock frequency patch
    https://gist.github.com/fanoush/db80e8b5­e78f217036cb4fc91fed7b6a
    binary
    https://filebin.ca/5eJ1Xo9M3VQG/espruino­_2v08.5_weact_f411ceu6.bin

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Espruino on STM32F4 discovery board

Posted by Avatar for IvanJ @IvanJ

Actions