STM32F103C with ST-Link and STM32duino, simplified!
Vložit
- čas přidán 20. 08. 2024
- In this video I show you how to install all the drivers for the STM32-based microcontroller in order to be able to use it with Arduino IDE.
After installing the drivers, and uploading the bootloader to the STM32 microcontroller, you have to add the additional boards manager to the Arduino IDE. After that you have to pick your board (in this video, it is the STM32F103C) and select the STM32duino bootloader as the upload method. Connect the board to your PC by the MicroUSB port (remove the ST-Link if you haven't done it yet) and upload your software of choice.
Resources:
ST Drivers and Utility:
www.st.com/en/...
www.st.com/en/...
Arduino STM32 files (Drivers and Bootloader):
github.com/rog...
github.com/rog...
Additional Boards Manager URL:
dan.drown.org/s...
STM32duino files:
github.com/stm...
If you found this video useful, please subscribe!
If you want to buy the parts I used and support me at the same time, please use my affiliate links:
curiousscienti...
I have been working on this for 6 hours, but now I must eat and go to bed...hope I don't forget where I am at. Thank you, your help has been the easiest to follow on this subject and all your links are good. Thanks from a 74 year kid.
Thank you for your nice words! I hope your projects will work out well. Let me know if you get stuck somewhere and I will try to help you.
Sir, I must thank you again. It all worked thanks to you and your tutorial. This is the 3rd try to program this board, but you provided "All" the correct links with all the correct information. If I could follow this and get it to work I think anybody could, again, thanks.
Hi! Thank you for coming back and I am really happy to hear that you have had a successful installation process! This really motivates me and makes me happy. I hope that you will build a lot of cool projects with the STM32. It is a very nice and powerful device.
AWESOME TUTORIAL, easy to follow and well explained, thank you
Glad it was helpful!
Thank you sir, finally i can use com ports and read signal from stm32 board in my pc, thank you for sharing your knowledge! Kudos!
Hi! I am glad to hear that your issue was solved thanks to my video. Have fun with the microcontroller!
GREAT TUTORIAL..well explained...thank you..i upload the arduino bootloader to my stm32f103 without any trouble....thanks again
Thanks for the feedback, it is great to hear that my tutorial was working for you! Enjoy the microcontroller. Cheers!
Here is another that people seem to keep looking at. Go this direction. Peltiers are my thing but it doesn't seem to be the hot topics lately. Make a buck or two when you do all this work.
This is (/will be) also one of my directions: microcontrollers in general. Actually, my strategy now is just to share a lot of videos in topics that I am interested in. I don't want to have a very narrow profile, because I make these videos for fun at this moment. When my channel becomes more popular (if it ever happens), then I might focus on less topics and provide more quality content in less topics. But I have sooooooo many things to share that I do not want to restrict the stuff I share. You never know which video will be helpful for someone.
انه من افضل واجمل الفديوهات التي شاهدتها . شرح سلس ومفيد ومركز . شكرا لك كثيرا .. لدي بعض الاقتراحات سوف اطرحها ان تم الرد على تعليقي . شكرا لك على الفديو والشرح ❤❤❤❤
Sorry, but I can't read a single word of this.
i have to say thank you, this is a great tutorial and it did help me a lot, this kind of actions makes common knowledge progress further, thank you!
Thank you! I am happy to hear that my video was useful!
Just subscribed, thank you, you are awesome.
Thank you very much! I am glad that my video could help!
More recent information that I have seen on CZcams, or read on forums, say the STM32 ST-LINK Utility has been replaced by STM32CubeProgrammer, which creates a whole lot of other issues 😕
The fact that it got replaced doesn't mean that you can not still use it. I am still using it without issues. But it is only needed if you want to upload a bootloader so you can program it via USB in the future. If you have the ST-Link dongle, you can use it anyway for programming.
it's very difficult to program stm32 with IDE in many cases there is this error message:
" 'class EEPROMClass' has no member named 'put' " or
" 'class EEPROMClass' has no member named 'get' "
Have you tried Googling your error messages?
How about doing the task with STM32Cube IDE?
The point here is to provide the "STM32 experience" in the framework of the Arduino system. Why? It is simpler than the cube IDE. Setting up the clocks, the peripherals, coding using the HAL is a bit more complex and as I noticed, people look for simple solutions most of the time.
thankyou sir, its work very well
You're welcome!
This worked, thank you so much!
Glad to hear! Cheers!
very useful video . thanks
Glad that you found it useful! Cheers!
I install the bootloader successfully but I get this error on the output, I install the install_driver I didn't find the install_driver_bat 'C:\Users\fnan' is not recognized as an internal or external command,
operable program or batch file.
Failed uploading: uploading error: exit status 1
Hi. The bat file is right there in the links I provided ("Arduino STM32 files (Drivers and Bootloader)").
Great tutorial. Thank you :)
Thanks! I am glad it helped!
Sir, I have completed everything and try to upload code to my STM32 bluepill but it show error. The Error is just “Access is denied “ , how do I solve it?
I am currently using Window 11
Hi! Where do you encounter this error? Which software throws it and when?
hello, I have followed your instructions but when I try to upload my code in the arduino IDE I get :
maple_loader v0.1
Resetting to bootloader via DTR pulse
Reset via USB Serial Failed! Did you select the right serial port?
Searching for DFU device [C:\Users\chefl\AppData\Local\Temp\arduino_build_987028/Blink.ino.bin]...
Assuming the board is in perpetual bootloader mode and continuing to attempt dfu programming...
dfu-util - (C) 2007-2008 by OpenMoko Inc.
Couldn't find the DFU device: [C:\Users\chefl\AppData\Local\Temp\arduino_build_987028/Blink.ino.bin]
This program is Free Software and has ABSOLUTELY NO WARRANTY
timeout waiting for 2 serial
Do you have any solution ? thank you in advance
Hi! Have you selected the correct usb (COM) port? Do you see the stm32 board in the device manager? Probably, you either haven't chosen the correct port, or the burning of the bootloader was not successful.
Nice video, this help-me a lot
Thank you, I am glad to hear!
Great video! I just have an issue, when I connect mi board the arduino IDE doesn't recognize the serial port... is there something that i can do?
Hi! The whole tutorial is about this issue. How to make the MCU to be recognized as a serial device after installing the bootloader. Have you followed all the instructions?
By far the best guide out there, thank you!
I only got stuck at one problem.. Tried to run your code and the Serial.println(i) does not print anything on the serial monitor, any ideas on that one?
Hi! Thank you, I am glad that I could help!
Check the ports whether you are connecting to the same COM where your Blue Pill is located at. Also, make sure that the terminal and the board is at the same baud rate. As you can see, my code was running as I uploaded it to the board, so if you followed the tutorial step by step, it should work. Also, make sure that you move the BOOT jumpers on the board according to the instructions.
Did you add the extra code to the blink.ino to do the counting?
OR, just leave the ST-Link connected ( no boot loader required (it's J-tag)) and select "STLink" as seen at 8:30, and done (the whole point of getting an ST-Link with the boards, a lot more powerful than a simple boot loader).
Yes, one can also skip the bootloader! But people usually work with bootloader because they want to upload their program via usb, so that's why I showed that. I believe that people who can use the ST-Link as "it should be used", rather use the STM32CubeIDE or other similar software and they don't use the Arduino environment.
The program hung when I tried it without the USB connected. It appears to require a serial port connection to use "Serial.println()" function.
Question for anyone who may know: Does the bootloader function as a USB serial driver on the Blue Pill? If not, what part of this process makes Windows recognize the device when it's plugged in via USB?
Thanks - Greg
Yes, the whole point of the bootloader is that you can upload software to the microcontroller via USB. If you don't have a bootloader installed, you have to program it using the ST-link. A program uploaded with the ST-link will still be capable of serial communication.
green led is not blinking though only red led is blinking on mine.And its blinking in opposite way(like When low, led is ON and vice versa).
what should i do???
I don't really know the reason, but the red LED should not really blink as that is the power LED. Are you sure that you are using the same board?
@@CuriousScientist na na like 2 red led's are there one is power led and other is also a red one which was supposed to be green led.its same blue pill u used in ur vid.
@@chinmaykulkarni2881 Hm, that is weird, I have never seen these blue pills with two red LEDs, and I own a handful. Try doing the whole process from the start. Also, check the chip. I don't doubt what you are saying, but it could be that you have a counterfeit or fake chip and that's why things are acting up. You can have a CH32 chip or an STM32F103C6T6 or something similar that is not the STM32F103C8T6. In that case, a different bootloader will be needed.
Can you fix the link to the arduino driver to point directly to the driver file to load for windows. It points to a directory with many files and subdirectories but it's not clear where is the driver itself.
Also, I think you skipped the part of installing the stm32 in arduino after adding the json url to the board manager.
Thank you for the feedback! Sometimes I am not aware of how deep I am explaining stuff, so it is good to know if something is missing. I fixed the driver link, I hope that this will help you. Now it points to the 'win' directory. You just download the whole directory, then click on the install_drivers.bat file. That should install everything. It might happen that you have to run it as administrator. If you still have issues, please let me know, I will try to help you!
As long as I'm concerned, it is enough to add the path to the json file. I recently reinstalled my computer and I haven't downloaded the STM32 in Arduino IDE. The installation is only necessary, if you want the libraries for STM32. I prefer downloading them individually because I don't use 99% of them.
@@CuriousScientist I am still confused by this process. I click the link and I'm in the Git Repo at "Arduino_STM32/drivers/win/". There is no download button or link I can see. If you click on a file it displays the contents of, for example, "install_STM_COM_drivers.bat". What am I doing wrong? Does one need a Git user account?
One other question: isn't the bootloader supposed be be already installed by STM? How does one tell if it is or not?
Currently when I connect the Blue Pill via USB, I get a popup that says "device not recognized...device malfunctioned..." This is with the boot jumper in either position.
Thanks - Greg
@@pwrgreg007 Hi Greg,
The simplest thing is to go to the main folder "Arduino_STM32" where you can see a big green button called "Code". Click on it, download the zip, then fetch the files from the corresponding folder.
Yes, some microcontrollers come with a preinstalled bootloader, but sometimes you can accidentally delete (or rather, overwrite) them, so that's why it is good to know how to install the bootloader. Just try to connect the stm32 to a USB port and for example, try to upload a simple blinky sketch that toggles the PC13 onboard LED. If you can upload the code, your board already has the bootloader.
@@CuriousScientist Thank you sir, that worked. Now I'm using the second link for bootloader files, directed to the Git Repo at "rogerclarkmelbourne/STM32duino-bootloader". I got the code as "STM32duino-bootloader-master.zip", and unzipped it, but the files are totally different from what you show in the video. I show folder "binaries", "bootloader-only-binaries", and other different ones. Do I have the right place?
Thanks - Greg
p.s. Nevermind!, I found the file "generic_boot20_pc13.bin" in the "bootloader-only-binaries" folder. Thanks again!
@@CuriousScientist For bootloader file, there is "generic_boot20_pc13.bin" in two folders, "binaries" and "bootloader_only_binaries". Which is the correct one?
Thanks - Greg
i have a problem. my arduino ide does not show a st link in the upload menu. but it shows st link in device mgr
Sounds like you haven't followed every steps. Have you added the stm32duino to the Arduino IDE? Have you switched to the other group of microcontrollers? Watch my video carefully and follow it step by step.
yes i have done all steps. but still does not show st link for upload
It is hard to guess what could have gone wrong. Have you checked the BOOT jumpers too? It might be as well that something went wrong with the microcontroller itself.
@@CuriousScientist I have a f401 black pill and just want to use the st link to program it. but st link does not show up as an option in my arduino IDE. is it the bat files maybe ?
I would assume yes. I don't know the differences between the two devices and I have never worked with the black pill. But I suspect that it needs different files perhaps.
Hi!, thank you for your tutorial, quite straightforward and clear!
However I'm having some trouble with my STM32F103C6T6 board: different from an Arduino Uno or Nano I can't see the COM port in the device list (and of course in the Arduino IDE) and of course I can't upload the sketch...
Any idea? It seems to me I missed some drivers...
Hi! Please read through the comments because several people had similar issues if I remember correctly. You might find the answer by reading the comments.
@@CuriousScientist after a couple of hours trying, I found a fix :-)
I'm leaving here my solution for any other people that could have the same trouble.
-- The bootloader .bin described in the video is OK (generic_boot20_pc13.bin)
-- Install the USB drivers using wdi-simple.exe and install_drivers.bat (links in the video description).
-- for the STM32F103C6T6 board must to choose the STM32F103C6/ fake STM32F103C8 in the Arduino IDE
if you still has no COM port in the devices list:
-- open the "blink" sketch (examples -> STM32 -> digital -> blink)
-- put the jumper BOOT1 to 1 and connect the board
-- Upload the sketch using the instructions from this video (even if there isn't any COM port)
-- The COM port should to be appear in the Windows devices list
-- Put the jumper BOOT1 to 0 and you've done forever (no need to change the jumper again).
Hope it could help!
Thank you for providing your method! I am sure it will be useful for those who are struggling with their STM32s.
I wished this would work because I bought 2 STM32F103C6T6 board with ST-Link V2 and I tried it all. Then I tried this and it all went well, after running the STM32 ST-Link Utility I checked my arduino IDE and the board was there in my board manager. I removed the ST-Link V2 and connected via USB and restarted the Arduino IDE and all my board for the STM32 was gone.
Any advice before I take a hammer to the boards? :D
Hi! I do not advise using a hammer because the boards are brittle and the flying debris can hurt you.
On a more serious note:
Please check if you have all the drivers installed. Also, you said that the list of microcontrollers disappeared from the IDE. That sounds odd.
- Do you have the proper URLs under the preferences/additional boards manager?
- Also, do you have the stm32-related things installed in the boards manager?
- Have you checked the STM32 _before_ using the ST-LINK? Typically, they come with a bootloader.
- Did you put back the BOOT jumper to the correct position? Or, did you put the jumper to the correct position _before_ starting to upload the new bootloader?
So far I can pinpoint these main steps. Let me know how it goes.
Comment section is still alive :)
Nice video, good explanation. However, got a small issue with my blue pill, loading the bootloader worked like a charm, checksum are fitting and it shows the same data on the pill as on the bootloader file. However, my computer won't recognize the blue pill with it's own usb, device manager tells me unknown usb device as it couldn't receive any device description (drivers installed with the bat/exe files and even manually). Jumpers were set as you described in your video, even with putting the boot jumper back to 0 when it was still connected with the st link)
Already checked all resistors, they are good and according to the official schematics all resistors have the right values.
No clue what to do know (beside programming via st link again)
PS: The STM32Cube Programmer won't work with knock-off V2 st links, the discontinued stmlink does ;)
Hi! Did you install the proper bootloader? The pc13 one? Also, try other usb ports and usb cables too. Sometimes some usb cables cause this error. Furthermore, despite the fact that the error message appears, can you see it as a com port anyway?
@@CuriousScientist Wow, quick response. Tried multiple cables, none of them worked for the blue pill (for my Arduino Leonardo all of them worked). Different usb ports as well, front/backpanel, usb2 and usb3
I used the PC13 bootloader (generic_boot20_pc13 to be more precisly.)
I do get the sound for plugging in a device, however it is listed under the usb controller as "Unknown USB Device (Error on retreiving a device description)", marked with a yellow triangle, no COM-port assigned. So it knows there is a device, but my PC obviously can't tell which one exactly. Also tried to install drivers for the unknown device, but since it won't submit any identification about the device type it remains unchanged even if i pick the driver manually
It could be that you received a broken/counterfeit device. It happened to me a few times as well. Is there a small dot on the stm32 chip which should indicate the pin number 1? How does the reset button look like? Rectangle or "hexagonal"?
@@CuriousScientist sry for late response, got no notification about your answer. Yes there is a clearly visible dot on the chip (facing towards the crystal). The resetbutton itself is square, the actual push element of the button is circular. In the meantime, I'll try to get a new one form a local vendor (got it from a german electronics supple store)
@@CuriousScientist good news, sort of. Got some new blue pills and talking with the guy in the store gave me some insights. The new blue pills have rectangular reset buttons, the store guy told me it could be an issue with downloading from git and also gave me one pill with preloaded bootloader. If I plug this one in my PC instantly recognizes it and (after uploading the first Sketch) assigns a com Port. If I load the bootloader into the New pill.... Same issue as before. So I downloaded the exact same file again........ And with this new file, identical in size but different checksum... it somehow works..... On ALL blue pills 😅
I really have to thank you for your time.... Never thought about something like this
Hi , thanks for your tutorial. but I have a problem , when I connect my STM32 blue pill via USB/min USB cable. My computer does not detect anything . I dowloaded well the bootloader following your instruction. I installed drivers succesfully but board does not appear in device manager panel of windows10. Have you an idea ? thanks in advance
Hi! If it does not detect anything at all, you probably have a dead microcontroller or a bad USB cable. Even if the drivers were missing, the computer should see that something was connected to it. It would be unable to communicate with it, but it would see it. Check your USB cable.
hi, Firstly thank you for this video. I have a question. I did everything right and plugged in the micro USB cable I use in phones but my computer does not see the cable. Phone micro usb not suitable?
You are welcome! Some phone usb cables are only for charging and not for data transfer. This could be an issue.
@@CuriousScientist So How do I know its sending data while buying
Usually it is stated on the packaging if it is also for data transfer or not.
@@CuriousScientist thank you so much for your helps sir. I wish Have a good day.
You are welcome! I hope it will work well with the new cable. I actually had a similar issue with the usb cable of my headphones. I thought it is a normal cable but it is only for charging. Have a nice day!
Hi , I have Arduino Nano Stm32. Which has already program in it. I want to copy program from Arduino board.
Hi! As far as I know you cannot just copy an already compiled code, especially between two different microcontrollers.
hello, the blink program I installed on my stm32 card with arduino ide gives an error
Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
Hi! What should I do with this error message?
hello, first of all thank you for answering my question
I have installed STM32 relevant drivers and bootloader.
I wrote the blink sketch in the video.
I compiled and uploaded it to stm32, it gave an error message with the installation complete message
""Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment. ""
Serial port doesn't work on screen.
Can you provide information about this error?
arduino IDE2.1.1
thanks good work.@@CuriousScientist
The information is written in the error message. Please read it. Java.dll is missing. Make sure that the Java is installed and up to date on your PC.
I reinstalled java new errors occured
Resetting to bootloader via DTR pulse
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=41168, tid=0x000000000000a154
#
# JRE version: Java(TM) SE Runtime Environment (8.0_381) (build 1.8.0_381-b09)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.381-b09 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [jSSC-2.8_x86_64.dll+0xb5db]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\AsusPC\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2022.9.26\win\hs_err_pid41168.log
#
# If you would like to submit a bug report, please visit:
# bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#☹
Something still seems to be wrong with the Java environment. I am not a Java expert, so I don't know what's wrong. Check Google for clues. Maybe others also had this error before.
Hi!Im stuck in between.Can anyone help me out?
Hi! Stuck in between what?
101 question: why do you need bootloader?
Otherwise you cannot upload your software via USB from the Arduino IDE.
thank u man
Glad to help!
you are perfect
thank you so much
I am very very far from perfect. But now I am happy that my video helped you! Cheers!
I booked stlink v2 online but I got "stc auto programmer usb-ttl " can I use it program device
Hi! I have no experience with the mentioned device, so I am sorry but I don't know.
Perfect turorial. Working. Just one question. Does this method of programming supports Mouse.h library? I am getting an HID.h error.
Thank you very much! I am glad it works! Unfortunately, I have never worked with this specific library, so I cannot tell it for sure. Sometimes some libraries do not work with STM32. Sometimes because they depend on some third library or because of the differences in some definitions. Check if you have outdated libraries (sometimes you have to update them manually). Other than that, I don't have any ideas, sorry.
hi sir how can copy hex file from exeting STM32F103C8T6 chip ??
Hi! You already asked this from me and I already answered it.
Not sure how difficult, but I'd like to port the STM32duino-bootloader to an stm32h7.. do you know if it uses usb's CDC class or HID class? According to the USB Composite Library for Roger's Melbourne's STM32F1 seems to support many classes.. HID, Mass-Storage, etc, but not exactly sure if it's HID for bootloading!
Hi! Unfortunately, I do not have any experience with the above mentioned chip type. My only suggestion would be to give it a try. I guess, you cannot really mess it up if you try to upload the "wrong" software. In the worst case it will do nothing.
HI roger, port still greyed out unfortunately, I have followed all you instructions
Try another port. Make sure you pay extra attention on the BOOT0 jumper. Check the device in the device manager. Try reinstalling the bootloader again.
HI SIR, i followed every steps, buy while uploading i am getting error, Access is denied.please help me to sort the issues
Hi! Have you restarted the computer?
@@CuriousScientist yes sir, but could able to upload the code to board, get same error
If you were able to upload before, then look for the changes you did that might introduced an error. Maybe wrong COM port is selected? Could be a bad cable maybe? Is the microcontroller intact? Can you upload a simple blinky to it via the ST Link?
@@CuriousScientist it showing correct com Port, but while uploading it shows access deined and it also shows error message of 'java' is not recognized as an internal or external command, operable program or batch file. But I reinstalled but nothing changed, please help me to sort this issue, thanks for your time 🙏
Have you tried searching for the error message in Google? Maybe you should give it a try.
Hey, I have done everything as per the video suggested, but when I upload the code nothing happens, it says done uploading. but the LED doesn't blink...and there is nothing in the serial terminal, can you help me with that ?
I tried 2 different board and 2 different usb cable, I also redownloaded the drivers and restarted my computer. The boards I have are STM32F103C8T6
Thank you
Hi! If the uploading was successfully done, then it should work. Do you have a real C8T6 and not something like C6T6? Is the LED on the same pin as in the code? Did you really make sure that you use the boot jumpers properly? Have you tried verifying the code (bootloader) in the stm32cube programmer? Do you have the same code on the MCU as you see in the hex viewer? There are many things to check and it is super difficult to remote-troubleshoot this issue.
@@CuriousScientist You are right, i checked thoroughly and it is a C6T6, does it change something ? . I'll try to verify the code in the stm32cube programmer, could it also be that the stlink is problematic ?
Thanks for your response
also the LED is the same pin (PC13)
C6T6 needs another bootloader. Just download the correct one, and it should work. Also, make sure that when uploading with USB, you select the correct MCU.
@@CuriousScientist Hey @CuriousScientist, I tried a lot of things, and in the end I was able to upload with the ST-link as a comment was suggesting, you are probably right when you say that the boot loader was the wrong one, but I couldn't find the right one. For now, it works thanks to you ! Thanks for all your help !
hi sir how to read & copy hex file from STM32F103C8T6
As far as I know, the ST-Link software can download the content in binary format. I have never tested it, so I do not know how to work with that part.
Hi,
I did everything as in the video, but the arduino (program) does not see my board. There is no port in the instruments.
I'm sorry if you don't understand, I'm just from Russia
Hi! Your English is fine, do not worry! Do you see the device in the device manager when you connect it via USB? Something should show up under the Ports (COM & LPT). For me it shows "Maple Serial (COM11)" after installing the bootloader via the ST-Link and connecting it to one of the USB ports. If nothing is showing up when you connect the STM32 to the computer, it might be that the board is faulty. Sometimes it can be that one of the resistors have wrong value. Read the other comments under this video because we discussed this with another viewer. Let me know about your progress.
@@CuriousScientist
Hi, I couldn't do it because I have a fake cks32f103c8t6. I will wait for another stm32. I don't know what to do with this board, can I flash it?
Yeah, I also have the fake one and some of them have the wrong resistor value. You just need to add an extra resistor and use it when you flash it or upload the software.
Dear Sir, I followed every step and I got this:
maple_loader v0.1
Resetting to bootloader via DTR pulse
Reset via USB Serial Failed! Did you select the right serial port?
can you pls help me
Did you select the right serial port? According to the error message, the software cannot find the microcontroller. Also check the boot jumpers.
@@CuriousScientist So sorry to trouble you again sir, Everything was solved after I went into the drivers and uninstalled the maple device and reinstalled the divers. It worked like magic after that. Thank you so much sir.
Thanks!
Thank you very much for your support!
great tutorial. it really helpful but Arduino Ide show error "Access is denied". KINDLY resolve it
Thanks, seems like you found the files because your previous comment magically disappeared. :) Access denied can be caused by many things. Wrong COM port, port is already open by some other things...etc. Do a Google search for your problem and try the solutions you find there.
You should write which one of the pins connect to the st link and microcontroller
You should watch the video. I tell it literally in the first minute.
@@CuriousScientist Yes I did, thank you
Why port not detected? so serial monitor can't be opened
Did you select or try to select the proper port? If you cannot see the device it usually means that the installation of the bootloader was not successful.
@@CuriousScientist is there a solution?😅
Yeah, try to reinstall the bootloader.
I cant find boot-loader folder inside Arduino master
There is a link in the description that leads you straight to the bootloader.
@@CuriousScientist i need link bro
Check the description maybe.
Hello Sir, I am coding my cards with this method. Is it possible to use the serial monitor in this way, I haven't been able to figure it out so far. I'm using ST Link V2, I can do things that can be followed by eye such as led flashing, even I can compile all my codes and send them to my card, but I can't track data on the serial monitor. I will be glad if you help
Hi! The ST-Link (as far as I know) is only a programmer and it is not a serial adapter. You need to use the serial port (after disconnecting the ST-Link) if you want to communicate via the serial monitor.
@@CuriousScientist Thank you sir, I respect you and I like so much your videos
Thank you very much!
unfortunatly it didnt work for me maybe i have downloaded something wrong or somehing
Couldn't find the DFU device: [1EAF:0003]
my IDE says
Have you installed the driver and the software package I showed (from 3:35)? Also, have you checked the device after installing the bootloader? You should see an automatic message on the serial terminal that indicates that the installation of the bootloader was successful.
@@CuriousScientist
thanks for the fast answer!
i could oben the STM link shown at 4:16 and it verified my bootloader
i also installed the .bat files
is it possible i need an other bootleader? but i think i have the exact some board
Here is the full error i get by the ide:
esetting to bootloader via DTR pulse
Searching for DFU device [1EAF:0003]...
dfu-util - (C) 2007-2008 by OpenMoko Inc.
Couldn't find the DFU device: [1EAF:0003]
@@Milan22229 @Milan Have you _installed_ the bootloader? Have you also checked the serial terminal and saw if you get the message from the bootloader? Your error message suggests that you don't have a bootloader installed...
@@CuriousScientist i guess :)
is it the part at 5:54?
i can choose the board and the upload method in the IDE if this helps
@@Milan22229 No. :) I ask you for the last time. Have you opened the serial terminal after you (assumedly) installed the bootloader and did you see a message confirming that you have a bootloader on your STM32?
Hi,
Great instructions, however I stumbled on a problem.
After I loaded the bootloader via stlink the program said that it was loaded OK but immediately after wrote that the device was not connected anymore (same as your video showed after disconnecting although it still was connected). Anyhow, assuming the bootloader programming went OK I continued to the Arduino environment and connected to USB. Trying to upload a blink program failed - got a message that the device was not found (although, if I try to get board info it reports the type of board correctly). Assuming something went wrong with the bootloader decided to re-flash it. Now when connecting to STL and trying to connect the program says that it cannot conect to target. Any idea why this happened and how to fix it?
Hi! Did you follow the routine for the BOOT jumpers? It is crucial to have them in the correct position, otherwise the bootloader will not be uploaded. Also, some certain copies of the blue pill have different resistors for R10 what it should be and that can cause issues with the USB connection. Check the value of it. If it is not 1k5 but 10k, it has to be corrected. Either you resolder is, which can be a painful process, or you solder a 1k8 resistor between +3.3 V and PA12. I had one board which had this issue and I could solve it with the resistor trick.
@@CuriousScientist Yes, I followed the jumpers routine. I also already soldered a resistor in parallel to R10. The problem is that currently I simply cannot connect to the board - not via USB and not via stlink. I Do not see why, but maybe it was damaged somehow during the process (the indication that something went wrong is the fact that stlink lost communication immateriality after the bootloader was programed while it was still connected)
@@giladandlimorbarak2521 Do you have another board to test? I usually order them in 5 or 10 pcs packages because 1-2 of them is usually defective or dies very quickly. It might be the case that it went bananas just in that moment when you installed the bootloader. Another approach could be to check if you can connect to it via an FTDI adapter. If that works, then you can still save the board, install the bootloader via the FTDI, and also test it. If it works via FTDI and does not work via USB, then something is wrong with the board.
@@CuriousScientist Thanks, will try this. I have only another one - will order some more
Go to target-settings, select connect under reset, then press reset button on the board and click ok
PORT IS STILL NOT DETECTING
So, what? What should I do with this information?
İs there a way to upload codes using this to a Arduino Uno? İf yes how?
I don't really understand what you want. This video is about using STM32 within the Arduino framework.
@@CuriousScientist well i seem to be a thick skull so i have difficulties understanding it. İ use a microcontroller mega328p on a breadboard for my project and i can only upload codes in 2 ways. With miso and mosi pins using another Arduino or the txd and rxd pins using a usb to tll converter. So my question is which pins would i need to connect to upload using an st link
I don't really think that the ST-link can be used to program an Arduino which is a different system. I don't know for 100%, but I believe that they aren't compatible.
@@CuriousScientist yeah no matter what i do i Can't seem to program it thanks for the tutorial unfortunately i can't use it though
Once again, the ST-link is a dedicated programmer for ST microcontrollers! They aren't for Arduinos.
I'm very interested in your video, sir, may I re-upload?
Hi! What do you mean by re-uploading? The video is on CZcams, and I believe that you can freely embed the video or share the link of it. However, you should not download it and upload it somewhere, since it is my intellectual property.
Great instructions, but I get a JAVA runtime error on upload. At the end of the error message, there is a statement that the error occurred outside the runtime environment in the native code. I think I followed all the instructions. Bootloader (on the board) is OK, Arduino IDE senses the board type, port, board info. I selected STM32F103C generic, loader is Maple Mini, upload method is STM32duino bootloader. Argh !!!! Im running a blue pill.
Are there any error messages? It is a bit difficult to guess by this. It might be that some of the drivers are not (properly) installed. Can you tell me which drivers you did you install?
@@CuriousScientist Thanks for the response.
maple_loader v0.1
Resetting to bootloader via DTR pulse
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=16516, tid=21364
#
# JRE version: Java(TM) SE Runtime Environment (14.0.2+12) (build 14.0.2+12-46)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (14.0.2+12-46, mixed mode, sharing, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C [jSSC-2.8_x86_64.dll+0xb5db]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\xxxxxx\xxxxx\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2020.6.20\win\hs_err_pid16516.log
#
# If you would like to submit a bug report, please visit:
# bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
I ran this as admin to install the driver install_STM_COM_drivers.bat
Allow me a few days as my weekdays are usually very busy. I will return to you with some information.
@@CuriousScientist Additional troubleshooting. I started with an "out of the box" blue pill, It started flashing at a fast rate (pre-installed blink). I loaded the bootloader using ST Link and that worked. I modified blink to match your example to flash on 500 ms and off 250 ms along with the counter. I uploaded to the pill using plain old USB (not ST Link) and it worked fine. When I tried to upload again, I get the error messages. I restarted the IDE (1.8.13), unplugged and replugged the pill but to no avail. I reloaded the bootloader and the new blink was still in there. I tried to reload the blink program and that didn't work. I did a full chip erase, repeated the ST Link load and that worked. I loaded the modified blink via the USB and that worked. When I try to reload the blink software again, I get the errors again. So right now, the only way I can get uploads to work is to do a full chip erase.
Do you move the jumpers as instructed? If the jumper is not moved, you upload the code directly to the chip, potentially overwriting the bootloader.
As I understand the bootloader is a sort of a software that accommodates your unique software. The bootloader allows you to upload software directly from USB. But for this, you have to follow some rules, otherwise you end up erasing the bootloader from your blue pill. I imagine the bootloader as a operating system. You put it on your PC and then you can install software in your PC that can communicate with other hardware and stuff...
So, I assume (I might be wrong) that you forgot to move the BOOT0 jumper. So, let's start from scratch after full chip erase. First, without connecting the blue pill to anything, put the BOOT0 to "1" position. Connect to ST-LINK, then upload the bootloader. Now, while the power is still ON, put the jumper back to "0" poisition, then remove _all_ connections. After this step, you should never ever touch the BOOT jumpers, except you want a new bootloader, or you want to upload the software directly to the chip. Now, the bootloader is on the chip and since you are in the "0" position, the software which will be uploaded via USB will end up in the correct place in the chip's memory. So, now, connect to USB, and upload something. After removing the USB and reconnecting it, the same software should be on the blue pill, and you should be able to upload a new code.
What could also happen to your blue pill is that it has the incorrect resistor (R10). Check it on the backside of the PCB. it should be 152. If it is not 152, either you have to replace it, or you place a resistor between PA12 and +3.3 V based on the value of R10. If R10 is 472, you use a 2k2 resistor, if it is 103, you use a 1k8 resistor. I had 1 or 2 boards with this issue, and this resistor trick solved it.
thanks alot
You are welcome!
Not complaining about the video but, this is the most God awful thing I've ever tried to do. Forum post after forum post, video after video. They're all from 2 to 5 years old recommending 2 different repos for the Arduino board manager. I've gotten the bootloader flashed (I guess) but the com interface won't show up in Arduino (maybe Linux is the issue). I'm throwing in the towel and going back to fiddling with registers and using the st-link.
I don't have any experience on Linux, so unfortunately, I can't help. But it should be relatively straightforward anyway.
...I check most of stm32 vid.. everyone saying something else...it's not redundant
There are different ways. It's not my fault.
@@CuriousScientist ..it's to slow to see result on stm32...there is too many steps...and the tutorial is not redundant per video...esp8266 easily works even on xp in certain configuration...I'm not a esp32 fan either...
I don't know, I don't have any problems with stm32, it works perfectly for me.
Hi, I've followed all your steps closely but when I uploaded the code on Arduino IDE, I get the 'Couldn't find the DFU device' error. Do you know how to resolve this issue? Thanks!
Hi!
Start it over from the beginning! Upload the bootloader using the ST-LINK dongle (pay attention to the jumpers). Remove the dongle and connect via USB. Then, select the board in the IDE, select the COM port, parameters...etc. Open the serial terminal. If you get an automatic message saying something like "you have successfully installed the bootloader", then you can proceed with the upload of the actual Arduino code. If you can't see the board where you can select it, then you might have a faulty board, or the R10 resistor is not the correct one. Check the earlier comments under the video because some other people also had issues with the board.
Check these as well. Do you have the same reset button on the board as I have? On the microchip, how many circles do you see in the corner of the chip? 1, located close to the crystal or 3?
@@CuriousScientist Thank you for the reply/ I believe my board is slightly different from yours. My reset button has an octagonal shape and on the microchip, there are 3 circles.
Ahahh! A few days ago I tried to use the same board that you described just now and I couldn't make it work either. I could upload the bootloader but when I connect it to the computer via USB, the computer says it cannot recognize the device. I replaced the R10 resistor, it did not help. As far as I know, this type of board is the "worse type" of the knockoff boards. So it is possibly a faulty board.
@@CuriousScientist ahh that's a bummer, thanks anyway! you've saved me loads of time.
The video was very informative , i uploaded the code for first time with this method how can i reupload the code with different delay?
while re uploading i am getting this issue
maple_loader v0.1
Resetting to bootloader via DTR pulse
Searching for DFU device [1EAF:0003]...
dfu-util - (C) 2007-2008 by OpenMoko Inc.
Couldn't find the DFU device: [1EAF:0003]
This program is Free Software and has ABSOLUTELY NO WARRANTY
Hi! Once you uploaded the bootloader using the STLink, you go to the Arduino IDE and upload your Arduino code using the USB connection. Don't forget to check the upload method, it should be the stm32duino-something (I don't have it in front of me, so I cannot check it).
@@CuriousScientist Thanks
SWCLK = SWSCK ?
What do you mean?
@@CuriousScientist I guessed it's the same for the STM32F411 BlackPill
On the board it says SWSCK, while the ST-Link/V2 only got a SWCLK labeled pin. So those are to be connected?
Ah, okay understand it now. Yes, they should be the same. On the blue pill and the st link, the clock is indicated by swclk.
not working
Then you did something wrong.
@@CuriousScientist yes, tried to use stm32... (3 board, 3 computers, 2 op.system - different hardware, same shit...)
btw. cube32 working, but we have a large codebase in arduino...
I think there's nothing wrong with the STM32. I am able to use several models (F1 and F4 mainly) with Arduino IDE without any issues. Both with direct USB connection or the ST Link dongle. Check if all drivers and software are properly installed.
@@CuriousScientist not working, stm32cube working, arduino not.
Well, then something is not OK on your side. Drivers, or the stm32duino framework...
Plese make a zip file with all needed files because i cant find the files that you use. In that case this video is useless.
Maybe it is not the useless video's fault but yours because everything is given in the description. All necessary links are there and they work.
@@CuriousScientist hi i found the file but i have a problem after the bootoader run and bot 0 putting back to 0. I connect the thing via usb and my pc show mapple003 and cant use as serial port. I try to program this via arduino but arduino cant find any ports what should i do?
Let's see. Start everything over and just put the bootloader on the board. Then, if this went well, a message will appear on the serial terminal when you open the board. This indicates that the bootloader was successfully installed.
After this, you have to select the board in the Arduino IDE. Go to Tools/Board/STM32F1 Boards, and select your board (Generic STM32F103C8T6 series). Then, you also have to select the other parameters under the Tools menu. It is explained in the video from @8:00.
@@CuriousScientist Yes. Everithing set right but the "port" section is gray because my pc cant recognize mapple mini as serial port. I nstalled the arduinostm32 drivers but i have a problem sitll. I dont know what the problem is."github.com/rogerclarkmelbourne/Arduino_STM32/issues/697". I have the same problem that showed in the link. Tanks for your help.
@@CuriousScientist when i connected via usb boot 0 in o positon and boot1 in 0 position but i try boot 0 1 position and also boot 1 1 position but i have a same results.
profanation
What do you mean?
@@CuriousScientist can it be programmed through stm32cubeide?
No, or it depends what do you mean. Using the dongle, you can upload programs from cubeide, you can even debug them. But the main purpose of this process that I show is to upload a bootloader to the microcontroller and make it accessible via USB and make it compatible with the Arduino environment.
@@CuriousScientist I meant if this board is programmable through STM32cubeIDE. I bought the same one from China, need it for STM project, and it only works as an arduino. Cube doesn't recognize it at all
Yes, of course it is programmable, it is a STM microcontroller after all. Some tweaks might be needed however, especially if you bought a knock-off board.