#152

  Переглядів 50,566

Ralph S Bacon

Ralph S Bacon

День тому

Add this entry into your Arduino Preferences to add the STM32 boards to the Arduino IDE
dan.drown.org/stm32duino/packa...
$2 for PCB Prototype(Any Color): jlcpcb.com/
My GitHub with all this information plus more:
github.com/RalphBacon/STM32-N...
So you're up for a boost to your Arduino UNO or Nano processor? The STM32 acts just like a Nano but has more pins, more capabilities and is cheap! There is a vibrant support community and you keep your Arduino IDE to code your sketches.
I'll be exploring all these features in more depths in future videos but for now, this is a brief overview and comparison to µControllers we've already covered in previous videos. Exciting Times!
LINKS LINKS LINKS LINKS LINKS
Here are some links that I found very easily - do search around for the best price. China is keenest in price (but read the reviews of the products to check the quality), Amazon also sometimes has hobbyist priced stuff and eBay is always a good place to search.
* Some of these links are affiliate links that may help my channel. *
STM32 Blue Pill (a reference to The Matrix film)
www.banggood.com/STM32F103C8T...
Maple Leaf STM32 (allows USB connectivity) Wow! Just $2.15 from China with free shipping
www.ebay.com/itm/STM32F103RC8...
FTDI USB-to-Serial module (Links USB to the Blue Pill)
www.banggood.com/FT232RL-FTDI...
STLink V2 (Another [official] way to link your STM32 Blue Pill to USB)
www.banggood.com/3_3V-5V-XTW-...
ST Link V2 Driver webpage
www.st.com/en/development-too...
If you like this video please give it a thumbs up, share it and if you're not already subscribed please consider doing so and joining me on my Arduinite journey
My channel and blog are here:
\------------------------------------------------------------------
/ ralphbacon
ralphbacon.blog
\------------------------------------------------------------------

