Elektroda.com
Elektroda.com
X

STM32 Blue Pill - an alternative to Arduino

ghost666 14745 58
This content has been translated flag-pl » flag-en View the original version here.
  • #31
    khoam
    Level 42  
    rs6000 wrote:
    I asked for a board with STM working with Arduino, not bare uC.

    Just type "arduino nucleo" in the ali search engine :)
  • #32
    Slawek K.
    Level 35  
    Thanks ;)
    A terrible price, it will not pay off ;)

    Greetings
  • #33
    LChucki
    Level 31  
    rs6000 wrote:
    A terrible price, it will not pay off

    Compare the price and possibilities of this "expensive" to "cheap" Mega2560.
    Take into account that "expensive" has a programmer / debugger. How much is the debugger for "cheap" Mega2560 and Mega328?
  • #34
    khoam
    Level 42  
    rs6000 wrote:
    A terrible price, it will not pay off

    You can always use ESP32, but it only has two 8-bit DACs.
  • #35
    Slawek K.
    Level 35  
    LChucki wrote:
    rs6000 wrote:
    A terrible price, it will not pay off

    Compare the price and possibilities of this "expensive" to "cheap" Mega2560.
    Take into account that the "expensive" has a programmer / debugger. How much is the debugger for "cheap" Mega2560 and Mega328?

    You think $ 20 is cheap? because I don't. As you already compare to AVR, the mythical mega2560 costs $ 6 (and this is in the small-size version of the PRO board), and I am not going into discussions about the superiority of Christmas, but I would like to remind you how much it really costs because you commonly use this argument ;)

    khoam wrote:
    rs6000 wrote:
    A terrible price, it will not pay off

    You can always use ESP32, but it only has two 8-bit DACs.

    I change successively from esp8266 to esp32, I like the "meat" ;)

    Greetings
  • #36
    Janusz_kk
    Level 37  
    rs6000 wrote:
    I asked for a board with STM working with Arduino, not bare uC.

    There are boards for atxmega, where you have a Dac and USB programming via flip, I have a few boards myself
    on atxmega128A3, extronics did that too.
  • #37
    LChucki
    Level 31  
    rs6000 wrote:
    LChucki wrote:
    rs6000 wrote:
    A terrible price, it will not pay off

    Compare the price and possibilities of this "expensive" to "cheap" Mega2560.
    Take into account that "expensive" has a programmer / debugger. How much is the debugger for "cheap" Mega2560 and Mega328?

    You think $ 20 is cheap? because I don't. As you already compare to the AVR, the mythical mega2560 costs $ 6 (and it's in a small-size version of the PRO board)

    - ORIGINAL F103 https://kamami.pl/stm-nucleo-64/212017-nucleo-f103rb-set-startowy-z-mikrokontrolerem-z-rodzin-stm32-stm32f103.html?search_query=nucleo+f103&results=1 PLN 56 z DEBUGER!
    - Original WITHOUT DEBUGER Mega2560 https://kamami.pl/arduino-oryginalne-plytki/198324-arduino-mega2560-rev3-a000067-plytka-z-mikrokontrolerem-atmega2560.html?search_query=mega2560&results=13 179zł
    - Travel Mega2560 https://kamami.pl/plytki-zgodne-z-arduino-inne/138384-arduino-mega2560-r3-odpowiednik-plytka-z-mikrokontrolerem-atmega2560.html?search_query=mega2560&results=13 PLN 46 of course WITHOUT DEBUGERA

    Please, give a similar comparison, because you are comparing the trips with the originals, from different sources, tiles WITHOUT DEBUGER with boards with a debugger. Since the board does not have a debugger, add its price to the comparison.
  • #38
    ostrytomasz
    Level 23  
    fotomh-s wrote:
    Although, by the way, no one defends commercial programming on Arduino, since it is open source ...


    The LGPL license for arduino core excludes, at least for me, the possibility of commercial use. Providing the end user with the ability to relink is too much of a hassle, if at all possible with the arduino IDE. For this libraries and components under various licenses, including GPL bootloaders.
    http://forum.arduino.cc/index.php?topic=240434.0
  • #39
    Slawek K.
    Level 35  
    LChucki wrote:
    rs6000 wrote:
    LChucki wrote:
    rs6000 wrote:
    A terrible price, it will not pay off

    Compare the price and possibilities of this "expensive" to "cheap" Mega2560.
    Take into account that "expensive" has a programmer / debugger. How much is the debugger for "cheap" Mega2560 and Mega328?

    You think $ 20 is cheap? because I don't. As you already compare to AVR, the mythical mega2560 costs $ 6 (and this is in the small-size version of the PRO board)

    - ORIGINAL F103 https://kamami.pl/stm-nucleo-64/212017-nucleo-f103rb-set-startowy-z-mikrokontrolerem-z-rodzin-stm32-stm32f103.html?search_query=nucleo+f103&results=1 PLN 56 z DEBUGER!
    - Original WITHOUT DEBUGER Mega2560 https://kamami.pl/arduino-oryginalne-plytki/198324-arduino-mega2560-rev3-a000067-plytka-z-mikrokontrolerem-atmega2560.html?search_query=mega2560&results=13 179zł
    - Travel Mega2560 https://kamami.pl/plytki-zgodne-z-arduino-inne/138384-arduino-mega2560-r3-odpowiednik-plytka-z-mikrokontrolerem-atmega2560.html?search_query=mega2560&results=13 PLN 46 of course WITHOUT DEBUGERA

    Please, give a similar comparison, because you are comparing the trips with the originals, from different sources, tiles WITHOUT DEBUGER with boards with a debugger. Since the board does not have a debugger, add its price to the comparison.

    It's as if you were comparing apples to pears, read at least once what we're talking about, if you don't understand it I'll be happy to tell you, for sure not about STM32F103RBT6 because this one has no DAC.

    Greetings
  • #40
    fotomh-s
    Level 24  
    Their friends have plates on the M4 core for
  • #41
    LChucki
    Level 31  
    rs6000 wrote:
    oh, as if you were comparing apples with pears, read what I am talking about once, if you do not understand it, I will gladly tell you, certainly not about the STM32F103RBT6 because this one does not have a DAC.

    If you have a problem with using STMCUFinder, I can't help it.
  • #42
    Slawek K.
    Level 35  
    Since you do not understand, maybe I will write more simply, can you give a link to the board with STM32 with DAC supported in Arduino? I would like to check the price, this is what is mentioned on the previous page ;)


    Greetings
  • #45
    khoam
    Level 42  
    fotomh-s wrote:
    I do not know if the regulations allow you to put such links, but I will take the risk: https://www.aliexpress.com/item/ShengYang-STM32F407VET6-development-board-Cortex-M4-STM32-minimum-system-learning-board-ARM-core- board / 32911136482.html
    ZTCP supported by STM32duino (this chip is on their wiki), has a 2x12bit DAC.


    Description from the stm32duino website: Link

    The Arduino HAL supports the DAC: Link
  • #46
    Slawek K.
    Level 35  
    Well, it looks great, I have to buy it for testing ;)

    Greetings
  • #47
    fotomh-s
    Level 24  
    I think it's a good price / performance ratio. If you use an extended instruction set, a multitude of pins, DAC, micro SD, additional FLASH memory on the board, or you simply run smaller programs from RAM so as not to get a flash ;-) By the way, it's interesting what the Chinese will declare the value of this tile. I currently have 2 ali orders behind me and they have always underestimated even this tile for $ 2. Thanks to this, the UC did not get stuck and the parcels arrived without any problems or additional costs.
  • #48
    wicy
    Level 22  
    I'm trying to get through this tutorial, but ...
    ghost666 wrote:

    We also set the highest jumper on the module with STM32 in the right position. We can now connect the converter to the USB port on the computer.

    Which is the "topmost jumper" ??
  • #49
    tronics
    Level 38  
    This jumper is BOOT0, it puts the STM32 into factory UART bootloader mode.
  • #50
    MVictor
    Level 10  
    Hello!
    I am a total beginner in MC. I want to add to the Arduino IDE stm32 Blue Pill, according to the description provided here, unfortunately in the preferences it adds (I type manually, I can't paste) the link here: http://dan.drawn.org/stm32duino?..... etc. I get a "download error" message.
    I don't know what I'm doing wrong. Is there any other way to add this board to the Arduino IDE?
    I will be grateful for your response.
    Regards.
  • #51
    rb401
    Level 38  
    MVictor wrote:
    I want to add to the Arduino IDE stm32 Blue Pill, as described here


    The description at the beginning of this thread is no longer valid. At the moment, the handling of STM32 boards is much richer and, above all, officially supported by the STM company. The server that was indicated at the beginning of the thread to add to the preferences is currently turned off and your Arduino has no way to download these tiles.
    To download STM32 support you have to add another address to your preferences (you can remove this old address "http: //dan.drawn.org ..."):
    Code: text
    Log in, to see the code


    and then what you need will pop up in the tile manager:

    STM32 Blue Pill - an alternative to Arduino

    Here is the current, official installation description for STM32 boards:

    https://github.com/stm32duino/wiki/wiki/Getting-Started
  • #52
    MVictor
    Level 10  
    Hello!
    "rb401" - thank you for comprehensive and specific information!
    Installation went smoothly.
    It's a lot for me, because I spent two days trying to install stm. I looked at a lot of tutorials and videos on YT, and they all referenced this broken address.
    And I will say as in the ad: "I did not know there was such a simple solution"!
    Thank you.
  • #53
    MVictor
    Level 10  
    Hello colleagues!
    Once upon a time, I got very constructive help in this forum regarding STM32.
    I mark I'm "green" in the subject of this MC. For several days I have been struggling with uploading the bootloader to the Blue Pill STM32F103C8T6 board. Unfortunately, the tutorials found on the web did not help me much.
    Somehow (?) I was able to install the bootloader to my MC. It looks like the Blink arduino IDE is working. Receives a jakk message on an attached .jpg.
    Therefore, I have a question for colleagues who are familiar with this topic: is everything ok. And can I assume that the bootloader installation was successful?
    I would be grateful for a constructive reply and possible suggestions.
    STM32 Blue Pill - an alternative to Arduino
  • #54
    rb401
    Level 38  
    MVictor wrote:
    Somehow (?) I was able to install the bootloader to my MC. It looks like the Blink arduino IDE is working.



    You did not write how you connect Blue Pill to the computer during programming, because there are several options.
    It is true that I am not able to recreate your situation with me, because I personally do not care what is uploaded to Blue Pill at the time of purchase (I program via STlink) and if there was something, it is erased for me. But it seems to me that you did not manage to install the bootlader, but simply that bootloader was already uploaded by the manufacturer of the board.


    Generally, for all STM32 cubes, there are three methods of saving the program to the flash memory.

    Via SWD (or JTAG) signals with the help of a special programmer, most often it is STlink. In this method there is full control of the cube, plus other possibilities like debugger etc.

    The second method is to use the factory-installed (by the manufacturer of the cube) bootloader. It is located in each STM32 cube and is placed outside the flash memory (in the so-called system memory), and it is not erasable. However, to run it, before resetting the cube, set the appropriate states on the BOOT pins (these two jumpers on the Blue Pill are used for this) and after programming, return to the start settings from the flash program. This bootloader offers a different set of connection methods, depending on the type of the cube, e.g. via UART (most often), USB, CAN, I2C, etc. In the case of STM32F103C8T6 specifically, there is no USB support through this bootloader. But you can via UART.

    The third method is to save the flash memory with the help of a program previously loaded into the flash. So they are mostly different bootloaders, which, however, must first be loaded into the flash memory using one of the above methods.

    Each of these methods has a different programming support. But Arduino provides support for these three methods. However, in the case of the third, loaded bootloader, the support applies to specific variants of the bootloaders.


    So, going back to your experience and assuming that you connected Bluepill with a USB cable to your computer (and not a STlink or USB-serial adapter), you had to have previously uploaded the bootloader in the flash memory, because without it you would not be able to upload anything.
    But if that was the case, it was only a matter of courtesy of the manufacturer of the tile that he uploaded it. If you are ready to go deeper into the topic of STM32, including programming new cubes, I recommend getting STlink.
  • #55
    MVictor
    Level 10  
    "rb401" Thank you for reply. But that's not what I meant.
    FTDI + Flash Loader Demo (v2.80) + loading boot20_pc13.bin + Installing USB drivers from (Arduino / hardware / Arduino_stm32 / drivers / win / instal driver, bat)
    After connecting to USB, Blue Pill is recognized by the IDE on COM8.
    In Win10 Device Manager as STM serial (COM8).
    And I manage to upload a blink from the examples. (it takes ... a long time).
    My question was whether I was able to properly install the bootloader.
    I do not understand the message displayed under the sket, is there a problem with my STM?
    These are my own settings (I will not list all of them now, because I don't know if it is needed), other than those found in the network.

    Added after 14 [minutes]:

    However, if I upload the blink as: "STM32F103c8 (20k RAM, 64k FLASH)
    Upload Method: "STMduino bootloader"
    I get a message when uploading:: /Arduino:1.8.19 (Windows 10), Tile: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), Serial, 72Mhz (Normal), Smallest (default)"

    exec: "/ bin / arm-none-eabi-g ++": file does not exist Build error for Generic STM32F103C series board.

    Through the Library Manager I am unable to download and install (necessary, as I found on the web):
    Arduino SAM Boards (32bitARM Cortex M3) by Arduino "v1.610
    It's just that Library Manager doesn't find it on the web!

    Regards
  • #56
    rb401
    Level 38  
    MVictor wrote:
    FTDI + Flash Loader Demo (v2.80) + I'm loading boot20_pc13.bin


    Aaaa. So via UART, jumpers, etc. I missed this information.
    That's ok. In STM32, uploading the bootloader is identical to any other standalone program, because it is basically the same. You have uploaded it, it started and it works as the author wrote it. It is difficult for me to comment on the speed of programming, because I upload programs only with STlink.
    On the other hand, programs loaded by such a bootloader must be adapted to be loaded "a bit higher" in memory, because the bootloader is at the very beginning of memory. But Arduino controls it.

    By the way, it is different, for example, in Atmel's uC (eg ATmega in Arduino UNO), where the bootloader is loaded at the end of the memory, it switches to start from the address at the end of memory in fusebits, but the programs are "normal". And here just installing the bootloader is not only about uploading the memory content.

    Added after 12 [minutes]:

    MVictor wrote:
    However, if I upload the blink as: "STM32F103c8 (20k RAM, 64k FLASH)
    Upload Method: "STMduino bootloader"





    I have the current version of the package for STM32 and I don't have the "STMduino bootloader" option in Upload Method, just some DFU maple.
    Maybe it's some not exactly matched versions of the bootloader and support on the Arduino side.

    As for the error you have on the screen that some reset did not work, it may not be important. It is important that it has been installed without errors.
  • #57
    MVictor
    Level 10  
    Well, thank you again for the answer.
    I hope that this bootloader is actually installed in my STM-e ...
    The point is that he doesn't give me extra trouble. I'm an older guy now and have a hard time solving these kinds of problems.
    For me, the most important thing is: "copy + paste + send to MC + run" Ready project developed by someone.
    Thank you and best regards.
  • #58
    rb401
    Level 38  
    MVictor wrote:
    I hope that this bootloader is actually installed in my STM-e ...


    If Flash Loader Demonstrator did not throw an error, you have installed it correctly.
    Another thing is whether you have the appropriate version of the boot20_pc13.bin file with the driver and Arduino support.



    MVictor wrote:
    Through the Library Manager I am unable to download and install (necessary, as I found on the web):
    Arduino SAM Boards (32bitARM Cortex M3) by Arduino "v1.610
    It's just that Library Manager doesn't find it on the web!


    It is no longer relevant. Once upon a time the package for STM32 used the compiler for ARM processors from that package for SAM Boards and it was actually needed. But now the package for STM32 includes its compiler and that package is completely redundant.





    MVictor wrote:
    The point is that he doesn't give me extra trouble. I'm an older guy now and have a hard time solving these kinds of problems.
    For me, the most important thing is: "copy + paste + send to MC + run" Ready project developed by someone.



    But does this project of yours necessarily require a bootloader for some reason other than just uploading a compiled sketch from Arduino? However, because the bootloader complicates various matters (reduces the available memory, delays the start of the program, etc.), in relation to uploading only the main program.
    I am asking because from Arduino you can directly save the program to Blue Pill in the same hardware way as you uploaded this bootloader with Flash Loader Demonstrator, i.e. via FTDI (or a similar adapter) to pins A9, A10, BOOT0 jumper etc.
    Only that you do not use Flash Loader Demonstrator, you just select "STM32CubeProgrammer (Serial)" as Upload methods in Arduino and below you enter the COM port number of this adapter. Now I tried practically this way of uploading to Blue Pill and it works as it is supposed to work.
    In order not to be too easy, before using this method in Arduino, this program must be downloaded and installed on the computer:
    https://www.st.com/en/development-tools/stm32cubeprog.html
    although you don't need to do anything or even run it. Arduino uses it internally.
    Simple installation, no hassle. The only inconvenience is that you need to register and log in before downloading the installer. But if what, I give here an account ready not to waste time:
    mail:
    marie7536733(_at_)mailinator.com
    password:
    Marie7536733!


    MVictor wrote:
    And I manage to upload a blink from the examples. (it takes ... a long time).


    In fact, it takes a long time from pressing the Upload button to the end. But what I see this long time is not a matter of just uploading to the bone, but some long thinking about Arduino before starting the compilation and then processing a lot of files. And it doesn't depend on the save method you choose.
    And the proper programming of the cube itself, i.e. how the red inscriptions in this bottom window are going, is a little while.
    For example. With this method, through an adapter, an ordinary blink with about 22kB enters in less than 6 seconds (the same, but via STlink it enters in 1.5 seconds). So these times are bearable. You can be similarly fast by this bootloader. Just pay attention to how long these red inscriptions fly.
  • #59
    MVictor
    Level 10  
    Yes, thank you, I will fight the ST link next. I do, but it's in a box somewhere ... still pre-packed.
    I found some specific projects that I am interested in.
    Unfortunately ... every project is a different MC. With Arduino ... well ... somehow with difficulty, he can cope, Now this STM ... with this bootloader "fun" I haven't uploaded anything specific to this STM except for this blast. We'll see. Then ESP32, which I plan to buy in the near future. Specifically: ESP32-DevKit C v4. I suspect that the "stairs" will begin again.
    I would prefer to do everything on one particular MC model, well ... unfortunately, it is not possible, the projects I am interested in are made on different MCs.
    Thanks again and best regards.