EEVblog
Вставка
- Опубліковано 14 тра 2020
- How to program a blank STM32 micro using DFU bootloader mode via the USB port.
Also Zadig and WinUSB device mapping on Windows 10.
Part 3 of the Padauk opens source programmer series.
Forum: www.eevblog.com/forum/blog/ee...
#STM32 #DFU #Padauk
EEVblog Main Web Site: www.eevblog.com
The 2nd EEVblog Channel: / eevblog2
Support the EEVblog through Patreon!
/ eevblog
AliExpress Affiliate: s.click.aliexpress.com/e/c2LRpe8g
Buy anything through that link and Dave gets a commission at no cost to you.
Donate With Bitcoin & Other Crypto Currencies!
www.eevblog.com/crypto-currency/
T-Shirts: teespring.com/stores/eevblog - Наука та технологія
1:14 this is now my hardware detected sound
Yeah, I'm just gonna leave this right here... drive.google.com/open?id=1e_kJMBPK4LkIgNfZGsi4aGhA6WgIFPC1
😂
@@JRBarhydt Hahahaha, superb! Just imagining my pc does this when someone plugs a USB hahaha
That is so much fun! Now I need to play it backwards when the hardware is disconected. Then it will be perfect!
i guess Im randomly asking but does anyone know of a way to get back into an instagram account..?
I was dumb forgot the account password. I love any tips you can give me
What a rich world we techies live in now. Unfortunately, I'm about 20 years out of practice, and the world for newbies in any given sub-area is still pretty opaque. So many things are assumed in these development worlds. You are impressive your ability to traverse this world reasonably competently. I would face days of shouting and screaming at the idiots who didn't do it the way I would. Anyway, once you've navigated to the right place, amazing stuff.
This video series is everything that I had hoped it would be so far. Amazing. TY Dave and everyone else who did this!!!
Thanks. Sadly it looks like it's not going to be popular, hardly anyone is watching it compared to other types of videos. Not much motivation to do something like this again.
Great video series😃, please keep making them in future and I think there aren`t a lot of good development electronic videos on UA-cam..
This content is awesome
@@EEVblog UA-cam unsubscribed me from your channel. wankers.
@@EEVblog too bad. I much more love your educational and projects videos. Missing your fundamental Fridays Vids. I'll be honest, I'm one of the heretics that doesn't care so much for everyone's favorite series, mailbag 😏.
@9:28 the easiest way to program STM parts with DFU and Windows is the STM Cube Programmer tool from ST. It just works.
Thanks for doing this series. A complete tutorial series from ground up, like this, is a rarity on youtube these days.
Having messed with ZADIG many times in the past using SDR devices, I found that for the first time ever, I screamed at the screen SHOW ALL DEVICES DAVE! Ah well we all have bad days and when your mind is as full of electronic knowledge, some small software glitch catching you for a few seconds can indeed be excused as, "anybody could do that!" Thanks for the wonderful videos, I am a constant watcher, I have learned a lot, however there is much that goes way over my old head.
Jerry Ericsson You are spot on! Even with my aging brain it’s the first thing that comes to my mind when I see the ZADIG GUI. But Dave is right, why is this not the default?
DFU - also known as “device fu*ked up” mode
On Linux that's literally installing dfu-utils via your package manager and then one command to program it
good to know. i was already afraid i had to troubleshoot this, too :)
And again THX for the video EEVblog
As I remember on my centos7 it worked out of box, nothing to install
Kickstarter: Embeddio SNAP Boards - add functionality to your Arduino or Raspberry Pi - start SNAPPING!
@@mrlazda Linux Mint CINNAMON 19.3(Tricia) 64bit does the same.
Basically - this is an episode that shows why you shouldn’t use windows for these things /-)
No joke. After you get over the initial learning curve, making your computer talk to random hardware is so much easier on linux.
@@migkillerphantom Absolutely - same goes for programming in general IMO.
Third that!
Windowź is a giant syntax error.
Whenever I'm working with new hardware like this, I always keep a log of every step that I do. Sometimes you end up going down a rabbit hole to a dead end, so it helps when unraveling the steps (so you don't end up with stuff installed that you don't need or that may cause other problems). Then once I finally get it going, I don't have to wonder "what did I do to make it work?". I then go back through my notes to generate a clear installation manual that I can pass on to colleagues. Also, I sometimes get reassigned to another task and have to come back to this one months later, so the log really help refresh my memory as to what I've done. Having a video log as you do sure makes it handy.
So many tasks I undertake would be well served by keeping a log. Just not disciplined enough.
Yes me too. Always keep a log, note what worked and what doesn't, any error messages, what I tried, etc for every step. And then I put a summary of what worked at the top so I can pass this to colleagues and use this summary to work from from now on. If I discover new stuff, I update my notes and summary.
@@kissingfrogs that is a good idea. But I'm too lazy. Just am faster trying everything exploratory. When I need to run some commands I just can't be arsed to write down every command down before entering it into the shell to try it
‘cause problems’, you mean like the HDMI input video glitch which immediately shows up after the USB driver is shoehorned in to place?
Thank you for the grounds up on this, I really enjoy it. It's this kind of content that brought me to your channel. 👍
Please keep these series up Dave!
It was enjoyable to watch you figure out the Zadig thing. I've had to mess with that a few times, and it's always great when it finally works.
I love how even with how advanced technology has gotten. We still have gems like you teaching the ground floor basics. Looking forward to building some of my first pcbs in the near future!
Fantastic! I had been considering setting myself up to program and use some Padauk micros, saw your first vid a couple of nights ago. had a little look on your vids list but missed the follow ups. Last night was a 12 hour day at work and a midnight 2hour callout this morning. Had this interesting blast from the past, looking at STM32 and DFU on this vid which reminded me of the STM32F103 motherboard I designed up just over a decade ago and here was this vid, tackling 2 subjects in one! Thanks! ps Zadig was a BS circus when I used it too.
Thank you for this video. I have been trying to figure out dfu for awhile now
0:18 Atmel processor? But it's STM32.
Brain fart.
was hoping to see AtmelStudio connections for kicks....it probably would still work with Arduino
and for bonus, the bigger Atmels also have DFU
Really nice series. Yes, the Quadcopter guys knows these DFU Problems (STM32 Proc). Seems to be that many drivers can use the DFU like mode and you have to change the drivers with Zadig back and forth quite often.
Dave says "Don't you just hate it when things work first time" followed shortly after with it not working first time.
You stole me thought, 🍀
For you always laughing at Linux this works out of the box as the OS does not take stuff over thus the OS gets in your way.
I’m using macOS which kind of feels like a Linux System but without those stupid Linux kind of problems you always have
Programming embedded devices has improved a lot. I've fought for days with janky custom software just to flash a device, it seems much better nowadays.
as long as you dont fuck up your fuses and disable some of the programming ways. had that recently with an avr disabled jtag and spi upload by accident. had to use hvpp which is like the real device fuck up mode... but it works again
Windows is the janky software now
Typing "cd \" will take you to the root of the drive your in. That way you don't have to type "cd .." a bunch of times . Trying to help. Thanks for the great videos !
Shift and RightClick in the explorer window, and there is the option to open commandprompt or powershell in that directory :)
And tab to autocomplete directory names.
I thought Dave effectively did that with cd\dfu saving a step
Didn’t work in Linux. All it does is >
@@HighestRank Linux is not Windows. Back slash is an escape character in Linux. Directories are specified using forward slash
The aliens are shooting a laser beam on your screen Dave. You figured out their technology!
I've never tried it on Windows with an SMT32, but I remember Zadig from back when the RTLSDR fever started. Actually DFU looks more straightforward on linux if you have the precompiled (or can compile) the same dfu-util in the video. You just have to look up the correct USB VID/PID with lsusb. No driver replacement needed, the kernel handles this out-of-the-box. At least for an STM32. I came across some F103 boards where the USB dataline pullups were missing. If you don't have a debug probe for STM cortex-m devices there's an alternative UART way too using STM32-FLASHER.
Dave was transported into a cheezy 60's sci-fi movie at the end there...
Me: it´s 1:39 in the morning in germany, let me sleep!
Dave: Nope!
Be careful with ZADIG, it´s a sharp tool. You can shoot out every USB-driver of your system! e.g. camera or so
The same the thing got me when I worked with Arduino... Good to see that it can happen to anyone, now I know I'm not loosing my sanity.
Windows make me sad everytime I use it. It made me genuinely angry.
Dave, you can just easily fix drivers by using "impulseRC driver fixer" tool
Perseverance pays off.
Perseverance is also the name of my bookie’s torpedo.
I have a couple of STM32 development boards that I have come a gutza on. I might try this and see if I can get them working.
Thanks Dave!
This was very useful. I've had to do similar things to make a Black Magic Probe out of an stm32 'Blue Pill'. Lots of trouble shooting...
Command line shortcut: click once in the File Explorer window with the thing you want to run (the background, not any file in the window), hold shift, right click mouse. You'll get a context menu and one option will be "Open Command Window Here". If your default command interpreter has been set to Power Shell on your system, this option will be replaced with "Open Powershell Window Here"
Why all the hassle with that weird commad prompt operated programming thing?
Why not use STM32CubeProgrammer which get's you going in few clicks, launch program >> change connectivity from st-link to usb >> select port >> connect >> choose file >> programming.
It also doesn't require any additional drivers.
Because then you have to hassle with some random undocumentable GUI instead of the industry-standard dfu-util tool.
a) I didn't know that
b) This is what the instructions on the github said, so I was following those, that was the point of the video.
The developers probably wanted to support an open-source project instead of ST's own proprietary software
Because the ST Register/Login before download is so annoying.
@@JoeBee999 I know it isn't ideal either but I think it's a much better option for beginners.
Done this many times when having some fun with early android phones
Zadig is a great bit of software, I was introduced to it by @IanScottJohnston for when I was updating the firmware on his PDVS2mini (he sent you a PDVS2 a few years back)
I have several AVR programmers and when you switch between them the drivers get all mixed up and Zadig comes to the rescue. Before Zadig it was a bit horrific.
Before watching any further; I've worked with STM32s a ton, and the Cortex M3 does not come with a built in DFU through USB. You'd have to tap into the UART1 headers and flash throgh a serial converter.
Is interesting! I have ordered all the thingies nut some are yet out of stock! Hahaha, i have bought some different kinds of SOP8 Padukas. Thanks Dave. I am waiting like a child to see if i can translate some of my old projects....
STM's Cube Programmer software seems to work ok for DFU. I don't think it's open source but it is free, and avoids the need for Zadig and I've flashed a few chips that way.
"it's a found device" .... i love that :D
If you had used another DFU software which expects the STTub driver instead of WinUSB it would've worked straight away. For example STM's Cube Programmer. Also the migrated message in device manager is pretty common the first message until it's installed correct drivers. And yeah, I agree it's wierd the oldest is at the top, but thats windows for you. :D
Do you know of alternative DFU software which does expect the STTub driver (other than Cube Programmer)?
They have not released a bin? I tend to flash them using the st provided tools.
This is the third video of five in the series, and you haven't even touched the microcontroller this is all about yet…
Any news from the µSupply custom LCD? Will it be sold individually ?
I got same problem with stm32f401 in platformio, when I replace driver use zadig, it can upload use dfu, but it has no virtual com,why?
Can I upload code to the same processor over and over again this way? (no using TTL again)
Ohh, I'm Kardeef on discord. Haven't used that app in like 3 or phones ago and forgot I had a account on it.
“that app”, meaning ‘Twitter’. To me it’s like the faceless goons on Popeye.
It sounds like you need Paul Daniel's something something onscreen probe software as seen on UA-cam by Louis Rossman... Or something like that
Thank you very much, i did all steps even the dfu with the address of 0x0800 and all steps have been done, but even now when i am plugin the board, it can not give the recognized sound !. I have to use boot0 and nrst mode, i am using stm31f411 black bill board.
So is that all mean that on the end you have programmer integrated on your flash ? And DFU from system memory is not in use anymore as not going anymore to boot mode? Is the driver going to flash, how much kB?
LibUSB is a bit tricky to operate under Windows, especially if you haven't worked with USB devices.
BTW that "address" you saw (0843:df11) is an identifier, rather than an address. It consists of two parts: Vendor ID (VID) and Product ID (PID). The computer uses it to identify what type of device it is (to choose the correct driver, for instance). The actual address is the "Port_#0009 Hub_#0001" part, and you can't really change it (nor is it necessary, in almost all cases), short of plugging the device into a different USB socket.
Thanks. That probably explains why I have had Windows machines where usb devices will only work when plugged into the "correct" port.
I'd love to get familiar with these family of microcontrollers, currently know a bit of TI MSP430, MSP432, and arduino family. Keep it up champ!
Arduino is not a microcontroller, nor a family. You meant AVR/ATMega
We use STM32 F4 or F7 processors in FPV mini quads. CPW210 or STM32 drivers, then Betaflight Configurator to flash and tune our kwads. Win10 doesn't automatically install the drivers. Happy Flying.
You could have just used the DFU utility provided by ST directly instead of fiddling with the WinUSB driver. The reason for the replaced driver is because the ST driver interface is not directly supported by the DFU tool you used. ST link Utility or STM32CubeProgrammer would be a much better option and you would get access to all the option bytes as well
I got a similar error using a Teensy as a keyboard. The only way to get it to work on my computer at all was to restart the computer with it already plugged in. It worked on other computers though, I think it corrupts the drivers somehow.
I think i saw STM32F072C8 as supported CPU in Arduino IDE, with STM32duino core.
By default Zadig only list devices without any specific drivers installed (to try and prevent a user from forcefully replacing the driver on some other device it shouldn't like ... his usb keyboard or such).
It seems that you already had a driver installed for STM bootloader, I would guess from some ST dev kit or software that you used in the past and this took over the device (you saw it when you plugged it in first, it first showed up as one thing then a few second later moved somewhere else).
I wouldn't be surprised if David used Zadig at some point with the uSupply. Might be where you're remembering it from, Dave.
No, I've definitely used it myself for at least RF hardware dongles. You need it to remap the WinUSB drivers.
@@EEVblog You remember correctly. That is the same procedure for the cheap SDR dongles that use the R820T2 chip.
im just commenting coz i cant find anything to complain about with this one! :P
LOL cheers Dave
Edit: Dave in black and white reminds me of Bryan Lunduke crying about windows!
This is great, gave it a thumbs up. Question:
"--dfuse-adress" it says not applicable for .dfu downloads. Isn't that exactly the type of file the firmware is?
I couldn't get it to work, i actually skipped that command and just went straight to downloading the file onto the device. It completed the download, i'm not sure if it works as intended. Thoughts?
Any answers appreciated, thanks.
thanks to this video I have a nice and healthy easy pdk programmer excellent!!!!.. but my chips did not arrived yet :-( feel great!
Maybe you should've used linux 😂
So does this thing totally mimic the manufacturer programmer on the fly, or is it like a block buffer to do whatever it has to do? , so you would have the to be written binary as a file instead as an output of the devkit?
Not sure, you'll have to ask the devs.
@@EEVblog Well by the time this video series is over we'll probably know. It is the biggest problem if it expects the programmer to be there for the devkit.
This thing’s just an open source end-to-end solution partially emulating functionality of an OEM-style programmer for two particular product lines, whose binaries run on architectures/platforms which the actual OEM’s programmer cannot. Easier way to pick the dev’s brain is to RtFM not to .gitignore it, and add love with some pull-request anywhere that our ignorance was allowed to persist. Only differences between a binary file and text et.al. is 1 null byte character and perhaps some carriage feed(s)
www.gnu.org/software/ed/manual/ed_manual.html
It's handy to have a linux machine for this kind of stuff. Windows is just a pain in the butt.
I was hoping the driver installation would take longer. Zadig has some hilarious loading messages.
Took long enough already!
@@EEVblog if it had taken longer, you would see something like "How was your day..." then after that "... before it got ruined by this endless installation?".
Managed to find screenshots on Reddit: www.reddit.com/r/ProgrammerHumor/comments/8putv7/so_i_was_trying_to_install_a_bluetooth_driver
Dren Imeraj the redditors say that particular bit of ‘humor’ was only a repost made by a karma 🤖 bot. Yes AI machines are now imposing a nonexistent right to free speech upon us.
Wondering if this would have worked with the generic driver, had you tried to open the Command Prompt with administrator privileges.
Moon on L1 - I like it...
Has Atmel/Microchip bought out ST Micro at some point?
A number of the videos keep referring to programming the "Atmel" micro, but the part number is an ST one and the logo on the chip itself is ST Micros ?!
no, ST is still their own company, I guess he just misremembered. ATMegas just were the goto microcontroller before ARM became popular for prototyping
By the way, where is your padawan dude?
Please anyone guide me here. In the opening Dave says he is going to program an ATMEL processor without an ATMEL programmer, then proceeds to program an STM32. What am I missing?
Parts 4 and 5.
13:35 Dave does his YESSSS yell. 😁😂😁😂
The schematic has R10 & R11 series termination resistors on the USB. They shouldn't be there. STM32F072 has the impedance matching internal so external series resistors shouldn't be fitted:
"3. No external termination series resistors are required on USB_DP (D+) and USB_DM (D-); the matching impedance is already included in the embedded driver"
AFAIK ST programming software (STM32CubeProgrammer) allows to download the firmware via USB DFU without any of that WinUSB nonsense.
Doesn't surprise me, thanks.
The STM32CubeProg supports DFU. Installation is hasslefree. www.st.com/en/development-tools/stm32cubeprog.html#overview
Next time just use the STM32 DFUse Demo software from ST.
But this login/register stuff from ST ist so annoying that I always went away.
Yes, Defuse Demo always run fine out of the box. It's supplier certified, recommended and free. No need and no reason for "cool hacking" and squeezing around with third party tools.
What about the official stm32 DFU firmware?
You could just used the STM32CubeProgrammer software
Winner winner gravy dinner
👍
well id still just whack out my stlink and use swd as i ever did.
ask to list this video on the github wiki
atmel mcu? in first part you refered atmel as well but in 2nd part ST mcu was used,
Brain fart.
Bylines are important, but less-so than the main title.
I feel like i watched this video a few days ago 🤔.
You might have seen it unlisted on a playlist.
EEVblog “unlisted on a play list”?Oxymoronic.
May I propose the Atom Lite M5 Stack as a future topic? Are they any good? ESP32 inside.
PS: It's ok, Andreas Spiess made a video.
Atmel? DFU?
For the next time use this the ImpulseRC Driver Fixer, it is the easiest way to fix the dfu driver for stm32 micro. It’s a must have in the drone hobby.
impulserc.blob.core.windows.net/utilities/ImpulseRC_Driver_Fixer.exe
Dang, several days in and we still don't have a single flashing LED.. :)
Edit: seems like UA-cam fixed the app. No more losing its place. Going to be a very long time before I let another update happen.
I hate this new broken upgrade: iMobile app open up one threaded comment then exiting it returns to the catalog of related videos, automatically closing the comment stream requiring reopening the list returns me to the first comment.
Such a shame they didn't take the oppurtinity to go with "I'm sorry Dave I can't do that" as an error message.
Heh.. Hopes the HW doesn't work so he can troubleshoot. But as soon as the software doesn't work OOTB ...
It’s good to pre-set your aspirations low so your temper isn’t lost when the hope is dashed to smithereens.
FlashCat programmer
works good for programming 😳👍 easy breezy beautiful cover girl 👧
Oh, it's WAY easier to do such things in Linux. Such problems just don't exist. Everything is working just out the box, probably one or two simple commands are required to install toolchain/programming utility.
Conclusion: Based upon this ancient paleontological discovery, Linux must have therefore been a great monolith, with every fork of it containing every binary for every architectural platform, precompiled in a single, enormous online repository.
Is this a re-upload or something? I'm 100% sure I've seen it before.
what's going on?!
No, but you may have seen the unlisted video in the playlist
that's what happens when you steal Dave's DeLorean ...
DFU gets it programmed, but does nothing to help with debugging. Just go straight to SWD since you will eventually anyway.
Now its time for bigclive to build this Programmer and show us some of nice projects. ;)
Windows requires a reboot unlike Linux MInt but I reboot anyway.
it lierally tells that is supports dfu on a stm32f2 and f4 and you try an f0 well dude. what ya expectin
I've also used zadig to overwrite usb drivers for interfacing with smartphone bootloader. I think the windows driver stack is FUBAR and we should run the hell away from microsoft products
A good interface is a simple one & stand-alone if possible .
A one click operation or data file drag & drop .
Program file *****.bin or hex Yes or No !
Simple ….........
No installing of special drivers needed just a readme , the data , exe . tar or apk .
We need programmers not script kids compiling code that needs three libraries , seven linkers a working online server & three hail marys .
SWD/JTAG
Haha, a Windows nightmare, as usual.