STM32F411 / Bootloaders / Mecrisp Forth / Blackpill

Поделиться
HTML-код
  • Опубликовано: 14 окт 2024
  • This video will introduce the STM32F411 Arm microcontroller and the operation of the three on-board bootloaders. Description of the pin out and control push-buttons will also be covered. The STM32F411 is a Cortex M4 microcontroller which is a step up from the familiar Bluepill.
    Mecrisp documentation:
    mecrisp-stella...
    Mecrisp download file:
    sourceforge.ne...
    Universal-solder STM32F411
    www.universal-...

Комментарии • 104

  • @darinwhite5475
    @darinwhite5475 4 года назад +9

    Great vid. Particularly helpful how you distinguished the 3 ways to upload code. That was baffling when I was getting started with the blue pill. Thanks for sharing.

  • @diggleboy
    @diggleboy 4 года назад +1

    Clear, concise and to the point on the STM32 ARM Cortex M4 microcontroller with various programming and debugging options. You've helped me make an easy decision on which microcontroller platform to choose when developing embedded applications for my clients. Thanks for your hard work and your video.

    • @0033mer
      @0033mer  4 года назад +1

      You're welcome! Thanks for the feedback.

  • @rene-jeanmercier6517
    @rene-jeanmercier6517 4 года назад +7

    Excellent and much educative video. I use the STLINK myself.

  • @jkd2377
    @jkd2377 4 года назад +4

    Thank you for your clear, concise, and useful instructions!

    • @0033mer
      @0033mer  4 года назад +1

      You're welcome.

  • @roysutton577
    @roysutton577 7 месяцев назад

    Great video and I have had the parts for years. One tip - never use a pencil as a pointer as you will have high impedance leakages.

  • @PeterForth
    @PeterForth 4 года назад +1

    Thank you very much 0033mer another great forth video. A great thanks to Matthias Koch outstanding creation. Mecrisp is a lighthouse in the dark, and beats all commercial forths.

  • @miltoneduardososa378
    @miltoneduardososa378 3 года назад

    I would like to congratulate you and say thanks for sharing your knowledge in such a clear way!

    • @0033mer
      @0033mer  3 года назад

      I appreciate that!

    • @miltoneduardososa378
      @miltoneduardososa378 3 года назад

      @@0033mer I have an idea for a video after watching this one for 6 times. lol
      What do you think about using this black pill board hooked to an RN487x serial bluetooth module to perform OTA firmware updates using flash loader method (USART1 on pins A9 & A10)?
      In order to also be able to remotely make the device go into bootloader mode without any human interaction on buttons BOOT0 & NRST, you could replace the buttons or add a transistor or a load switch controlled by the GPIOs present on the bluetooth module. You could control the status of both buttons remotely by means of AT commands and independently from the microcontroller.
      Something similar has been made for arduino. However, the HM-10 consumes relatively high current when it goes into "sleep"
      github.com/MEming/Device-Firmware-Update-OTA-Bluetooth-Low-Energy
      What do you think?

    • @0033mer
      @0033mer  3 года назад +1

      To simplify OTA programming on any microcontroller I use Forth as my programming language. The Forth operating system enables you not only to upgrade code but to also upgrade the compiler as the code is running. NASA has used this technique for OTA programming on their space probes millions of miles away.
      www.forth.com/resources/space-applications/
      Check out my video where I use this technique on the Arduino Nano.
      ruclips.net/video/vMC_LMmtFac/видео.html
      To increase range you can use LoRa instead of Bluetooth.
      ruclips.net/video/V2mopznhELE/видео.html

    • @miltoneduardososa378
      @miltoneduardososa378 3 года назад

      @@0033mer Cool forth video! I haven't used it so far.
      I am using Micropython, and by following the approach that I proposed above, I would be able to just update the internal ".py" files or update the whole interpreter remotely.
      My application in particular is already using a lora module to interace with a LoRaWAN network, I thought a BLE module would bring OTA promaming, as well as Debugging through the terminal.
      Additionally, I think it worth mentioning that the node will physically located up on a mast that is part of the power distribution network.

  • @ivand8393
    @ivand8393 4 года назад +1

    Nice video! If I may, I would recommend to upgrade to 2.5.3!. And for serial communication I think "folie" is more handy.

  • @alexanderwolfe8782
    @alexanderwolfe8782 4 года назад

    Amazing video! WeAct (original designer of this board) should be linking this on all their store pages.
    MicroPython on this board is a lot of fun too, editing main.py directly through the USB mass storage interface is luxurious.

    • @0033mer
      @0033mer  4 года назад +1

      Yes .. that is a nice feature. I am running Micropython on a Discovery board STM32F407.
      ruclips.net/video/a_G3WqjfPBA/видео.html

  • @fano72
    @fano72 Месяц назад

    I love my black pill since it is a powerful all purpose machine.

  • @diyguild1327
    @diyguild1327 2 года назад

    Great tutorial, got me to ditch the AVR platform for ARM. Really good info, really appreciate the work you put into this. Have a question though, what's the cap going from 3.3v to ground?

    • @0033mer
      @0033mer  2 года назад

      10uf cap on the 3.3v line for a bit of filtering.

  • @ZacCrawforth
    @ZacCrawforth 3 года назад +1

    Sweet! I picked up a 3-pack of Blackpills, and am having a blast with Forth! (Haven't used it since the C64's Blazin' Forth!)
    One question, though... How did you get the MCU to 100mhz mode? When I run the command from the Mecrisp folder (100mhz.fs) the thing hangs so hard that even STM32Cube loses connectivity to it.

    • @0033mer
      @0033mer  3 года назад +1

      100mhz.fs was written for the STM Nucleo board where the HSE clock is 8 Mhz. Blackpill has a 25 MHz HSE clock. To program the PLL divider properly change the line of code:
      8 0 lshift or ---> 25 0 lshift or

    • @ZacCrawforth
      @ZacCrawforth 3 года назад

      @@0033mer Woohoo! That worked - thanks!

  • @mdistiackahamed3712
    @mdistiackahamed3712 Год назад

    Thanks for the video. You came like an angel

  • @brandonsalazar8006
    @brandonsalazar8006 3 года назад +1

    Your work is outstanding, I'm an inventor and I am stumped with this semi simple circuit, I was wondering if you could help me.

  • @rompipelotas
    @rompipelotas 2 года назад +1

    very clear explanation,,,,,,,,but......how do you enable the external memory soldered on the pads of the board and where to go to enable it ??

    • @0033mer
      @0033mer  2 года назад +2

      The external memory is SPI flash and is used like any SPI device. Check the schematic for the pins that are used for the SPI port and the data sheet for programming.
      www.adafruit.com/product/4763

    • @rompipelotas
      @rompipelotas 2 года назад +1

      @@0033mer thanks a lot dear !!!!!

  • @fzelders
    @fzelders 9 дней назад

    The mecrisp words .mode , port.a , config? etc are not available in the vocabulary of Mecrisp-Stellaris 2.6.5 . 😞
    Do these words reside in a special vocabulary ?

  • @randallyoung9411
    @randallyoung9411 4 года назад

    Thanks for posting, just what I needed today ...

  • @alansailing1387
    @alansailing1387 Месяц назад

    I'm fine until 7:05 where it says Available DFU devices, which is blank. Windows Device Manager shows a STM32 BOOTLOADER under Universal Serial Bus Devices. I have been able to install and run the blink program using the Arduino IDE so I expect the board and the cable are good.

    • @0033mer
      @0033mer  Месяц назад

      Yes, DFUSE can be hit and miss. On reset the micro runs on the HSI 16 mHz RC clock. The PLL multiplies it to 48 mHz for USB operation. This clock is temperature dependant and may drift which will affect the operation of the USB port. You can play with the HSITRIM register ( 0 - 35 ) and configure a GPIO pin for MCO output and calibrate the 16 mHz clock and save the TRIM value to flash or use CRS Clock Recovery System for autotrim. Check online for more info.
      In the meantime use the reliable SWD and dongle method.

  • @adamschrempf
    @adamschrempf 6 месяцев назад

    Hi
    I need help.
    I have a stm32f chip with 48 legs.
    Leg 44 is the boot where I should give it 3.3V. But which side is the 44th leg? I can't find a description of this anywhere.

    • @0033mer
      @0033mer  6 месяцев назад +1

      When orientated so you can read the part number, pin 1 will be at the bottom left. There should be a dot in that location.
      To double check, all VSS pins (Gnd) are connected together and are in the same location on each side except for the side with pin 1. With an Ohmmeter and the pinout from the datasheet you confirm pin 1 then count around to the desired pin number.

  • @bill392
    @bill392 2 года назад

    Very helpful vid, thanks! Is there any way to use UART6 ?? The STM32F411CEU6 datasheet shows that there is a UART6 but the pins are shared with USB so I don't know how to use UART6. I have a project where I'd like to use all three hardware UARTs if possible.

    • @0033mer
      @0033mer  2 года назад

      If you are not using the USB port you can set pins PA11/12 as UART6. UART6 is also on pins PC6/7 but is not brought out on the module. If you go to the Nucleo F11RE board you can access UART6.

    • @bill392
      @bill392 2 года назад

      @@0033mer Thanks for the very useful info and informed response. I really appreciate it. I bought myself a Nucleo-401 demo board as well as BlackPill to play with so I should be good to go. Installing the USB bootloader was a great idea because it gets you away from the boot pin manipulation. I prefer to build projects where the user just plugs in the USB and can invoke the bootloader with a simple power reset. Super useful. Using STLink via SWD port wipes out the user bootloader but it doesn't matter during code dev anyway, just reinstall the BL at the end and BL in the finished app. I've been doing that with PIC devices forever so the workflow is the same in that respect. I want to design STM32F411RE (64-tqfp) onto my own custom PCBs but I can't seem to buy the raw chips anywhere (global shortage?) so instead I'm buying the cheap devboards to get by. A nice advantage of the very common serial bootloaders going through an FTDI USB-to-UART converter is that you can route the FTDI /DTR pin to drive the MCU reset pin and if your PC side host downloader supports DTR then it'll reset the MCU for you. That way the user doesn't even have to reset the power to download at any time. I've been doing that with PICs too. After 28 years of working almost exclusively with PICs, I'm now trying to move to STM32 (maybe later ATSAM too) to take advantage of the inexpensive STLink programmer/debugger (ICD3/4 cost $100s) and free software and compiler. Microchip wants $1000 per year for each of 3 compilers (XC8/16/32) which is a ripoff. Also, since ATM32 is now supported by Arduino, Python, C/C++ all for free, the choice is obvious.

  • @MichaelKingsfordGray
    @MichaelKingsfordGray 2 года назад

    Of course, the Raspberry Pico has wiped this off the table.
    And it can run Forth, and BASIC.

  • @egehanceylan8429
    @egehanceylan8429 10 месяцев назад

    I am using the STM32F411 processor and I could not find any data on the boot time. Could you guys help please?

  • @hssnov
    @hssnov 3 года назад

    thank you. I tried to follow your steps. I uploaded the forth OS using FTDI programmer with pin A10, A9. however I am not able to communicate with forth via tera term I used pins A2, A3 it works when I do reset it shows the massages and the "ok. " massage. but I cannot see the pins and stuff like this... can someone help thank you..

  • @crb1crb239
    @crb1crb239 4 года назад

    can this be used with stm32cubeIDE...??please maybe provide a small led_blink video with cudbe ide....thank you

  • @UpcycleElectronics
    @UpcycleElectronics 4 года назад

    What are your thoughts on the more complicated terminal shells for embedded Forth? What level of complexity is useful/required for real world projects? I tried to build a parallel memory chip programmer with flash forth, and have spent lots of time learning python as a result. Passing blocks of binary information with a terminal that was not written to be extensible is hard. Now I am aware terminal quality is an important factor with a forth system. Any thoughts on the subject from a more forthward user?

    • @0033mer
      @0033mer  4 года назад

      Python has a lot more features and is much bigger than Flashforth so in your case it may be easier to get a project up and running using Python. Forth programmers usually write their own tools by extending the compiler and basically creating their own language. Back in 1987 Dataman introduced the Dataman S4 emulator/programmer which was an embedded FORTH product which became very popular. www.aliexpress.com/item/4000073336339.html

    • @UpcycleElectronics
      @UpcycleElectronics 4 года назад

      @@0033mer
      Yeah, the more extended (embedded) forth's I've come across are, MyForth and AMForth. MyForth looks like a bottomless rabbit hole I probably won't try.
      www.kiblerelectronics.com/myf/myf.shtml
      IIRC it is the only flavor I've seen that uses Forth for both sides of the embedded toolchain. I mean, the terminal emulator is written in GForth, so it's a forth system on both the host and client.
      I also looked into AMForth's shell code after a couple of emails with Mike (FF's auth). AMForth has a large level of integration between it's python based terminal shell(host) and embedded-forth(client).
      I wasn't talking about using python to program the μC though. I needed to use python just to modify the terminal to send and receive the binaries. Maybe the miscommunication is due to our different choices of OS. With Linux and a python based terminal script, modifying the terminal is easier than Flash Forth, at least as far as changing how forth sends and receives larger files. FF's python shell has no ability to receive and write the contents to a file. My other issue is that I don't like having to mess with the MPLabX side of Flash Forth. I don't want to recompile the base system for a PIC μC unless I have too. So, I think FF was probably the wrong choice as my first forth system to learn with.
      Mike's choice to lock out users from redefining words in Flash Forth really makes it difficult to follow Brodie's books after about half way in. Plus, I only recently found Peter's full documentation and repositories for his 2 flash forth pdf guides. There are a few differences between the version of the software Mike has on sourceforge and Peter's. Using Mike's version and his included libraries makes around 1/3rd of Peter's 5 page guide disfunctional. It's been a fun learning experience though.
      I'll be trying some other forth flavors soon. I have a MSP430F149 minimum dev board, on order, to try NoForth, and the STM32F4xx's to try with mecrisp.
      Have you seen any other interesting forth flavors to try?
      If you haven't seen it, Chuck is working on a forth that he has running on a current x86 intel i7 and is working on running it natively. He did a presentation a few months ago for the Sili. Valley FIG. It's on their YT channel :-)
      -Jake

  • @manofmesopotamia7602
    @manofmesopotamia7602 4 года назад +1

    Great video 👍

  • @francoisp3625
    @francoisp3625 4 года назад

    Thank you for that vidéo and explanations

  • @M0XYM
    @M0XYM 4 года назад +1

    Appreciated.

  • @blahman442
    @blahman442 3 года назад

    I connected the stlink and stm32f411. It does not connect. Any help?

  • @sanelleric8875
    @sanelleric8875 3 года назад

    Thanks a lot. Great content!

    • @0033mer
      @0033mer  3 года назад

      You're welcome.

  • @robertparenton7470
    @robertparenton7470 3 года назад

    Thank You!

    • @0033mer
      @0033mer  3 года назад

      You're welcome!

  • @UndernetSystems
    @UndernetSystems 4 года назад

    Very good video brother.

  • @micromouseonline
    @micromouseonline 4 года назад

    Hi. I would love to make this work but I just tried it out and after the flashing of the target, my serial monitor just receives never ending messages "Unhandled Interrupt 00000003 !"
    The file I downloaded was mecrisp-stellaris-2.5.2.tar.gz.
    Once unpacked, the image I flashed to the board was mecrisp-stellaris-stm32f411.bin
    My target board is the WeAct V3.0 STM32F411 blackpill but without the SPI Flash chip.
    Do you have any sggestions?

    • @0033mer
      @0033mer  4 года назад

      Select "Erase Chip" and do a Blank Check first, then try reloading the .bin file.

    • @micromouseonline
      @micromouseonline 4 года назад

      @@0033mer Thank you. Sorted! Just need to learn how to upload Forth programs now. The 'standard' image as downloaded does not seem to have the extras that are in your demo. Do you have an image for that?

    • @0033mer
      @0033mer  4 года назад

      When you start programming in Forth it becomes your own when you create lots of words. Start out simple with a Blink LED program and go from there. Check out the Mecrisp documentation: sourceforge.net/projects/mecrisp-stellaris-folkdoc/files/MecrispStellarisUnofficial.epub/download

  • @tT-vs7ed
    @tT-vs7ed 2 года назад

    Can anyone help me? , I'm Using USB method, but when I plug in my W10 system isn't recognising board. It says USB device not recognised when I pressed Boot mode in PCB. Any extra circuit needed in dfu mode or USB is enough? Please guide me.

  • @PerchEagle
    @PerchEagle Год назад

    Couldn't find the device in dfuse demo. I by mistake erased the bootloader came with the board in the STM32CubeProgrammer. Is there any method to get the original bootloader ?

    • @0033mer
      @0033mer  Год назад

      The three bootloaders are factory installed into the microcontroller and cannot be erased.

    • @PerchEagle
      @PerchEagle Год назад

      @@0033mer But I think I erased everything using STM32CubeProgrammer, before I was able to program it with Arduino IDE using SWD, but now I can't and only with STM32CubeProgrammer.

    • @PerchEagle
      @PerchEagle Год назад

      @@0033mer Also I can't use dfuse. I installed it and tried to get it to connect but it's not appearing on the com port.

    • @0033mer
      @0033mer  Год назад +1

      Check out STM32duino when using the Arduino IDE with STM32 boards.
      www.mischianti.org/2022/06/09/stm32-programming-stm32f1-via-usb-with-stm32duino-boot-loader-2/

    • @PerchEagle
      @PerchEagle Год назад

      @@0033mer The bootloader is for the STM321, does it work for the STM32F4 ?

  • @avr_stm_pro2955
    @avr_stm_pro2955 2 года назад

    Спасибо 👍

    • @0033mer
      @0033mer  2 года назад +1

      You're welcome!

  • @mayda4th
    @mayda4th 3 года назад

    great, thank you!

    • @0033mer
      @0033mer  3 года назад

      You are welcome!

  • @St0RM33
    @St0RM33 4 года назад

    Is there an arduino style bootloader that you can use for this board?

    • @0033mer
      @0033mer  4 года назад +1

      Search online for STM32duino.
      github.com/stm32duino/wiki/wiki/Getting-Started

    • @St0RM33
      @St0RM33 4 года назад

      @@0033mer Thanks a lot. I've noticed that one as well as others but i'm unsure what to go with. I've order 2 of these boards yesterday so i can move my project from teensy 3.2 since those have a locked (closed source) bootloader and i want to minimize the cost of my project. The reason of having an arduino style bootloaded is that the end user will not have access to reset buttons and they may want to upgrade their firmware via the usb port. So it needs to be easy and needs to be done from the same usb port that the device is connected. Btw, great video. I found the original designer that made this project and has all the info here: github.com/WeActTC/MiniF4-STM32F4x1

  • @kendewey5547
    @kendewey5547 4 года назад

    I have Mercrisp forth running but need to upload a forth application to the micro. When i paste it into the terminal I get a lot of error. I would like to do it like tachyon forth.

    • @0033mer
      @0033mer  4 года назад +1

      You are probably uploading text too quickly. Set a delay for characters and end of line in your serial terminal software. I use 5 msec/char and 90 msec/line delays.

    • @abpccpba
      @abpccpba 3 года назад

      @@0033mer Your delay numbers sure did help; sure will speed me up. : = ))

  • @kenkankan
    @kenkankan 4 года назад

    Thanks for your instruction and I can write forth to my F411 but when following your commands in the video, none of them are working such as mode, port.a etc. I also cannot find those commands in the mecrisp-stellaris-folkdoc.sourceforge.io/words.html#forth-definition-components too. Did I miss anything ?

    • @0033mer
      @0033mer  4 года назад

      When you program in Forth it becomes your own as you make up lots of words. I make up words as I go along so they won't be in the original dictionary. Check out the Mecrisp docs for GPIO manipulation. sourceforge.net/projects/mecrisp-stellaris-folkdoc/files/MecrispStellarisUnofficial.epub/download

    • @kenkankan
      @kenkankan 4 года назад

      @@0033mer Thanks as I am new to Forth and working on MCU with micropython. Thanks for your advice. Let me check again.

  • @chuckcrizer
    @chuckcrizer 4 года назад

    Where can we get these boards? I'm not having much luck searching for them with the F4.

    • @0033mer
      @0033mer  4 года назад

      Aliexpress has the best price but delivery time could be long.
      You can also get them here:
      www.universal-solder.ca/product/stm32-black-pill-weact-v2-0-stm32f411ceu6-100mhz-512kb-flash-128kb-ram/

  • @cgmarch2359
    @cgmarch2359 2 года назад

    So whatever we type in forth serial con remains in flash even after power cycle / reset?

    • @0033mer
      @0033mer  2 года назад

      Yes, in compiletoflash mode all words programmed in Forth will be saved in flash.

    • @cgmarch2359
      @cgmarch2359 2 года назад

      Thank you for reply. And kudos for all the videos you uploaded so far ! I love short and to the point content :)

  • @辛孤达
    @辛孤达 3 года назад

    what's the usb port on the board used for?Can it used for downloading?

  • @macharlaprasad3064
    @macharlaprasad3064 2 года назад

    What is the tools used

  • @caffeinatedinsanity2324
    @caffeinatedinsanity2324 3 года назад

    Don't the F411 come with a USB bootloader?

    • @0033mer
      @0033mer  3 года назад

      Yes ... DFU boot-loader at 2:26

  • @makermawa5750
    @makermawa5750 3 года назад +1

    THANKYOU MAWA......U R LIKE OIASIS IN DESART....!

    • @0033mer
      @0033mer  3 года назад

      You're welcome!

  • @lshootphotography7250
    @lshootphotography7250 2 года назад

    WeAct_HID_Flash w
    how to use help me

  • @gotj
    @gotj 4 года назад

    👍

  • @kendewey5547
    @kendewey5547 4 года назад

    Is there a upload file fir mercrisp forth and how to install

    • @0033mer
      @0033mer  4 года назад

      Here is a link to the documentation page:
      mecrisp-stellaris-folkdoc.sourceforge.io/
      Here is a link where you can download Mecrisp:
      sourceforge.net/projects/mecrisp/files/

  • @marcelocorrea7916
    @marcelocorrea7916 4 года назад

    Any way to get into forth via USB?

    • @0033mer
      @0033mer  4 года назад

      No .. the USB is only for power and DFU bootloader.

  • @ajaybnl
    @ajaybnl 4 года назад

    What is 4th programming language and 4th os

    • @0033mer
      @0033mer  4 года назад

      Check out these links:
      www.forth.com/forth/
      en.wikipedia.org/wiki/Forth_(programming_language)

    • @gustinian
      @gustinian 4 года назад +2

      Shh... 'the best kept secret in programing' can't be divulged to just anyone!
      Seriously, Forth is simple, efficient, expressive, fast and tiny - a compelling alternative to more prevalent languages like C. Mecrisp Stellaris is an excellent up-to-the-minute flavour of Forth. 'Starting Forth' is the classic beginners text.
      I wish I'd discovered it sooner.

    • @chuckcrizer
      @chuckcrizer 4 года назад

      First thing is to realize it is "FORTH", not "4th". Lots of data on the webs.

  • @lijomathew3242
    @lijomathew3242 2 года назад

    My bord usb not dictecting divise maneger

    • @0033mer
      @0033mer  2 года назад

      Check that you loaded the correct drivers.

  • @a-job7276
    @a-job7276 4 года назад +1

    github.com/WeActTC ¿what the hell is WeAct? Supposedly they designed the PCB, what I'm not sure about is the bootloader. There is currently version 2.2 of the PCB

  • @wildanfirdaus3559
    @wildanfirdaus3559 Год назад

    pas bahasa inggri deremmah se ngarteah