КОМЕНТАРІ: 480
@stompreaper
@stompreaper 4 роки тому
So glad to see this video Ralph, you are talking about my favorite chips STM32s! I wanted to share some knowledge I've collected about these chips and the blue pill boards. Blue pill USB: there is nothing "wrong" with the USB on your blue pill (with the exception of the pull up resistor mod which I see you did). The issue is the expected behavior of the board out of the box. On nano/uno boards the USB port always shows up because it's hooked up to the FTDI/CH340/u32 chip that then forwards to the Rx/Tx on the Arduino boards. The blue pill hooks the data lines to the STM32 chip directly. The STM32 chip supports USB in its hardware and is very sophisticated but requires running code to be enabled. The maple mini has a boot loader flashed to it that presents the USB as a virtual com port and acts like your typical uno optiboot boot loader, letting you flash over USB. You can put a similar boot loader on the blue pill using your FTDI programming method or the ST-Link and then use USB from that point on - wiki.stm32duino.com/index.php?title=Bootloader. I personally prefer using the ST-Link so I can SWD debug. You also don't have to faf around with boot loader jumpers or resetting the board. I have 1 warning for you that caused me plenty debugging pain. If for any reason you configure the SWDCLK or SWDIO pins off in your flashed code you will lose the ability to use your ST-Link until the boot0 pin is enabled (putting you back into the default boot loader).
@RalphBacon
@RalphBacon 4 роки тому
I've tried _everything_ ever written on the Internet about getting that USB to work - all I ever get is _either_ an entry in my Hardware Devices for DFU Maple Mini, _or_ I get "USB device not recognised". The bootloader loaded fine (and is running) but it didn't do the magic. I used the bootloader with small sketch (6 flashes) that is supposed to get Windows to recognise the device, but to no avail. So now I think my time is better spent using either the FTDI dongle, or the ST Link dongle or using the Maple Mini if I want the USB to work as it does on the Nano. No big deal, I don't need the USB but it was a challenge I rose to but ultimately failed. Sigh. Thanks for the heads up on those flag settings, I will be careful!
@stompreaper
@stompreaper 4 роки тому
That’s unfortunate! I’ve had good experiences with 5 of the blue pills and 4 of the black pills from AliExpress. You must have got a special one :( I definitely prefer using the ST-Link and skip putting on a boot loader. You keep more program space and I use the ST-Link to single step debug. Much more useful in my use case. Maybe you will have better luck with another blue pill, I really do love those boards (minus the resistor fix).
@Ed19601
@Ed19601 4 роки тому
@@RalphBacon sometimes common sense wins from the need to find out every detail. It comes with age. I never got it to work with my STM board either, (bought some 3 years ago I think)
@Shubham-po2tp
@Shubham-po2tp 3 роки тому
@@RalphBacon I
@GeekMustHave
@GeekMustHave 4 роки тому
Thank you for taking the time to show the row of power for the Nano, STM32 and ESP32, you made this so much easier to understand. Keep Broadcasting!!!
@RalphBacon
@RalphBacon 4 роки тому
Glad you liked it! Thanks for posting, nice to hear from you.
@GeekMustHave
@GeekMustHave 4 роки тому
@@RalphBacon Aliexpress would like to thank you too, I got a few blue pills.
@coxsj
@coxsj 3 роки тому
Brilliant. Loving your vids Ralph. Thanks for taking the time to produce and share them.
@RalphBacon
@RalphBacon 3 роки тому
My pleasure!
@manoharmanu1460
@manoharmanu1460 4 роки тому
Your long videos and informative content really got me hooked onto electronics. Bought a stm32 recently didn't know how to use them, now I know I can ditch my nano
@RalphBacon
@RalphBacon 4 роки тому
Oh no, you don't want to ditch your Nano, it still has a place in your toolbox I am sure! But the STM32 is far more powerful, that's for sure.
@ticktock8751
@ticktock8751 4 роки тому
very good, it help me a lot, i am just waiting for my stm32 boards to come now
@RalphBacon
@RalphBacon 4 роки тому
Good luck with your project. Just check, very, very carefully, the the chip on your module is a genuine STM32, not a CKS32 or GD32 which can cause issues with the bootloader, if you were planning on using one.
@Ilikeridin
@Ilikeridin 4 роки тому
I’ve had this in my ebay watchlist for a couple of months but don’t get much time to play with my current boards recently but after watching the video, a couple are on order. I wish I’d noticed the video before I ordered three nano’s this morning. Although I only paid £1.20ish. Cheers for another video
@RalphBacon
@RalphBacon 4 роки тому
There's always room for another Nano in your life, Chris, but you will find the STM32 much faster. Thanks for posting.
@Ilikeridin
@Ilikeridin 4 роки тому
Ralph S Bacon can’t wait for it to turn up. Any idea what the over all current consumption is, when compared to a Nano? I’ll have a play and find out if not, in a few weeks at least. Cheers
@michaelhyde9971
@michaelhyde9971 4 роки тому
Great video as usual looking forward to see what the new bord is.
@RalphBacon
@RalphBacon 4 роки тому
Thanks for your post, Michael Hyde, good to hear from you.
@anispinner
@anispinner 4 роки тому
Awesome expertise, Ralph! And more importantly so much in time, love it; as I've also ordered a bunch of these just a few days ago (chinatown-delivery gonna take a while). Wasn't aware that they aren't flashable thru the micro USB from-the-box but knew that they don't have any UART converters like CH340, so it does make sense that you need to dedicate a bit of microcontroller's memory to flash a boot layer for the device to act like it has that converter built in. This is the amazing part of those boards that you can make any hardware device that is connected straight from a microcontroller to your PC avoiding any middlemen like CH340 with their restrictions!
@RalphBacon
@RalphBacon 4 роки тому
Well, it seems everyone is telling me that they _can_ be but I spent another fruitless 2 hours today trying to get that to work. I find the FTDI best so far, as you can then get the serial data (eg debugging etc) back to your Serial Monitor without any issue.
@anispinner
@anispinner 4 роки тому
@@RalphBacon Good point! I also don't see any issues flashing it thru FTDI. If we have those, why not use them? ;) Plus more memory is available to play with. I just now searched for how much memory the usb boot loader is taking and indeed it is grabbing an astonishing 20kb out of 64/128kb available! I'd rather pass on that one! :)
@englishrupe01
@englishrupe01 4 роки тому
Hi Ralph.....great video as always, thanks! About those jumpers, i had that problem too...but if you put a little length of solder wire through the inside hole you can pull it up easily! Just an alternative for others, as you dont need it any more...lol!
@RalphBacon
@RalphBacon 4 роки тому
Ha! That is definitely thinking out of the box! However, my long handled links are just brilliant (and dirt cheap). Thanks for posting.
@jmd28522
@jmd28522 4 роки тому
Al fin alguien que te enseña como la gente... Ya mismo me acabo de comprar un stm32 y un ftdi...... Vamos a ver como nos va.... Saludos
@RalphBacon
@RalphBacon 4 роки тому
Hola! Mucho suerte con su STM32 y FTDI. Vas a ver como tan facil es! Saludos!
@jeffbluejets2626
@jeffbluejets2626 4 роки тому
Great stuff. Once again a brilliant presentation.
@RalphBacon
@RalphBacon 4 роки тому
Glad you liked it, Jeff, it's certainly a pretty good board this one.
@rjinnh3933
@rjinnh3933 4 роки тому
As usual, Good Stuff from Mr Bacon.
@RalphBacon
@RalphBacon 4 роки тому
Thank you, glad you liked it.
@willofirony
@willofirony 4 роки тому
Awesome video, Ralph. I know you still have a lot to demonstrate on the STM but I have to jump the gun. What first drew me to the STM32 family was the built in RTC. i.e. a module on the chip that has ALL the abilities of the DS3232 (which cost you an additional at £3.20 [$4.00]) on eBay, but you get it FREE! on the STM32. The STLink is a lot cheaper inline programmer than the AVR ICE but has a lot of capability over and above uploading sketches . I do love this family. I still get a huge feeling of achievement getting a attiny85 to complete a project (my OCD response to employing redundant technology) but the price of STM32 modules can often result in a cheaper solution than using the ATTiny85s. No more spoilers. I look forward to your future enthusiastic videos on this device - and the enthusiasm is very appropriate.
@RalphBacon
@RalphBacon 4 роки тому
It's like the Arduino family has suddenly had a shot of jet fighter fuel, Michael. It's what the Nano should be today. But Arduino.cc see fit to release an €8 'every' version with a new chip but hide all the new features anyway. Sigh. As you say, it's early days for me on this hardware but so far so good. Thanks for posting, good to hear from you.
@JerryEricsson
@JerryEricsson 4 роки тому
Got it working! Had to set my device to STM Nucleo in order for PC13 to be accepted.
@RalphBacon
@RalphBacon 4 роки тому
I didn't have a problem uploading the bootloader, Jerry (via the [cloned] FTDI adapter), it flashed the LED and everything. It just would not connect to USB. USB Device Not Recognised, my a**e. Andrew, a viewer many thousands of miles from me has just confirmed that the one I sent him was fake - not a clone, a *fake* as it was marked STM32 but is most definitely not one. Sigh. More on order, they will probably just be chunks of plastic with metal legs, no internal chip at all. I'm glad you got yours working Jerry, but as you will see in this week's video which I'm about to upload, the lack of USB has not meant any difference to me at all. And I didn't have to give up the bootloader program space. Thanks for posting your experiences, great to hear from you again.
@Drone.Robotics
@Drone.Robotics 4 роки тому
Sir, your video helped me a lot to get started with STM 32 F103C...Along side your video, i was practicing on the STM 32 and noticed that the program will just get uploaded even if i don not shift boot loader pins from 0 to 1. Because ST link V2 is designed for STM 32 and they have managed to have minimum hassel with their own STM32 board during programming. So, i just wanted to add this that uploding can be done with out shifting bootloader pins. And Thanks a lot for that much great, informative yet helpful video.
@RalphBacon
@RalphBacon 4 роки тому
Thanks Saad, using ST LINK does indeed enable uploading without moving any jumpers, cool!
@DrexProjects
@DrexProjects 4 роки тому
I have a few of those STM boards also, They are great.
@RalphBacon
@RalphBacon 4 роки тому
Indeed. Things become popular for a reason and I guess flexibility, speed and price all make it a viable Nano replacement in the Real World, Drex.
@OsoPolarClone
@OsoPolarClone 4 роки тому
Another great video about a new board! Thanks.
@RalphBacon
@RalphBacon 4 роки тому
Thank you for your feedback, Bruce, noted and appreciated!
@epiendless1128
@epiendless1128 4 роки тому
Videos like this have got me started on the Blue Pill this week. :-) Using STM32 CubeMX and System Workbench instead of Arduino IDE. Things I wish I knew before I started: 1)When using ST-Link, there's no need to press reset or move those jumpers. But make sure your CubeMX project enables the SWD pins as Serial Wire Debug (System Core>SYS peripheral), otherwise you'll brick the Blue Pill and have to faff around with holding the reset button while connecting in order to unbrick it. 2)The 32.768kHz crystal pins are connected to the edge connectors. Breadboard loading made my crystal run at half speed. If you want the RTC, don't connect those ports to the breadboard! (I went the whole hog and cut the PCB tracks).
@RalphBacon
@RalphBacon 4 роки тому
I've used my programming PCB for the STM32 and it's been fine, so much so that I only tested the STLINK but then let it sit in my parts drawer. Interesting what you say about the RTC crystal, I wonder WHY it does that?
@AubreyKeck
@AubreyKeck 3 роки тому
Nice. Liked your explanation. Convinced me to finally try a couple.
@RalphBacon
@RalphBacon 3 роки тому
You should! Very fast.
@mUbase
@mUbase 4 роки тому
Ha. Thanks to your video I finally bought a Blue pill board. I've got an STM32F4 discovery which I've had for years and still love but hey, you can never have too many boards.:)
@RalphBacon
@RalphBacon 4 роки тому
That's my mantra, Stephen never enough boards. Have fun with your STM32 blue pill.
@29C1C
@29C1C 4 роки тому
You don't need to change the boot header when uploading using the st-link, you only need to do that when uploading using the serial adapter, don't know if someone else pointed it out in the comments section though. And nice video btw
@RalphBacon
@RalphBacon 4 роки тому
Thanks for that, Mohamad Bilal, nice to hear from you.
@stewartrv
@stewartrv 4 роки тому
Wish you had done this a couple years back when I was trying to figure all this out! :) I was able to get it working after a bit of googling. What I like about them which you didn't mention is that the A2D converters are 12 bit instead of 10 bit. It can be quite handy when you want a bit more accuracy. For example you could make a little DC voltage/current/power meter with a few resisters and a cheap LCD. An ESP32 would definitely be overkill for that.
@RalphBacon
@RalphBacon 4 роки тому
No, I didn't mention the 12-bit analog pins but I did reply to a question here somewhere saying exactly that! Something to mention in a future video, I think. But my next video is all about---- oh, sorry no spoilers.
@superdau
@superdau 4 роки тому
Not only that. You got two real ADCs that can be interleaced in conversion and use DMA to just write the results. You can do some seriously high speed aquisitions with that, while the CPU is essentially doing nothing, just waiting for the DMA to fill up the memory (and then just dump out all the data over an UART, again with DMA, while the CPU sits idle).
@JerryEricsson
@JerryEricsson 4 роки тому
Thanks, I have had one of these little deals in my box now for about 4 years, never have figured out how to make it do anything but just sit there and make me angry! I bought the little programmer as well but just could not get it going, now if I can just remember where I threw it last time I tried to make it work.....
@RalphBacon
@RalphBacon 4 роки тому
Dig it out, straighten all the bent pins (as it hit the wall) and you will be good to go, Jerry!
@Thomas72B
@Thomas72B 4 роки тому
I've been using the STM32 for a while. The board is just great! With ebay you can also get the 128k version of the STM32 with a little luck. Great video !!
@GnuReligion
@GnuReligion 4 роки тому
Every raw stm32f103c8t6 I have bought advertises 64k, but addresses correctly to 128k, like a cBt6. Bonus.
@RalphBacon
@RalphBacon 4 роки тому
I haven't tested that theory that @GnuReligion states, but everyone says it so it must be true. Bonus! Thanks for posting, Thomas.
@Thomas72B
@Thomas72B 4 роки тому
I do not know the theory @GnuReligion. What or who is that ?
@GnuReligion
@GnuReligion 4 роки тому
@@Thomas72B It is the Divine Truth of a Gnu World Order, oh ye of little faith, Doubting Tom. When you add the board manager below (restart), you will get a drop-down for memory size in the IDE for 64/128k. If doubt persists, you can select 128k, then (m)allocate a 100k array within a sketch ... or just look at the status after uploading (will show the number of bytes flashed). dan.drown.org/stm32duino/package_STM32duino_index.json
@boonedockjourneyman7979
@boonedockjourneyman7979 4 роки тому
I've been your biggest critic. But now, you are making sense to me. This sort of big picture video really helps. Please stand back from all the Arduino cancer and do more 50,000' stuff. You're good at it.
@RalphBacon
@RalphBacon 4 роки тому
Thank you for your feedback, Boonedock Journeyman, noted and appreciated! Phew!
@JerryEricsson
@JerryEricsson 4 роки тому
I have this thing for through holes on pc boards. If they are designed for pins, I simply have to solder them in. Because of this, I once ordered a large number of them and keep them on my bench for quick application. So it is, I have several of the FTDI serial boards, all with the pins soldered onto the sides of the board, I find that many times when running a 3 volt board there is a requirement for a 5 volt input on a board hooked up to the system or some such craziness, you can hook directly to the side ports to get 5 volts in the 3.3 mode, or conversely 3.3 volts off the 5 volt setup. I have found times when I needed a separate reset from the serial and hooked to the reset pin on the side as well as the one on the back for the main chip. Lots of crazy things can come up that are easily solved by simply adding a few pins to the side of the FTDI boards.
@RalphBacon
@RalphBacon 4 роки тому
Indeed, you are correct. My FTDI has a jumper for 5v or 3v3 but I also use some of the side pins in my STM32 programmer.
@KunalGautam
@KunalGautam 4 роки тому
With STLink you can flash program without changing jumper position, only it need to be changed if flashing using FTDI.
@RalphBacon
@RalphBacon 4 роки тому
Indeed that is true, but the serial data (Serial.print etc) can't send its data up the ST Link channel.
@andrewsmallridge49
@andrewsmallridge49 4 роки тому
Hi Ralph, I have built a few projects using the Bluepill. Funny thing is, I have no problem using the USB with windows 10 using multiple PCs and notebooks without any modifications to the board and use the STM32duino bootloader to program the device from the Arduino IDE. Bootloading using the USB means it does not require a FTDI USB to serial adapter.
@RalphBacon
@RalphBacon 4 роки тому
That's called Rubbing Salt into The Wound, Andrew. 😝 I don't know why I have so much trouble, both on my PC and my laptop with this device. But if you watch this week's video you will see my current, temporary(?) solution!
@hua.g
@hua.g 3 роки тому
2021 update: STM32duino now makes it(the blue pill) a lot easier to use the usb port to program via arduino ide. You just need to flash their new bootloader via USB to UART and it's done.
@RalphBacon
@RalphBacon 3 роки тому
I'll have to try this once my workshop is up and running. Thanks for the info.
@hua.g
@hua.g 3 роки тому
@@RalphBacon Yeah mate, the new bootloader is from Serasidis in github and should be flashed with the official STM32CubeProgrammer via STLink or UART. It's made to be used in conjunction with the official STM32duino repo and requires no usb drivers.
@adammatic
@adammatic 2 роки тому
Tried it today, I've got like half dozen blue pills from a few years ago. This one: ukposts.info/have/v-deo/hamgom5_aGdisYU.html Worked on most the chips, with some exceptions, not sure if I have a bad chip or something. UART, STM32Cube, latest HID 2.2 or something like that, Needs a lot of reseting.
@bobsort
@bobsort 4 роки тому
Thank you for the video. I didn't know I can program it with regular FDTI too, still have to figure out the configuration. I noticed you have added a resistor to the board. do you mind telling me what is it used for?
@RalphBacon
@RalphBacon 4 роки тому
The resistor was to correct a 'mistake' in the board; the value should have been 1.5K but was 10K. That said, it made no difference as it was the 'fake' STM32 chip that was the issue not the resistor! I've now managed to get an older bootloader installed and the entire module now works as expected. But my FTDI board works like a dream too and it make be re-evaluate bootloaders and USB connections not just for this board but for all my µControllers generally!
@bobsort
@bobsort 4 роки тому
Thanks Ralph, that was fast.
@sidaliakil
@sidaliakil 4 роки тому
Hello Ralph, it will be very nice to help us to know how we should do to make our microcontrollers adaptable for industrial use, like main protections against hard environments. Thanks a lot. And is arduino suitable for industrial scope by some components changing.
@RalphBacon
@RalphBacon 4 роки тому
To use an Arduino in an industrial environment you will need to make your own PCB with suitably selected industrially-related components. It must be sealed against dust and dirt. Not a cheap thing to do.
@Roy_Tellason
@Roy_Tellason 4 роки тому
For those silly little jumpers, and for fine wire work when I build on perfboard, I like a small (4") pair of long-nose pliers. Or "needle-nose", if you prefer.
@RalphBacon
@RalphBacon 4 роки тому
Yes, I have (several) of those, but I find the "handle" version of the jumpers very useful too.
@thetechcompany2468
@thetechcompany2468 4 роки тому
Hello Ralph, I am new to micro controllers and have been learning a lot from your videos. Thank you for sharing your knowledge and expertise. I have had some very good success (so far) with the ATMEL based microprocessors but have run out of program storage space. So, after seeing your videos on STM32, I decided to give the Maple Mini a try. Every time I upload a sketch to the Maple Mini, it appears to be uploading then the Arduino IDE throws a "Access Denied" error. I believe this happened in one of your videos but since your focus wasn't on the Maple itself, you seemed to just move past it. I would really appreciate any advice you can offer on this...too may late nights and my brain is numb from trying to figure this out.
@RalphBacon
@RalphBacon 4 роки тому
If the upload seems to work and THEN you get the Access Denied you can ignore it, the sketch should have uploaded OK. Do you get a port enumerated eg COM15 (Maple Mini) on your PC - so the IDE knows where it is?
@1over137
@1over137 Рік тому
Finally! He sees the light and uses the STLink. I couldn't watch the other two videos. I spent too long there myself before I stopped trying to make the STM32 an arduino and started to use it as intended. I think in fairness the Black Pill could probably parallel emulate about 20 Nano's.
@stevenbliss989
@stevenbliss989 Рік тому
STM32 on Arduino platform is good to get it known, but beyond that, hardly good to use for it's abilities, ...totally agree. Also, the 411 is my favorite too, ...when you need i/o abilities and decent cpu speed. At the extreme other end, I love the Padauk PMx13x series, for the money they are great for tiny projects you are going to make at least a few hundred of, ...the toolchain (if you can call it that), not so much. :)
@RalphBacon
@RalphBacon Рік тому
"I think in fairness the Black Pill could probably parallel emulate about 20 Nanos". Yup. But sometimes we don't _need_ that much processing power! 😲
@stevenbliss989
@stevenbliss989 Рік тому
@@RalphBacon Yep, it's a matter of engineering time & hardware cost optimization, even if you use overpowered hardware in some cases. The $ and getting the job done that counts at the end.
@isaacclark9825
@isaacclark9825 4 роки тому
The compiler flags are for the executable speed rather than the code speed with O3 being the fastest running speed. The code may be a bit larger than the unoptimized code.
@RalphBacon
@RalphBacon 4 роки тому
Yes, several others have pointed that out to me, Isaac, and I've done some tests. Bigger code, faster execution (mostly). But it's borderline!
@amtpdb1
@amtpdb1 4 роки тому
Just found this video and it is great. I was wondering if you mignt show how to program a samd21 chip with a jlink or ?? programmer. I need to put a arduino bootloader on one of these chips for a project. Can you put a program on the samd21 direct with out installing a bootloader. The way you present what you are working on seems to be straight forward and clear. Thanks again for your efforts to teach us.
@RalphBacon
@RalphBacon 4 роки тому
You can easily put a program on an Arduino (whatever the chip) using the 6-pin ICSP socket, and I do this often. The bootloader is purely there for convenience so you can upload a sketch via the USB cable which you probably have connected to power it up and read the debugging Serial.print messages. In the first instance I recommend you check out my full list of videos (in each of my GitHub repositories) as I demo this often.
@amtpdb1
@amtpdb1 4 роки тому
Ralph S Bacon Thanks for the information. I will try to find out where this information is and how to use it. I am afraid it might be over my head 😖 .
@MUHAMMADYAWARIFRAHEEM
@MUHAMMADYAWARIFRAHEEM 4 роки тому
Very informative video
@RalphBacon
@RalphBacon 4 роки тому
Thanks for your post, MUHAMMAD YAWAR IFRAHEEM, good to hear from you.
@rentabomb
@rentabomb 4 роки тому
Good video. Keep them coming ;)
@RalphBacon
@RalphBacon 4 роки тому
Glad you liked it David, thanks for posting.
@MrEdwardhartmann
@MrEdwardhartmann 4 роки тому
Another great thing about the Blue Pill is that it supports 16 external interrupts. I was working on a project to interface to a Bally pinball machine and I need 6 external interrupts to catch some unclocked signals coming out of the Bally MPU and none of the Arduino family could support that.
@Bob_Burton
@Bob_Burton 4 роки тому
"none of the Arduino family could support that." Except the Mega, Mega2650, MegaADK, Zero, MKR boards, Due and 101 that is
@MrEdwardhartmann
@MrEdwardhartmann 4 роки тому
@@Bob_Burton I forgot to add that it needed a form factor similar to the Arduino Nano that would mount in a DIP socket on another board. It had to have at least 15 I/O pins with at least 10 pins being 5V tolerant, plus SPI and at least one analog input. I ended up using 26 I/O lines on the Blue pill design I came up with plus the MOSI and SCK lines for a total of 28 I/O lines. Plus, I got 10 of the boards with free shipping from AliExpress for under $17
@RalphBacon
@RalphBacon 4 роки тому
It certainly is compact and capable. And I've only scratched the surface so far, Edward. Thanks for posting.
@robertschmidt6360
@robertschmidt6360 4 роки тому
You should give the STM32CubeIDE a try. It's a new IDE released for STM Controllers a few months ago which includes a complete toolchain with gcc-Compiler. You can configure the needed peripherie by an graphical configurator and this IDE is based on Eclipse, so you can take advantage of the built in texteditor. Arduino may is a good IDE to get in touch with Embedded Systems, but as soon as the Projects get a little bit more complex it prevents you from developing clean and effective Code. Sorry for my bad english :)
@RalphBacon
@RalphBacon 4 роки тому
I can program the STM32 with my "Arduino-ised" version of Eclipse right now so I wonder what the differences are? I shall investigate and report back!
@mUbase
@mUbase 4 роки тому
I use CUBEIDE with my F4 discovery board. Its good isnt it!! . I LOVE the F4 disco. A few years ago I found Roger Clarkes STM32 for Arduino project and managed to get the on board audio codec working using I2S and I2C which was fun. I prefer using the Cube though. :)
@superdau
@superdau 4 роки тому
Calling the Arduino "IDE" a "good IDE", or even just an IDE, is an insult to all actual IDEs (and even to some text editors). I use Eclipse for STM32 stuff (was a pain to setup including the hardware debugger, but once it's running, it's running). For simpler projects (that is Arduino) I use atom/platformio. Pretty much everything worked out of the box there. If I were the Arduino developers I'd just tell people to scrap the Arduino IDE and use platformio. That's how bad the Arduino IDE is.
@psubond
@psubond 4 роки тому
With the stlink you can leave jumpers in run
@Ed19601
@Ed19601 4 роки тому
Good to know
@RalphBacon
@RalphBacon 4 роки тому
But you don't get the serial data back to the Serial Monitor. the FTDI (or another USB-to-Serial modules) allows that, of course.
@mrchickene1805
@mrchickene1805 4 роки тому
Did you notice that once in the video you said JCLpcb (@ 23:47) instead of JLCpcb? I bet you worked on IBM mainframes didn't you? So did I. Thanks for showing this.
@RalphBacon
@RalphBacon 4 роки тому
You got me, Dennis! Yes, I've worked on ICL, IBM, AS400 and others I've forgotten about, before moving to the micro world. I was even pretty good (in my time) in writing JCL! But JLC are pretty good too!
@flingmonkey5494
@flingmonkey5494 4 роки тому
Have you ever thought of attaching that 3-pin jumper to a toggle switch for development purposes? Then you could toggle between run and program by flipping the switch, and once you are done developing you just replace the switch with a jumper in the run position.
@RalphBacon
@RalphBacon 4 роки тому
Hush! Fling Monkey, do you want to spoil _all_ my video surprises?
@flingmonkey5494
@flingmonkey5494 4 роки тому
@@RalphBacon Hehehe, perish the thought!
@TBoy58_405
@TBoy58_405 4 роки тому
Hi Ralph Using ST-Link I think you can leave the jumper in the run position for upload and run. I.e. you never have to move it. Try it. Nice vid thanks.
@RalphBacon
@RalphBacon 4 роки тому
Yes you are correct, Pete, except my ST-Link is no longer recognised by Windows. One minute OK, then next foobar. I have others on order to determine whether it is Windows (again) or my ST-Link that is at fault. Glad you liked the video.
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist 4 роки тому
I like to have an arsenal of chips up my sleeve, ESP8266 small Wi-Fi attached devices like mains switches, temperature monitors etc. ESP32 Wi-Fi but require more computing power. Microchip Pic's for small low powered things, standalone projects. Arduinos for throwing something together fast. I think there is no one stop shop microcontroller that fits all, maybe it time to see if there is a slot for an STM need to get the Arduino working with Eclipse as I'm getting fed up their ide. Did I say great vid as always
@RalphBacon
@RalphBacon 4 роки тому
I agree. Horses for courses, as they say! Getting the Sloeber version of Eclipse up and running is pretty quick now. It's what I use all the time. I might be trying Visual Studio Code soon though!
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist 4 роки тому
I've not thought of looking at visual studio. I use vs at work with C# to make front end user interfaces for system control and EMC testing. I'll put o It on my list of things to do when I retire which is not far away now.😁
@mditz4777
@mditz4777 4 роки тому
I recently picked up a pack of 2. Same as you, I could not get the USB to work, but I do have an FTDI cable from my Arduino Pro Mini. Everything worked nicely EXCEPT, I had to do a hard reset every time I performed a power on/power off cycle in order to get the code to run. I eventually just went ahead and put an Arduino Pro Mini in the project instead. And yes, those jumpers are a huge hassle.
@ralphmaasgmailcom
@ralphmaasgmailcom 4 роки тому
Hi Michael see this video: ukposts.info/have/v-deo/r3eTnYptgK54sWQ.html
@RalphBacon
@RalphBacon 4 роки тому
Hmm, me neither, Michael. Well, not totally true, but you will have to wait for the next video for the details.
@superdau
@superdau 4 роки тому
Get an ST-link programmer. No need to fiddle with the jumpers anymore and you can use it as a hardware debugger as well. The USB port is fully useable (as an "virtual" UART for example), but the F103s can't use USB for their bootloader (there are a lot of other higher specced STM32s that have the USB available in the bootloader). That is the unbrickable bootloader, that's there in hardware ROM. You can flash your own bootloader (takes up flash then obviously) so you can use USB in the bootloader, if you need to.
@Leif_YT
@Leif_YT 4 роки тому
Hi, thanks for the video. I just got my first one and I've one question - is there a way to use the st-link for Serial monitor? Since there is no com port I can't get it to work with AruinoIDE or PlatformIO. Flashing works fine, but not the monitor.
@RalphBacon
@RalphBacon 4 роки тому
I'll be honest here, Leif, although I got a sketch uploaded with the ST-LINK, that's as far as I went. I don't know whether you can get it to emulate a UART (might take some mods, and Googling). Easier way is to use a standard FTDI (or other brand) USB-to-Serial adapter. It only requires three wires: VCC, GND and the RX on the adapter which connects to the TX of your STM module. It's what I use and it's very reliable. The (cloned) USB-to-Serial modules only cost a couple of dollars. I also use them with "barebones" Arduinos (which don't have USB ports). I hope this helps. Let me know!
@Leif_YT
@Leif_YT 4 роки тому
@@RalphBacon Thank you for the reply. I played a little bit around with it last night and to get a serial monitor connection the FTDI really seems to be the easiest - that worked fine for me. One thing I really like about the ST-Link is that it allows inline debugging within PlatformIO.
@noweare1
@noweare1 4 роки тому
I have used the stm32 based boards in the past and was impressed by the capabilities. You do not have to worry about running out of memory. Lots of registers but that just reflects the additional capabilities you have compared to an arduino. I do like the simplicity of an 8 bit micro and it's straight forward reference manual. Most times you do not need the speed or accuracy of these higher end micros. I did an audio project one time with an arduino uno and it was terrible. I am sure the blue pill would of made the audio much better quality.
@RalphBacon
@RalphBacon 4 роки тому
The Blue Pill is much faster, Joey, and it's 32-bit so you would rightly expect better performance for audio (not an Arduino strength).
@Thomas72B
@Thomas72B 4 роки тому
You do not always have to recompile everything! You can also simply use a programmer to load the HEX file into the microcontroller. The HEX file created by the Arduino IDE can be found at: C: \ Users \ Owner \ AppData \ Local \ Temp \ arduino_build_810344!
@RalphBacon
@RalphBacon 4 роки тому
Yes, that's true, Thomas, but the Arduino IDE doesn't do that. It compiles (not everything, I exaggerated) but more than say the Eclipse IDE does with just a sketch (code) change.
@glenncrice
@glenncrice 4 роки тому
Hi Ralph, After watching this video I was inspired to look at installing the bootloader again. Way back in December of 2017 I got 5 of these. I went throught the process of installing the bootloader on one of them, as well as changing the R10 resistors to 1k5. The bootloader worked with out a problem on that first one. I never tried to put the boot loader on the other 4 as I had also purchased an ST link V2 clone and had always used that. To cut a long story short, I decided to bite the bullet and do the bootloader on the other 4. I downloaded the generic_boot20_pc13.bin from the Roger Clarke's github and flashed it onto the other using the ST link, guess what .... none of them worked! After two long days and nights of trying everything I could think of, I finally gave up and went through my backups and found the original bootloader bin file I had installed in December 2017, flashed that and to my complete surprise it worked! I had a look on github and tracked down the original file, it's dated 9 Aug 2017 and can be found here - github.com/rogerclarkmelbourne/STM32duino-bootloader/blob/d19bcaf1ef044eb5e09b772f7a1d7c158c3c2976/binaries/generic_boot20_pc13.bin I don't know what the problem with the latest bootloader is but for me at least the older one works perfectly. I make no promises but maybe this will fix your issues as well. Best regards, Glenn
@RalphBacon
@RalphBacon 4 роки тому
So at great expense I dug out my lovely PCB with embedded FTDI programmer and loaded up this ancient bootloader. I must say that serial PCB has done me lovely service. BUT NO MORE! I tried both a GD32 and a CKS32 and they both accepted the old bootloader (nothing special there) but once connected to my PC *they were both immediately identified* as a Maple Serial (COM15). It takes a few seconds for it to be recognised, BUT RECOGNISED IT WAS! Amazing. So what you have discovered, Glenn, is that the bootloader has been changed for the genuine product but it has broken the GD32 and CKS32 clones. Oh, just to be absolutely sure I uploaded the infamous blink sketch (suitably modified by me to do a double blink) and it all worked. I'm gobsmacked! Kudos to your tenacity Glenn, and sleuthing skills. I shall let others know when I next do a video on the STM32. I might steal the credit and pretend it was all my work. Oh drat! I shouldn't have told you. Oh well, credit where credit it due! Greatly appreciated. Thanks so much!
@glenncrice
@glenncrice 4 роки тому
@@RalphBacon Hi Ralph, I'm glad it worked for you. In actual fact mine are all original STM32's not GD or CKS's. I'm not sure which Blue Pill boards will work with the latest bootloader but mine certainly didn't. Interesting to note is that the bootloader is supposed to pull the USB D+ line low for a short period to trigger reset and re-enumerate the USB ID. When looking at the D+ line with my scope this was clearly seen on the older bootloader but was completely absent on the newer one. I'm just happy that it works as it should! Now that I know it works for you as well (and as soon as I have some spare time) I'll raise it as an issue on the ST32duino bootloader Github. Hopefully it'll save someone else form going through the frustration that we have. Cheers, Glenn
@RalphBacon
@RalphBacon 4 роки тому
The genuine STM32s that were sent to me from the UK suppliers recently (after this video) all took the _standard_ (current) bootloader and worked as I described. This gets weirder by the day, don't you think, Glenn?
@glenncrice
@glenncrice 4 роки тому
@@RalphBacon That is very interesting! The cynic in me has to wonder if this is a sneaky way to mess with the clone chip manufacturers? Another FTDIGate? However the realist in my subscribes to the Hanlon's razor theory - "Never attribute to malice that which is adequately explained by stupidity." It's probably some small change between revisions that no one thought to test backward compatibility on. I did do a quick search on ST's website to see if I could find revision histories for these chips but nothing jumped out at me in the 5 or so minutes of looking. I think it would be good if you could put this info out there next time you're doing an STM32 video. I'm sure that there must be quite a few people out there who have been frustrated by this and just given up. I will still try and raise an issue on the STM32Duinobootloader github when I get a chance. Even just a note on their front page with a link to the older bootloader would probably save some people a lot of wasted time. Cheers, Glenn
@caffeinatedinsanity2324
@caffeinatedinsanity2324 3 роки тому
Black pill boards seem to have a USB boot loader. I even checked the uC's datasheet and i can confirm that. As for the blue pill, datasheet only said that it has a USART1 bootloader. The USB port isn't just a programming port like with an arduino, because the stm32f103c8 has a usb peripheral inside. I even programmed it to behave like a mouse with a joystick with STM32CubeIDE. And because it was a big sketch, I personally don't recommend burning a usb bootloader in the blue pills if you want to eventually move on to bigger projects. (The blue pills I have are genuine. Bought these for about 7-8$ CAD per unit)
@RalphBacon
@RalphBacon 3 роки тому
The Black Pills use a slightly different microcontroller - shall we say "improved"? But they are not particularly cheap (hence no Asian clones to speak of) but I do hear good things about them.
@maxstripeGaming
@maxstripeGaming 2 роки тому
i found 3 packs of genuine ones for 12$ a couple months back on amazon
@gargaroblaster
@gargaroblaster Рік тому
Hey Ralph, I have a few clones of this board (yeah, the "fake" ones) that I got for like $2 each a couple of years ago and I recently finally got some time to test. Using the STM's IDE was easy with the ST-Link v2 (a cheap clone again), but I wanted to use the USB and the Arduino IDE. So I am running Windows 11, I struggled a few hours (watching some videos and reading some blogs), but finally got it working with the right bootloader and drivers. Now I can upload the sketches with Arduino IDE and use the serial monitor for prints just like the uno/nano without any issues. I'll have to trace back my viewing history just to remember exactly which guide helped me figure things out.
@RalphBacon
@RalphBacon Рік тому
Glad you got it working with some perseverance. I found that the "fake" STM32s would work fine if I loaded up an older bootloader (on my GitHub). Being fake I guess they are not ideal but seem to work well (and quickly) enough to act as a Nano replacement.
@xDR1TeK
@xDR1TeK 4 роки тому
Hi Ralph, Loved the vid. I went out and bought some. I like working out the engineering behind this stuff. So how do you load a bootloader onto the ST chip in the first place, if it were a mere chip without a board? I imagine the firmwares and binaries from github, right? Or, if one is about to use the Arduino IDE, which presents by itself a good library resource, I imagine the bootloader would definitely be crucial for guiding the flash procedure where to land its start location. What if you dispensed with all this bootloader stuff, just wrote directly to boot0. No bootloader at all. Wouldn't that work as well? I'm curious about the design decision for bootloader operations. I have an engineering degree, but the embedded part was not immediately available for myself as an academic direction, RF and analog person.
@RalphBacon
@RalphBacon 4 роки тому
And I do dispense with all the bootloader stuff many times, not just for this chip. Not only does that give you more room for your code (albeit these days only 500b or so) but the code starts running _immediately_ (with no pause whilst the bootloader checks for updates). If you look at my video #155 you will see my PCB for this Blue Pill (and clones) with room for an FTDI USB-to-Serial uploader. Works like a dream. Someone mentioned I could have used one further pin from the FTDI to auto reset the STM32 but it has not been a hindrance to me, so far! Any good?
@xDR1TeK
@xDR1TeK 4 роки тому
@@RalphBacon More than good, Perfect. Thanks.
@jacksonshelton8055
@jacksonshelton8055 4 роки тому
if you want lots of control over the peripherals of the stm32, use stm32cubeIDE to make the code, get the ST flash loader demo, get the compiled .bin from C:/Users/yourname/STM32cubeIDE/yourproject, and upload it using an FTDI serial adapter. There’s a tutorial somewhere on youtube for it, but that’s the best way to get your code onto the blue pill other than the USB bootloader and the arduino IDE.
@RalphBacon
@RalphBacon 4 роки тому
You may have noticed that I tend to use Eclipse to code (closer to MS VS) but I've not used CUBE - something I should look at. That said, the new Arduino IDE will probably cover the STM32 and many other boards too. I'll see what happens this year.
@thomaswilliams266
@thomaswilliams266 4 роки тому
@@RalphBacon CubeIDE is just eclipse packaged with ARM toolchain and CubeMX. You can use CubeMX standalone to generate all the nasty initialization stuff and code in a number of IDEs (including eclipse). Give it an afternoon and you'll find it's just as easy as using the Arduino stuff, but everything is implemented and portable across other STM32 MCUs and you get all the nice stuff that comes along with better tools.
@MrEdwardhartmann
@MrEdwardhartmann 4 роки тому
Ralph, I have been using the Blue Pill in projects for several years and have had about 5 boards build by JLCPCB to carry them. I have been using the USB port and STM32duino bootloader without any problems on Windows 10. I found everything I needed to set the whole thing up on RideLifeWithGrace's website. The best thing about getting the bootloader installed is that you no longer need to move the jumpers and most times you don't have to even hit the reset button. If you have not seen it, check out RideLifeWithGrace's video - ukposts.info/have/v-deo/gmeUqJp9mHiLk2Q.html . The only problem with the video is that it is not narrated - all the instructions are typed on the screen. But, it is still the best resource I have found. And if you have not found it already, check out www.stm32duino.com/ - it's a great board with lots of help topics.
@GnuReligion
@GnuReligion 4 роки тому
Yes, the first thing I do with a Blue/Red/Black Pill is to put the Maple bootloader on there, so it is programmable/debug-able from the Arduino IDE (avrdude) directly, without the need for a USB/Serial bridge. Make your own STlink-like device with a Pill board, on the cheap, using the BMP (Black Magic Pill) software. stm32duino is a great resource.
@RalphBacon
@RalphBacon 4 роки тому
Well, Edward, I had intended just to give up on ever getting it to work but maybe one more shot is worthwhile. Your info and link greatly appreciated, thanks for posting.
@TYGAMatt
@TYGAMatt 4 роки тому
Thanks Edward. Wish I'd used your method first. Bootloader went on with minimal issues. Good job Sir.
@MrEdwardhartmann
@MrEdwardhartmann 4 роки тому
@@TYGAMatt don't thank me - thank RideLifeWithGrace - they did all the work. As a matter of fact, I just rebuilt my computer about a month ago and had to go back and re-watch the video so I could get my Arduino IDE set up correctly to work with the BluePill. I actually tried to do it myself for about two weeks before I went back and watched it and 15 minutes later, it was all working.
@TYGAMatt
@TYGAMatt 4 роки тому
@@MrEdwardhartmann Yes I will go and say thanks now...... Done!
@pacsmile
@pacsmile 4 роки тому
The micro usb does work, you just have to check underneath the board, there are 2 resistors, one of them is wrong and you have to replace it, some boards doesn't even come with the resistor and you have to add it.After that you can actually upload a sketch that lets you run a virtual com from that usb, so you can flash the micro with it.
@danljohnston
@danljohnston 4 роки тому
Could you be more specific, my board has 8 resistors on the bottom.
@englishrupe01
@englishrupe01 4 роки тому
@@danljohnston Find R10. This will help you: wiki.stm32duino.com/index.php?title=Blue_Pill
@RalphBacon
@RalphBacon 4 роки тому
Done that. Made no difference at all. I would think it my Windows PC but it does the same on my laptop. But the war is not yet over even if I've lost the current battle...
@pacsmile
@pacsmile 4 роки тому
I followed this guide amitesh-singh.github.io/stm32/2017/05/27/Overcoming-wrong-pullup-in-blue-pill.htmlThis worked for me, maybe your board have other issues?, did you try with another bluepill?
@mditz4777
@mditz4777 4 роки тому
I tried with both boards I received. I have a ton of 0805s laying around so it was an easy enough task. Yes, they're a bit big but fit fine and connections tested. Neither board worked unfortunately
@hello235698741
@hello235698741 3 роки тому
You can upload a USB flash bootloader. It will eat up 8k of flash but theres still 64k left, which is plenty. I did this to mine, can flash from the arduino ide.
@RalphBacon
@RalphBacon 3 роки тому
I'll try this for sure.
@Dust599
@Dust599 4 роки тому
I had though it was a red pill / blue pill reference to the matrix... I will happily continue to think this.
@RalphBacon
@RalphBacon 4 роки тому
Yes, yes, that is exactly right, Peter. Blue Pill, Red Pill and there's a Black Pill too unobtainable pretty much these days.
@victoriavickers33
@victoriavickers33 Рік тому
love your work and of course you make it look soo simple. I watched this video and ordered my stm32f103 from China. Tried to use FTDI failed, ordered STlink no brainer. Now I am lost with lots of zips , bins and snippets all over the show. One question could you try loading sketch to STM32 using Raspberry Pi running PlatormIO. Or do you know of another UKpostsr who has. Again love your vids from downunder.
@RalphBacon
@RalphBacon Рік тому
When I get smothered by zips and bins and other files for a new processor I just move them all to an "archive" folder, off the (beaten) path and start again. That way you know what is being picked up, and from where. Unfortunately I don't know how to upload using a RasPi (although you probably know I use the PlatformIO on VSC all the time). From your comment, I'm guessing that just specifying the upload_port doesn't work (not least because the RasPi is running Linux)? Someone must have cracked this; Google could be your best friend, or just search UKposts. Using USB did not work with some of my STM32s because they were fakes and the bootloader could not work in it. I reverted to a much older bootloader for the STM32 and that worked fine. I'm pretty sure details are in the video description for this video (or GitHub if there is one for this video). I'm not sure ever got FTDI working with them (dim and distant memory now, I'm afraid). Good luck and thanks for your supportive comments 👍
@victoriavickers33
@victoriavickers33 Рік тому
@@RalphBacon Thanks for the reply will start again from beginning. See how that goes.
@bratwizard
@bratwizard 4 роки тому
The USB works fine. But you might have to replace R10 and flash it with a USB bootloader. Google for instructions.
@RalphBacon
@RalphBacon 4 роки тому
Thank you for your feedback, John Whitten, noted and appreciated!
@pierrebecam9452
@pierrebecam9452 3 роки тому
Nice video ! Can i use a ftdi TTL-232-3v3 cable to program the stm32f103c8 ?
@RalphBacon
@RalphBacon 3 роки тому
Yes, it's what I use in my programming PCB.
@pierrebecam9452
@pierrebecam9452 3 роки тому
@@RalphBacon thx
@rjpeterson1
@rjpeterson1 3 роки тому
Ralph, what IDE were you using for the Speed test upload? (Time 25:30)
@RalphBacon
@RalphBacon 3 роки тому
That would be Eclipse (Sloeber) but wait for the new Arduino IDE later this year which is also based on Eclipse.
@saturdayscience5540
@saturdayscience5540 4 роки тому
Hi Ralph and thanks for another very interesting video. I tried the dandrown STM32 install for Arduino IDE but it fails to get SPI working properly; the MOSI, CS both work correctly but CLK randomly decides to pulse. It isn't at a wrong frequency and it is limited to when SPI activity is expected. Have you run SPI using the dandrown/Arduino SPI library? [ps I fully appreciate that you are not responsible for dandrown or Arduino SPI just wondering if you had used the SPI bus on STM32?]
@RalphBacon
@RalphBacon 4 роки тому
I haven't tried the SPI on the STM32 yet, Michael, but first questions first: are you using a proven, genuine STM32 / Maple Min or some sort of clone? If not, try it with an STM32 from a reputable source - it may cost a little more but it will prove the SPI functionality (which I can only assume works 100%, at least according to Roger Clarke's website). github.com/rogerclarkmelbourne/Arduino_STM32/wiki/SPI
@saturdayscience5540
@saturdayscience5540 4 роки тому
Hi Ralph - I'm using a clone. I will try and source a 'genuine' STM32 but I'm all spent up for the moment :) Mike
@saturdayscience5540
@saturdayscience5540 4 роки тому
@@RalphBacon I got my setup sorted by changing SMT32 library. I removed the dandrown library and installed the 'official' ST one. It is a monster library; it takes so long to install it is a case of go and have a meal with coffee afterwards. At one point I honestly thought the process had crashed so took a look in Task Manager and it was running 25% CPU. A couple of points with the ST library: 1) you can't use a uart to programme the board so I used ST-LINK-V2 [clone] by selecting "STM32cubeProgrammer (SWD)" option. 2) to use the ST-LINK_V2 you have to install STM32cubeprog software. That gets programming done super fast (and no boot 0 / reset required). And SPI ran straight out of the box. Mike
@RalphBacon
@RalphBacon 4 роки тому
So the Dan Drown library has some sort of issue with SPI using a clone chip, I guess? Not unsurprising but a pity it was not at least tested using a variety of clone chips so we had a heads up. Thanks for the information, very useful.
@thanosk4644
@thanosk4644 4 роки тому
Hi Ralph. I found your channel while searching for a solution about STM32 not recognised as usb device. The last 6 stm32 bought from ebay from 2 different suppliers have this problem after flashing the bootloader.You mentioned that you found an older bootloader with which your module works as expected.Where can i download this booloader? Thank you
@RalphBacon
@RalphBacon 4 роки тому
Welcome to my channel, Thanos. I've uploaded the older bootloader into my GitHub with a readme file with some anecdotal information. github.com/RalphBacon/STM32-Nano-Replacement I hope you get yours working too. If you do, post back a comment here!
@thanosk4644
@thanosk4644 4 роки тому
@@RalphBacon Thank you for your response. Unfortunately none of all 6 stm32 worked with the old bootloader. 2018 i bought from the same 2 suppliers 4 stm32 and all worked OK but the 2019 buys are problematic. I want to order new ones but i have to be sure that they are working correct.
@cad3175
@cad3175 4 роки тому
..very interesting, thanks very much :)
@RalphBacon
@RalphBacon 4 роки тому
Thanks for your post, jimbob dooley, good to hear from you.
@Mike-ff7ib
@Mike-ff7ib 3 роки тому
I would not want a jumper sticking up like that. I agree having the tab is convenient while working with the board but for me personally i would replace the tabbed jumpers with standard ones to keep a lower profile and less likely to be knocked/snagged and bending the pins. Just personal preference.
@RalphBacon
@RalphBacon 3 роки тому
Indeed, Mike, once the programming (and debugging) has been completed you could replace the tabbed jumper with a standard one, just as you suggest.
@AerialPhotogGuy
@AerialPhotogGuy 4 роки тому
Hi Ralph! :-) I finally finished the "Demo" video of my version of a constant vacuum operated "Pick -N- Place" tool for SMD components with a little theory behind my design as well as tips on cutting holes in rubber and plastic. This was my first (and possibly my last "How To -DIY") video. I'm not very good at commentary!! But perhaps with some practice it may get better. :-) It took a little time to figure out which camera and lens combo to use, it was a trial and error approach but I think the filming portion turned out fairly good. I used to produce a fair amount of promotional videos for our local Parks and Recreation Department but I never done my own commentary, I always let the Parks and Rec staff do the talking. :-) One tip I failed to mention here or in the demo video was to place those component packaging strips flat on your bench before attempting to peel back the clear plastic strip that holds the components in the strip, peeling the plastic back while holding the strip in your hand is a sure way to cause you to lose a few parts! Placing or even taping the strip to the bench with double sided tape helps to insure that the components won't fly off somewhere never to be seen again. :-) Here's the link to my Demo Video: ukposts.info/have/v-deo/aIl4bJ-nkaJ-wHk.html Hope this helps! Have a great day, Ralph!! :-) Joe
@RalphBacon
@RalphBacon 4 роки тому
Nicely done Joe, although I did laugh when one of the ICs flew off somewhere on your workbench and you said: "Where's it gone?" - actually to my UK ears it sounded like "Where's it gawn" in the lovely US drawl you have! The commentary does get easier (less difficult) as time goes on, and if you plan what you are going to say (sort of). I've lost about half a dozen SMD components this week. They either fell out of the packet, bounced on my workbench and then onto the floor (never to be seen again) or got picked up by the tweezers and then shot off somewhere (never to be seen again) or got picked up by the soldering iron during soldering and in my attempt to get it off, shot off into who knows where (never to be... Oh OK, you get it). I need something to keep the component on the board as I solder it to the board. Another arm and hand would be useful.
@AerialPhotogGuy
@AerialPhotogGuy 4 роки тому
@@RalphBacon Thanks Ralph! Just a tip for ya if you plan on using a soldering iron rather than a reflow heat gun, again, try adding a very small dot of silicone to the bottom of the component before you put in place, then line the pins up with the solder pads as good as you can, then let it set for a few minutes so the silicone adhesive has time to hold the component to the board on it's own. Any type of silicone adhesive/sealant will work, I use clear ATV when I plan on hand soldering with a soldering iron but any type of silicone adhesive will work. And again, tape your packets to the bench rather than handling them in your hands while you try to remove components. Also, I have found that a silicone rubber mat on my work bench helps to prevent parts from bouncing off somewhere, mine is made for electronics work, you would think that rubber would cause them to bounce but not so in this case. Hard surfaces are the worst when it comes to handling small components! BTW, The component that fell off was while it was holding onto a raised edge or "Lip" as well as raised lettering, it was to demonstrate that you don't always have to have a perfectly smooth surface.....not to mention that DIP package isn't all that light in weight (for a vacuum powered pick and place tool). . Yes, I do have that southern U.S. drawl but it's not nearly as bad as it was in my youth. You know, you are the reason I sucked it up and made the DIY video, I hope it was helpful enough for you to decide whether or not to make one of your own. Either way, you have all the information I know how to provide. Joe
@AerialPhotogGuy
@AerialPhotogGuy 4 роки тому
Hi Ralph, Just wondering if perhaps you had forgotten about the conversation we had in your video labeled #150? (Beginning at the 4th comment down from the top). Have a great day! Joe
@MJ-nn2lu
@MJ-nn2lu 3 роки тому
Great Video 👍 Do you still recommend that board?
@RalphBacon
@RalphBacon 3 роки тому
Yes I do! As long as you get _genuine_ boards (so no bootloader issues) then they can be treated as super fast Nanos (equivalent to an UNO, just smaller). Choose your supplier carefully!
@MJ-nn2lu
@MJ-nn2lu 3 роки тому
Ralph S Bacon Thank you 👍 I wanted to order it from AZDelivery on Amazon.
@goodwill7643
@goodwill7643 3 роки тому
@@MJ-nn2lu amazon sets price x5 bigger. Try eBay or aliexpress
@marcotronic
@marcotronic 4 роки тому
Have a few of them in my arsenal for over a year now but haven't done anything with them yet. What's the current state of compatibility with the several Arduino libraries? Can it run any Arduino lib now? Thanks.
@RalphBacon
@RalphBacon 4 роки тому
There are several hardware-specific libraries on Roger Clarke's website which I want to test asap. Eg SPI, I2C etc.
@marcotronic
@marcotronic 4 роки тому
@@RalphBacon excellent! Looking forward to your results ;)
@J.D-g8.1
@J.D-g8.1 Рік тому
Compiling with /O1 /O2 or /O3 are not about the speed of compilation, they are different settings (or main settings) for what types of optimizations to compile the program with. F.ex; The compiler will inline functions (meaning copy/paste the function into the function it is called from, thus removing the need for the program to jump. This increases code size but is faster), or unrolling short for-loops (meaning that instead of executing one loop and the a jump to the beginning of the loop, copy/paste the loops after each other in succession thus removing the need for jumps, again increasing code size but also speed), or optimize the code to use less memory but more storage, or reducing code size but use more memory and/or perform slower. The flags O1, O2 can further be subdivided into several other flags for compile options, where you f.ex specify if you want to disable, enable or favor inlining, etc etc. Debug code is no opimizations with some extra stuff thrown in, but you can also have debug code with optimization to different levels. Regarding optimizations, you can also mark functions with the inline keyword, but this does not guarantee inlining. Inlining a function is always a choice for the compiler. And the inline keyword is more used to be able to make definitions as well as declarations of functions in header files than actual inlining. But, there are other pragma directives (depending on the compiler, MSVC has the __force_inline f ex ) which can result in optimizations, provided you do not use /Od (disable optimizations) when compiling. For the specifics on how to optimize code you should always check the compiler you are using, since you are entering compiler specific territory where what works with one compiler may not work on another. Even the general flags: O1, O2 O3 will result in different levels of optimization with different compilers, BUT, the general "what am i trying to achieve" will be the same, kind of.. :)
@RalphBacon
@RalphBacon Рік тому
Yes, everything you say is correct AFAIK. Since this (older) video, however, we've explored different debug optimisations on various platforms, including the /O options. If you are doing single-step debugging it's quite important to remove all optimisation otherwise the source code no longer ties up with the executable.
@JoaoVictorPredebon
@JoaoVictorPredebon 4 роки тому
You can program the blue pill via usb, you just have to download the maple bootloader to it. To use it as a 'serial' device, you have to download the VCP drivers on the STMicroelectronics website, on Linux it should run with no problems. If after all of this, the bluepill is still not working, make sure the USB pull up resistors have the correct values, the original schematics for the board came out wrong so it comes with a 10k when it needs to be 1k5.
@RalphBacon
@RalphBacon 4 роки тому
Thank you for your feedback, Joao Victor Predebon, noted and appreciated!
@embeddedcastle
@embeddedcastle 4 роки тому
I think the future is for arm 32 bit microcontrollers, cause they are cheap more powerfull and a lot of periphiral inside. Thanks for tuto!
@RalphBacon
@RalphBacon 4 роки тому
Powerful and cheap, certainly, but ARM chips are not the only players in the field. The Espressif ESP32, also 32-bit, I think is only just beginning its journey and that really is powerful, cheap, dual core, operating system, wifi, BT ... I can't believe how much we get for our money. Of course, the STM32 is great too,a dn cheaper, but it's such a pity that Wi-Fi wasn't included; I know we can just add that functionality when needed but then we might as well use an ESP32 to begin with! But watch my next video which has a better speed comparison (which is not everything, just like comparing speed in cars is fun but ultimately not the most important aspect of owning a car) and where I build my own "Green Pill" - perhaps I should trademark that name quickly?!? Thanks for posting, great to hear from you.
@thevoice4758
@thevoice4758 3 роки тому
Great video. I however have to say that this STM32 board has not completely convinced me. For the moment I use the UNO for development and the Pro mini as "final" board. Some Pro Mini boards run also on 32 Mhz so the gain in speed is minimal (and not needed for my projects). The lack of RAM and flash memory is more an issue for me. The big advantage for this STM32 board I see is a sharp price for a lot of RAM and flash memory.
@RalphBacon
@RalphBacon 3 роки тому
A Pro Mini is (normally) just an Arduino UNO (ATMega328P chip) on a smaller board with no USB interface. So I doubt it will ever run at 32MHz. The spec sheet states 20MHz max (which then causes issues for all the Arduino timing code, such as millis). I see the STM32 Blue Pill as a very fast Nano-shaped board, complete with USB interface.
@thevoice4758
@thevoice4758 3 роки тому
@@RalphBacon Hello Ralph, some time ago I have bought some Pro Mini (from Wavgat supplier) who are capable to run @32Mhz. These boards doesn't make use of the Atmel chip but the LGT8F328 chip. It takes some time to find out how to configure them within the IDE but once this is done it seems to work. Until now I only made a simple test with these boards but soon I will use them into a home project. I also discovered that the Pro mini seems to be discontinued (what should be a pitty). One question however: can I use the input/output ports of the STM32 also on 5V as the arduino? or do I have to convert the signals?
@RalphBacon
@RalphBacon 3 роки тому
Whilst some of the pins on the STM32 are 5v "tolerant" that doesn't mean it's safe to use them at that voltage. Use an 8-way, _bi-directional_ level shifter (or even a resistor divider but that quickly becomes more work than a level shifter).
@UpcycleElectronics
@UpcycleElectronics 4 роки тому
Interesting. I have had a couple of these blue pills for a year or more... and a maple mini... but never got around to doing more than blinking the LED on them. I also just got a little SAMd21 board this week in a nano-ish board design labeled as a Wemos SAMD21 mini. I really should play around with all of them now. I have been collecting a bunch of 12+ bit analogue peripherals for AVR projects recently, and in the recent past I got into modern C-optimized(XC8) PIC16/18 stuff for their integrated analogue peripherals, all while ignoring these STM32 alternatives. The STM32F103 has decent specs on the first few pages of the datasheet and I really should have gotten deeper into it. I started playing with the PIC16F171x series after encountering the author of a book on it in the comments section of a Microchip upload. I haven't made it very far into the PICs either as paying for the compiler is just dumb IMO and I'll only play with the free version. I got caught up in the idea of an integrated DAC, ADC, configurable logic, op amp, comparator, and software defined pinout with configuration/reconfiguration on the fly. It seemed like a cool combo before I realized I prefer a community of friendly open source hobbyists over paying for nonsense and reinventing the wheel with my own libraries. I played with the PICs instead of the STM32 that I got at around the same time. Microchip's business practices are too outdated for me to take them seriously. It's the 1980's-90's corporate type exploitation even an American like myself can see and loath. Anyways, I assume you're going to try to fix the blue pill's USB connection design flaw with that new PCB. I've seen some forum posts where people say the 103's hardware USB implementation has some kind of odd 32 bit stack or register 'thingy' where the industry standard is 64 bits or something like that. I don't know if this is a big issue or whatnot but when I read that forum post (sorry I don't even recall where) awhile back there were several people saying similar type stuff. They were mostly talking over my head, but the take away I got was that the people that were developing open hardware/software support for the 103 stuff decided to move to the STM32F4xx series as it is more well rounded, conventional, and more powerful. Like I said, it was mostly a conversation that went way over my pay grade. I could have easily misunderstood the context of what I was reading. I just mentally made a note to check out a F4xx board one day if I ever get around to it, and that there are a few issues with the F103 stuff that prevented it from completely taking over the hobby market despite it's price to performance ratio on the surface. One last bit of info I vaguely recall while reading up about these. Apparently the way ST makes these chips within a series/family means they all contain the same silicon die. I know other chips like analogue stuff with a range of performance specs within a single part number (like grade A=.1%/B=.5%/D=3%) are usually just the result of testing and grading each die on a waffer during production and separating the better ones. I didn't realize this type of grading is also done within digital hardware. Apparently the F101 used in the "ST Link V2" clones is the same die as the F103 but it specifically does not have USB hardware according to the datasheet. However, the Chinese manufacturer is just using the USB hardware anyways as if the F101 is a F103. I don't know if they are able to purchase chips that have failures within the same block but still retain most USB functionality or what other types of trickery they are using. I just thought it is super interesting that they are hacking the hardware like this. If you open up the ST Link V2 you have, you will probably find the same F101 w/USB conundrum I did :-) Thanks for the upload. -Jake
@RalphBacon
@RalphBacon 4 роки тому
How timely your response, Jake. My ST-Link has died (or, at least, Windows no longer recognises it, no matter how often I update the drivers). So I opened it up this morning but the markings on the chip (which look uncannily like an LFQP STM103) have been erased. Hmmm. I've ordered a couple more as I was hoping to use them for debugging in due course, and this will let me know whether it is Windows playing silly bu***rs or that my ST-Link really has died. I'll let you and everyone know what I discover in due course! Have fun playing with the Open Source software on your STM32s and thanks for posting, good to hear from you.
@UpcycleElectronics
@UpcycleElectronics 4 роки тому
@@RalphBacon Sorry you're having trouble with your ST-Link. I would just get a STM32 discovery board as they have the proper ST-Link attached. It can also be removed and used independently. The lower end Discovery boards are only ~$10. I saved a few uploads on the STM32 stuff here: ukposts.info/slow/PLPIwHuVy9EyMftX02xGj6mMJOMwAKDNn_ The black magic probe stuff and forth OS are oddballs and interesting IMO. -Jake
@andrewtoogood1429
@andrewtoogood1429 4 роки тому
Hi Ralph, great video as always! just a tip for you that may help: You only need to move the jumpers when you use the Serial interface to download. With the STLink it just works:) Also to be clear moving the jumper before reset is not to get it going it is to ensure the program is saved i.e. if you reset before moving the jumper in serial mode you will erase the program. Also as far as getting the Blue Pill to work with USB download I have read it is because they have the wrong pull up resister 10k instead of 5k1 if I recall (It is a copy of a copy and they used more common components) Is the resister soldered on your one an attempt to fix that? I assume as you are building your own you can fix that and show us in another video:) Look forward to it.
@RalphBacon
@RalphBacon 4 роки тому
I shall take care with the reset/jumpers in future, Andrew, thanks for the tip. Yes, I changed R10 to 1k5, made absolutely no difference. Yes, I hope to build one from scratch that has the correct values, plus a diode between USB 5v and other 5v so they don't cross-contaminate (eg blowing up my USB port) and a couple of decent caps on the power too. We shall see...
@superdau
@superdau 4 роки тому
@@RalphBacon The hardware bootloader (unbrickable in ROM) does not support USB upload (at least in most of the F1s; there's a list somewhere, which models do have hardware bootloader USB support and there's a lot of those). You will have to flash your own bootloader with USB support for that. But with an ST-link there isn't much point for for using the bootloader at all (neither the integrated one nor a custom one), unless you are developing something where the finished product needs to have a bootloader.
@rupert274
@rupert274 Рік тому
Sorry if this is old news or only half of the story but apparently you don't need to move the jumpers when programming with the STlink v2 dongle.
@RalphBacon
@RalphBacon Рік тому
I think the jumpers are only required if you are using fake STM32 (as I was). Genuine STM32s behave much better.
@TYGAMatt
@TYGAMatt 4 роки тому
Hi Ralph. I'm a bit of a novice, but would you recommend the STM32 or the ESP32? I've done a little bit with arduino and I need a bit more memory and speed, hence wanting to start working with the other boards. I have both here now to play with but only fiddled with the ESP32 so far. Interested to hear your views
@RalphBacon
@RalphBacon 4 роки тому
A bit more memory, Matt? A bit more speed? The STM32F103C8T6 based board (aka Blue Pill) sounds like what you need. A Nano-sized board (same features as the UNO) but on steroids. The ESP32, on the other hand, has built in WiFi and BlueTooth, is dual core (although that is deliberately hidden to casual users) and is like greased lightning compared to an UNO. But you don't get all the extra functionality for nothing; you would need to learn how to use it! I'd recommend the STM32 given your requirements, but be sure to get *genuine* versions, that is you might pay a bit more from a reputable UK / USA supplier but won't then get hours of problems with the bootloader because you bought a fake (trust me on this). You would just treat is as a Nano (but select the Blue Pill from the list of boards). Any good?
@TYGAMatt
@TYGAMatt 4 роки тому
@@RalphBacon thanks very much for your reply. Been having grief trying to get an LM35 sensor to read proper numbers...highly frustrating. The STM32 I have is a clone. Not that worried about the bootloader, have an St link and FTDI adapter so should be OK. Was just keen to try the ESP32. If you get the urge. Some vids on ADC and all the various settings for this would be well worth a watch ;-)
@TYGAMatt
@TYGAMatt 4 роки тому
Oh, and while I'm at it, any views on the RobotDyn Black pill? They assure me that it has a working bootloader and everything done though the USB port.
@RalphBacon
@RalphBacon 4 роки тому
I thought I had a Black Pill somewhere - I shall look later.
@TYGAMatt
@TYGAMatt 4 роки тому
@@RalphBacon you're the man :-) as it is, wasted 3 hours this morning trying (unsuccessfully) to put a bootloader on the bluepill. Couldn't even get the FTDI adapter to work properly. Using an ST link, which worked fine but then can't use the serial monitor. Had a cup of tea and bit the bullet and threw the ESP32 on the bread board. Made good headway with it. Basically copying my working NANO code. Interrupts for my engine knock sensor were a bit of a headache, but twigged it in the end. Quite a pleasing afternoon. Have the black pill and some other goodies in my Aliexpress cart. Should probably get one... Not exactly gonna break the bank. Keep up the good work and thanks so much for being one of the very few who interact with their viewers
@colingale
@colingale 4 роки тому
Goto stmdunio forums, USB works fine in our libs but yes easier to use stlink or JTAG , reason it has issues is resistors on some bluepills, blackpill is the fixed version.
@RalphBacon
@RalphBacon 4 роки тому
Yes, I've visited more than once, COlin. I'm convinced it's Windows not playing nicely with my boards (the VID/PID is all wrong).
@JerryEricsson
@JerryEricsson 4 роки тому
@@RalphBacon Have you tried in Linux? Just wondering, I am considering giving it a blast as I have duel boot on my laptop.
@JerryEricsson
@JerryEricsson 4 роки тому
AT LAST after over 6 years of sceaming "I HAVE BEEN SCREWED" (Well maybe it was 3 years, getting old and time is nearly a bland stretch of nothing any more) I can at last get this little thing to do SOMETHING I even purchased the STLINK deal several years ago thinking it would work, but I have always been using the wrong setup in Arduino! I did it once again whilst watching this I did a search for the json file and used one off the internet, kept giving me all sorts of errors till I read your extra stuff and used the one you furnished! That was the bugger. Still can't get blink to work right but everything seems to be uploading and getting the official ok-dokey from Arduino.
@RalphBacon
@RalphBacon 4 роки тому
Well I have been, Jerry, as my STM32 is apparently a fake. But apart from that it works pretty well.
@superdau
@superdau 4 роки тому
The USB port is fully useable (as an "virtual" UART for example), but the F103s can't use USB for their bootloader (there are a lot of other higher specced STM32s that have the USB available in the bootloader). That is the unbrickable bootloader, that's there in hardware ROM. You can flash your own bootloader (takes up flash then obviously) so you can use USB in the bootloader, if you need to. Although with an ST-link I don't see any point for that, and even better it gets rid of the nedd to fddle with the jumpers. I was blown away by the peripherals available in the STM32s, even the lowest ones like the F103s. Multiple ADCs, multiple UARTs, I2Cs and SPIs, all remappable to different pins, so you hardly have any pin collisions, all of that connected by multichannel DMA and synchronisable with multiple timers. You can make a simple data aquisition device for example, spitting out data onto a serial port, where the CPU does hardly anything except for starting a DMA transfer and timer.
@RalphBacon
@RalphBacon 4 роки тому
Yes, the STM32 is stuffed full of peripherals, adding value at every turn. That's probably why it's so popular. Oh, that and the fact that it is _very_ cheap too! And now supported by the Arduino IDE. We are spoiled for choice!
@MoesKeckeEcke
@MoesKeckeEcke 2 роки тому
Do these significantly clock higher than SAMD21 or the arduino Due? How is the interrupt compatability?
@RalphBacon
@RalphBacon 2 роки тому
I don't know about clock speed, I'm afraid, but I'm sure you can find out by looking at the specs for each type of processor! Interrupt compatibility seems good (well, it worked when I tried it, that's all I know).
@avejst
@avejst 4 роки тому
Nice review But is is a 3.3 V system is it not? Is it 5V tolerant? Thanks for sharing :-)
@MrEdwardhartmann
@MrEdwardhartmann 4 роки тому
it is a 3.3V processor, but the board is 5 volts and over half of the pins are 5 volt tolerant. Check out the pinout at the bottom of this link - wiki.stm32duino.com/index.php?title=Blue_Pill - the pins with black circles are 5v tolerant - the white circles are 3.3v only. Of course, all outputs are 3.3v.
@Thomas72B
@Thomas72B 4 роки тому
Have a look at the data sheet of the STM32 under "Pinouts and pin description". All pins with an "FT" are 5V tolerant.
@RalphBacon
@RalphBacon 4 роки тому
Many pins are 5v tolerant. If you hold the Blue Pill with the USB port facing down, then all the pins on the right side _with the exception of PB5_ are 5v tolerant. Cool, hey?
@gyorgygergoszathmary1394
@gyorgygergoszathmary1394 4 роки тому
The guys at stm32duino say that this blue pill has wrong components on the USB data lines, you have to fix that before using the USB. The BLACK pills (very similar boards, same mcu) also have good USB component values. If you are interested in fixing the board, look up on stm32duino wiki. After you installed the USB bootloader (also documented on stm32duino wiki), don't forget to switch back the boot jumper to flash, otherwise the board may erase the USB bootloader, and then you would have to burn the bootloader again.
@RalphBacon
@RalphBacon 4 роки тому
Yes, I heard the Black Pill works better, too. I don't have one though to test with. I shall have to investigate further, thanks György.
@RalphBacon
@RalphBacon 4 роки тому
Correction, I do have one but no luck with USB recognition so far. I might reinstall the drivers.
@gyorgygergoszathmary1394
@gyorgygergoszathmary1394 4 роки тому
I had problems with the drivers, too. Basically, if you install the stm32 boards using a link in the arduino boards manager, it won't download the windows drivers. I still recommend doing the link version first to install everything in the right folders. Then you should also download the .zip from wiki.stm32duino.com/index.php?title=Installation . Unzip it and navigate to (Arduino_STM32-master.zip) \Arduino_STM32-master\drivers\win . There you will find the wdi-simple.exe and the install-drivers.bat . I ran both, and then it worked. Then open the proper windows device manager, and when you plug in the mcu (or reset it), it's led will blink and it will show up as a Maple-DFU, or something like that. After exiting the USB bootloader, it should show up as maple-serial or something similar. I hope this was helpful. By the way these boards don't come with USB bootloaders out of the box. If it's needed, I can explain my experiences with the bootloader installation, but that part is way simpler.
@Mike_Downey
@Mike_Downey 4 роки тому
I came here to mention the Black Pill too. This video came out after I had ordered my stm32 but before it arrived. When it came, it turned out to be the black pill version. It took me ages to get it working because the instructions to run the .bat file to install the drivers is buried deep in the documentation and not at all obvious. After installing the drivers, the usb works fine and I can upload sketches without messing with the jumpers.
@H2ON_MEA
@H2ON_MEA Рік тому
Can we use the modules of arduino 5v with STM32 board ? Thank you
@RalphBacon
@RalphBacon Рік тому
That depends. If the pin you are connecting to on the module exposes 5v to the STM32 it _could_ damage it. For example, the I2C signal pins. Any _incoming_ signal must be reduced to a max of 3v3, for example signal pins from a PIR that goes HIGH when movement is detected. Whilst many home hobbyists "wing it" and connect anyway, I tend to use either a resistor divider or even better a level shifter (very simple to use, I'm using one right now on the project on my workbench). So the short answer is: beware of cutting corners!
@H2ON_MEA
@H2ON_MEA Рік тому
Thank you so much Mr.@@RalphBacon
@yosyp5905
@yosyp5905 4 роки тому
they don't put the extended jumpers to leave the low profile I suppose.
@RalphBacon
@RalphBacon 4 роки тому
Well, maybe that's the reason, I hadn't thought of that.
@rexeveringham1817
@rexeveringham1817 4 роки тому
Hi, the maple is actually $4.02 US at that link...you have to select the maple from 4 options ;-)
@RalphBacon
@RalphBacon 4 роки тому
I've found prices vary quite a bit, Rex, it pays to look around. Also, buying 3 modules can bring the unit cost down closer to $3 too. But if one site doesn't give you what you want try another: Gearbest, AliExpress, Amazon, Banggood, eBay... the list goes on!
@rexeveringham1817
@rexeveringham1817 4 роки тому
Ralph S Bacon Yes, they are cheap enough. I have two Blue Pills and a V2 ST link that I ordered from AliExpress - waiting for their turn, as I’m currently exploring the ESP 8266/32 options beforehand. PlatformIO just made their in-line debugging free so it’s a great time to be playing with these. Thanks for the informative video. I didn’t know about the Maple option. Cheers!
@caroman6761
@caroman6761 4 роки тому
Have you already measured the power consumption? I think the extremely low power consumption in combination with the often low power required makes the Arduino Pro mini or Nano more attractive than an STM32. Not to mention the programming effort. And have you ever tried to run into the main drivers for the sensor modules from the Arduino IDE even on STM32? Unsurprisingly, STM32 is an attractive technology, but I think it's incomparably more complicated to implement than Arduino's or ESP modules.
@RalphBacon
@RalphBacon 4 роки тому
It's early days for me, at least CaroMan, and I shall be testing some sketches out as I go forward to see what works out-of-the-box and what doesn't. Stay tuned for further updates!
@andrewtoogood1429
@andrewtoogood1429 4 роки тому
STM32 is great for low power as they use a prescaler that you can set with software so it is very simple to slow down the clock speed without faffing about with compatible voltage levels or fuses. That's why it runs @72mhz with an 8mhz crystal onboard.
@yosyp5905
@yosyp5905 4 роки тому
What are the advantages of a higher clocked microprocessor? I can't think of an application.
@RalphBacon
@RalphBacon 3 роки тому
Speed. Raw, unadulterated speed, Yosyp. If you are doing lots of things in a sketch it works better if you can whizz round the loop a few million times a second rather than a few thousand times a second. No delays, stutters or other artifacts. Just like a faster 3GHz PC works more smoothly than a slower 1GHz one.
@yosyp5905
@yosyp5905 3 роки тому
@@RalphBacon I'm quite familiar with PC hardware and I understand what you say. However, I asked about an example because I can't imagine any context. On a PC, a more powerful hardware may be equal to a higher FPS, a lower latency, less stuttering or tearing, decreased render times... but you can't game or render on these boards, hence I can't understand why or when you should update. I'll reverse the question: I cannot think of an application when the usual, less powerful Arduino will struggle. I like electronics but my knowledge is very basics. I saw GreatScott's video which compares the board and the Blue Pill was a clean winner because of the higher frequency it can give to a motor... but I ultimately didn't understand how it translates into practicality. To make things shorter, I'm the guy who would use an Arduino to build a button board with some encoders or potentiometers, maybe some screens. The usual, popular, simple "modules". But I don't see why an Arduino would struggle in this scenario... you're not going to notice if a press of a button is sent in 1 microsecond or in 1 nanosecond, but you are going to notice if your game runs at 50 FPS instead of 40. Sorry for the long post but I'm not good at communicating.
@NotMarkKnopfler
@NotMarkKnopfler 3 роки тому
If your code runs faster while the CPU is awake, the CPU can sleep longer. Simple. This is important for low power applications. Regards.
@FowlerAskew
@FowlerAskew 3 роки тому
@@yosyp5905 I'll throw some practical examples out there. Until pretty recently, hobbyist 3D printers used standard 8-bit AVR hardware. One of the most popular mainboards was just an arduino mega with a shield to interface with all the 3d printer parts. Recently, a lot of people are starting to convert to 32 bit boards because as you increase print speed there's less time to compute the motion of all the stepper motors which can lead to stuttering that will ruin the print quality. An even better example would be quadcopter flight controllers. Some really old controllers used Arduinos, for example the MultiWii controller could be built with an arduino nano. As people optimized their quads and the hobby got more established, flight controllers needed to be faster, which is why almost every modern flight controller runs an STM32F4 or F7. The controller has to read a bunch of data about the quad's position and movement, run PID calculations to keep it stable, read data coming in from the receiver, and do a bunch of other stuff based on your setup. One of the reasons for upgrading microcontrollers is that faster microcontrollers can run the PID loops faster which is very popular with racers and freestylers
@anthropomorphousdodecahedr6504
@anthropomorphousdodecahedr6504 3 роки тому
@@yosyp5905 Possible applications: floating point calculations require significant resources and if application is time critical you might want to step up the speed. Also, you very much can render on these boards, using small LCD or OLED screens. I've had a project where the OLED screen was updating so slowly (a lot of stuff happening in the sketch) that it was very unpleasant to look at and use.
@jmd28522
@jmd28522 4 роки тому
What is the resistor for?? would it work without the Resistor??
@RalphBacon
@RalphBacon 4 роки тому
The resistor was trying to fix the USB problem (bootloader not working). It did not help, so I just used an FTDI USB to Serial adapter and that works fine. So you can forget the resistor. The reason my USB did not work (eg for sketch uploading) was that the bootloader was new and my processor was fake (clone) and they did not get on well together. Details in the video description and/or GitHub.
@jmd28522
@jmd28522 4 роки тому
Ralph S Bacon thank you..... If you have free time on this quarentine or want to see my proyect.... Just write me..... Jmd2852@gmail.com best regards 🙌🏼🙌🏼
@Mr.Leeroy
@Mr.Leeroy 4 роки тому
Keep it up
@RalphBacon
@RalphBacon 4 роки тому
Thank you for your feedback, Leeroy, noted and appreciated!
@InfoSoup
@InfoSoup 4 роки тому
In this video, i see that you are pegging the STM32 between nano and ESP32, i would add here that some STM32 parts can go upto 480MHz, far surpassing ESP32.
@RalphBacon
@RalphBacon 4 роки тому
I don't doubt that you are correct but the ESP32 is about more than raw speed - it has a rudimentary OS that allows multitasking (across cores if you want, with care).
@johnmmcguinness7982
@johnmmcguinness7982 4 роки тому
Hi Ralph, Bit of a problem from a refugee from Oakley the one on the A6. STM32 Blue pill done all you say but my Tools drop down does not look at all like yours, pause for laugh..most importantly the upload method does not Show ST LInk. Yes STlink is reported as OK by the Win 10 device manager and I have installes the latest drivers from the ST website. My IDE is 1.8.6. The 7 options for upload method include 3 for STM32 and I have tried all 3. The error is always the same "Board GenF1 (platform stm32,package STM32) is unknown" Any thoughts would be much appreciated as I also have little hair left to pull out.
@RalphBacon
@RalphBacon 4 роки тому
The board that you have chosen, was it from the "STM32F1 Boards (STM32duino.com)" section? And did you choose "Generic STM32F103C" series as the board? If so you should definitely have the STLINK option, shown along with (starting from the top): STM32duino bootloader Serial STLINK BMP (Black Magic Probe) JLink HID bootloader 2.0 If this is not the case I suspect you have not installed the necessary board descriptions, you will have to revisit that part of my video where I show how to add them, I'm afraid. Let me know how you get on and what you find.
@johnmmcguinness7982
@johnmmcguinness7982 4 роки тому
@@RalphBacon Once again thanks for reply. Much midnight oil and I have found the answer. The board data file, dont know any other way of describing it, that I installed in the board manager was STM32 cores from STMicroelectronics Ver 1.7. Yes again you are "spot on" when I installed the "STM32duino.com" file and selected options from same all was sweetness and light. Supplementry question if I may.I would like to purchase a few copies probobly 5 of the development board you designed to use the STM32. I am unable due mainly to lazyness and incompetance to find your json / gerber files and the BOM. I will order both boards and materials from your sponcer if you wouuld be so kind as to provide details here or elseware. Regards from a dedicted slow learner.
@jamesalberi6609
@jamesalberi6609 4 роки тому
You are using floating point in your prime calculations. ESP32 probably has fpu hardware support while the other mcu's don't. A much more useful comparison would use integer computations, which are the mainstay of most mcu projects. Otherwise nice video.
@RalphBacon
@RalphBacon 4 роки тому
Stay tuned for an update on this sketch, I've done some more work this afternoon as a result of your comment, James. Very interesting results. No more. You will have to wait!
@rolandoleiva3269
@rolandoleiva3269 2 роки тому
I tried this STM32f103 and a compiled coded of 18K size for a blinking led is ridiculous, i recall the arduino has a 1.6K for same task...
@RalphBacon
@RalphBacon 2 роки тому
The STM32F103 has to download all the framework for even a simple bit of code, that is true. But then your other functions will compile with a much smaller increase in code. If you think the STM32F103 creates a lot of code, try the ESP32! That needs more than 100K just to blink an LED - but then very little else for other functions.
@rolandoleiva3269
@rolandoleiva3269 2 роки тому
​@@RalphBacon Ok thanks, I understand, i will try again with a longer program, the f103 has many more bells and whistles than the arduino 328, so it will be an improve for my design, the only drawback is that the code cant be protected (failed security design) for some of us who design, thats why i never tried the ESP32 because external Flash and faulty ADC, and heavy code!!!.
@alsehendo34
@alsehendo34 3 роки тому
I think you have to flash a bootloader to the board to use the USB port.
@RalphBacon
@RalphBacon 3 роки тому
Certainly that is true, although my (fake) STM32s needed an older bootloader to work; the newest bootloader did not work. When I got some genuine STM32s it all worked as expected, who knew!?
@alsehendo34
@alsehendo34 3 роки тому
Can you tell me were to get genuine boards, genuine ble pill board? Also I herd update firmware on chineese boards, that would make a good video.
@RalphBacon
@RalphBacon 3 роки тому
If you buy them locally, contact the seller and get him to confirm. If he cannot/won't/is unclear then steer clear! I've yet to try the new uploading of a bootloader. But it is on my list...
@foxabilo
@foxabilo 4 роки тому
You had any issues with JLPCB's DHL delivery's charging you 11 quid import "fee" Ralph?
@Ed19601
@Ed19601 4 роки тому
Yes, the delivery charges are far from 2 euro, jlpcb is ok for bigger boards
@foxabilo
@foxabilo 4 роки тому
@@Ed19601 Yup, DHL and FedEx are pulling a fast one with surcharges on shipments from china, on my last delivery the total came to £13.50 and the import fee was £11 , I wondered if they do that on the $2 boards too
@AJB2K3
@AJB2K3 4 роки тому
@@foxabilo I just recieved a bill of £49.99 on a £61 package! BTW the package was supplied free from the manufacturer!
@Ed19601
@Ed19601 4 роки тому
@@foxabilo darn, import fee on such small amounts and then so high? I did order at oshpark and that was incl. Sending and delivery. Osh is 5usd/sq_inch, so that's only relatively cheap for small amounts of small boards, a 10x10 at OSHPARK would be about 77 USD for 3 PCBs, which is way too much
@foxabilo
@foxabilo 4 роки тому
@@AJB2K3 It's absolute daylight robbery. The thing is, I don't know if people like JLPCB know this is going on, it must be killing their repeat business, you get one set of pcb's for 2 $ plus shipping and then WHAMMO hit with a dirty great import charge, I spoke to a chap in my old companies legal department and he says they are completely illegal charges but they keep getting away with it.
@JerryEricsson
@JerryEricsson 4 роки тому
Same laptop, got the blue pill to program off the USB, then when I went back to Windows 10, I decided to try it there once more, never has worked before, but this time it dinged, well said unidentified device, but when I right clicked on it in my device manager and told it to search for a driver, it tried, then failed. I looked at the board and switched the jumper and suddenly Maple Mini appeared in my ports, on port 15. I tried to program but it balked a bit, so I uploaded the program that needed a serial port up, didn't work, but it did upload. So I hooked up the USB port and there on my serial monitor was GOOD MORNING WORLD over and over again! So I guess it sort of works some times. Still can't get the damn blink to work,, when I change the pin to PC13 it comes up with an error that PC13 was not declared in this sketch.
@JerryEricsson
@JerryEricsson 4 роки тому
OH I got it to work in LINUX guess I forgot to mention that in the above. I am using PEACH Linux (THE WORKS) 64 bit, my current flavor of the month in Linux.
@RalphBacon
@RalphBacon 4 роки тому
Ah, LINUX, yes, well that is a bit different. But what you experienced I have seen with my clone STM32s (so GD32s or CKS32s). My programmer board works like a dream though (I even used two of them during one of my videos) so I'm not that bothered. But I finally go my so-called STM32s to work by loading an older bootdriver as suggested by another viewer who had the same issue with the new (current) bootloader but which had worked perfectly before. I say "so-called" because I'm pretty certain they are clones (fakes, actually, as they are marked as STM32 but are patently not). When I sourced some new, UK-supplied STM32s (having checked with the supplier first) they worked first time with the new (current) bootloader, so there we are! Thanks for the update, Jerry, great to hear from you.
@nehiripere4277
@nehiripere4277 10 місяців тому
What is the stm32 IDE you used at 26:37?
@RalphBacon
@RalphBacon 10 місяців тому
That looks like an old version of the Eclipse IDE, no longer supported. These days I use Visual Studio Code with PlatformIO for all my coding.
@sidaliakil
@sidaliakil 4 роки тому
Is this board able to operate in industrial environments?
@RalphBacon
@RalphBacon 4 роки тому
If you have a genuine STM 32 it should be ok for industrial use but look very carefully at the overall quality. You may want to encapsulate in potting compound to protect it.
@makersengineering530
@makersengineering530 4 роки тому
Could you please tell me arduino has 16Mhz crystal but why atm32 bluepill has 8Mhz only.i guess it should be 72Mhz ? I want to make a pcb with STM32F030K6T6 which crystal should I use? I guess it has Internal 40 kHz RC oscillator .does it mean no need to add any crystal?
@RalphBacon
@RalphBacon 4 роки тому
The Blue Pill has an internal PLL (Phase Locked Loop) multiplier of 9x, Mina, so it only requires an 8 MHz crystal. Internally the crystal frequency is multiplied by the PLL setting. The Arduino has no such multiplier so it runs at the crystal's natural frequency. Because the Blue Pill's frequency (PLL setting) is controlled by software, it is relatively easy to make it run at 128 MHz (and other speeds) by changing the multiplier value too: amitesh-singh.github.io/stm32/2018/06/17/overclocking-blue-pills.html
@RalphBacon
@RalphBacon 4 роки тому
And yes, you do need to add that 8MHz crystal, the internal clock is only for time keeping (and possibly other light duties such as the timer when it is in deep sleep).
@makersengineering530
@makersengineering530 4 роки тому
@@RalphBacon Thank you very much.
#151 - ESP32 Passing Values 💾 Between Tasks - Deep Dive (2 Easy Ways)
38:38
#156 LGT8F328P Replacement for ATMEGA328P (at 32MHz 😲)
26:15
Ralph S Bacon
Переглядів 45 тис.
STM32 Blue Pill vs Black Pill Microcontroller Boards
18:31
Gary Explains
Переглядів 132 тис.
STM32. BlackPill - рождение новой легенды на F4
27:08
STM32 Guide #2: Registers + HAL (Blink example)
30:02
Mitch Davis
Переглядів 176 тис.
Blue Pill Bootloader
6:43
Richard Wenner
Переглядів 6 тис.
#345 ESP32 vs STM32: Which one is better (Bluepill)?
15:37
Andreas Spiess
Переглядів 231 тис.
STM32 BlackPill with a Cortex-M4 CPU made in Europe, not in China
9:46
Gary Explains
Переглядів 31 тис.
#149 ESP32 Dual Core Programming + Speed 💨Test vs Arduino UNO (fast!)
31:18
Programming the STM32 Blue Pill with LDmicro PLC Ladder Logic
5:57
Робот зарядка на 65W🤖
0:36
serg1us
Переглядів 1,6 млн
Клавиатура vs геймпад vs руль
0:47
Balance
Переглядів 323 тис.
Как открыть дверь в Jaecoo J8? Удобно?🤔😊
0:27
Суворкин Сергей
Переглядів 735 тис.
iPhone - телефон для нищебродов?!
0:53
ÉЖИ АКСЁНОВ
Переглядів 3,4 млн
Infrared Soldering Iron from Cigarette Lighter
0:58
ALABAYCHIC
Переглядів 1,6 млн
Phone charger explosion
0:43
_vector_
Переглядів 4,5 млн