Тёмный

Mbed OS for easy STM32 programming 

iforce2d
Подписаться 76 тыс.
Просмотров 70 тыс.
50% 1

Опубликовано:

 

27 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 68   
@superdau
@superdau 6 лет назад
I had a lot of the fussy behaviour with the programmer on the nucleo board as well, including the "replug to fix" steps. I did also have similar problems when using the USB stick (but not as frequently). But I think it never happened when *I did not just connect the data and clock lines from the programmer, but also the reset line.* My guess is that if you do anything to the SWD interface pins in software (could happen unknowingly when accessing the whole port or changing one of the many peripheral/clock/bus options for other pins for example), the µC can no longer be brought into programming mode by these two pins alone. That wouldn't explain the "randomness" of it sometimes failing even when using almost the same code though. But I made another observation: I sometimes had flash errors (sometimes already at the erase stage, other times the flashing itself would go through, but the verification would fail). This would happen if I used the programmer as power source as well. Everything would be powered from a single 3.3V regulator that might struggle when in addition to the programmer and the target a few LEDs or sensors would be powered as well. Or it might be the common ground connection that would lead to invalid voltage levels due to the current in the ground wire. Again, can't guarantee it's the exact reason, but *I've since stopped using the programmer as a power source and just connect GND, data, clock and on occasion reset.* For power I use either the outputs that most USB-TTL-converters have, or preferably 5V from another USB port if the board has its own onboard regulator. Can't remember having a failed flash since then.
@marklewus5468
@marklewus5468 4 года назад
My first experience with microcontrollers was in 1980 with the Intel 8048. The programmer/debugger was a 20 pound steel box painted Intel blue. It cost $5000 (~$20K today). As I recall the chip ran at all of 700,000 instructions per second and had 1K of ROM and 64 bytes RAM. After watching your video I took my $12 STM32F407 board and had it blinking an LED with mbed in about five minutes. For free. It just blows my mind!
@TheChrisey
@TheChrisey 4 года назад
700,000 instructions is still incredibly fast. People today do not realize how insanely fast modern processors are and how much data they can process at once. Too bad shitty software ruins it, and all people can think of is to buy even faster hardware to compensate for it
@noweare1
@noweare1 6 лет назад
Just crazy, I remember programming on an 8 bit Motorolla board adding a software serial port programmed in assembly. And tested using an simulator first. Now we have free IDE's , compilers and dirt cheap boards that do incredible things for less than $10 bucks.
@superdau
@superdau 6 лет назад
And btw. I started to look for the pinouts as well at first. In the end it was much more useful to look at the specific datasheet for the chip you are using. The functions are on the same port pins for a wide range of the STM32 series. So once you know that I2C is here, serial is there, aso. you don't even need any documentation anymore as long as the board you have list the pin's port name (like PA1). It also helps alot to know the datasheet if you start to juggle the hardware functions around (almost all serial, I2C, SPI ports can use alternate pins). In the good old cleanflight days ;) that allowed me to have 5 hardware serial ports on one of the F103 series chips (one with a higher pin count) as well as an I2C port, RGB LEDs, sonar, beeper aso. Unfortunately I was more into knowing on how to do it than actually using it, so my quad only flew for a few hours with that. XD
@svenprigann2631
@svenprigann2631 3 года назад
I really Like the Style of the video. Mit cutted out of any stuggle makes it more human. Subscribed right now:)
@grimreboot
@grimreboot 4 года назад
Thank you for the video! I like the fact you leave in the quiet bits and the fiddly bits in, too many videos are setup to rush through as quickly as they can.
@undercrackers56
@undercrackers56 3 года назад
After only 4 minutes of your video I discovered that MBed is an online tool and is more suited to hobbyists who want to share their projects. Thank you, thank you, thank you for not wasting my time.
@kayaonur5657
@kayaonur5657 4 года назад
Thanks for keeping the fuzzy save part at 15:00 in the final video.
@GnuReligion
@GnuReligion 6 лет назад
Thank you for the intro to Mbed! I appreciate your interest in these boards. Just want to note, that one of the least expensive and most common STM32's for the hobbyist, is the STM32f103c8t6. All the ones recently manufactured have 128kb flash, making them STM32f103cBt6's, in fact (note the "B"). These support simple serial programming. Using a serial interface, you can install the Maple bootloader. Afterwards, they are easily programmable/ACM-debuggable thru USB2 with Arduino software. You can find BluePill and maybe BlackPill boards on Ali for around $2. The raw chip can be had for about US$1.04. I build my own. If you must have STlink, and do not want to buy dedicated hardware, it is easy enough to manufacture a BMP or Black Magic Probe (just google it). Check out stm32duino.com
@vatterger
@vatterger 5 лет назад
I have used Mbed for a university project, it's not really that much more easy than using the new STM32 Cube IDE once you encounter any roadblock at all, since there is no debugging. You're literally poking around in the dark Arduino style, just this time with a much much more complex MCU. My advice is to check out STs Cube IDE, it comes with all the bells and whistles: CubeMX (MCU selector, start-up code-generation, graphical clock and GPIO/Peripheral config), compiler, stack-analyzer, debugging and proper auto-completion. I wouldn't ever go back.
@anonimuso
@anonimuso 5 лет назад
This is a very informative video. And it's good you leave in the goofs because we all do that, and it helps newbies be aware of what can go wrong.
@walterhynson2898
@walterhynson2898 5 лет назад
Thanks great video after 1 hour of learning Mbed I can plug in the board write a short program and bingo it works...this is after trying cube mx ide for 3 weeks and nothing but problems and headaches Mbed is the way to go.
@iforce2d
@iforce2d 5 лет назад
I haven't tried cube mx but I will say that every other method I've seen for developing on STM32 looks like quite an ordeal
@trt969
@trt969 6 лет назад
Awesome, when I was learning I used those Nucleo boards (Nucleo F072RB and Nucleo F446RE) but I used the Keil uVision and the Atollic TrueSTUDIO sometimes CubeMX as well =D
@walterhynson2898
@walterhynson2898 5 лет назад
Mbed is the way to go.
@wernerberry7800
@wernerberry7800 4 года назад
Thanks so much for sharing Buddy!! Really love this stuff and learned a lot! Really great!!
@leorusnac
@leorusnac 6 лет назад
Not really a fan of mbed, but nice video. One thing I find very nice on the stm is the dfu, more or less like the flight controllers, once you put the stm dfu bootloader you can program them through the usb cable on the board. You can flash the dfu bootloder with an ftdi or similar thingy.
@TheSadButMadLad
@TheSadButMadLad 6 лет назад
The problem with the upload is something to do with the USB side of things. It locked up and that's why it appeared as a new device ACM1 when restarted. It couldn't complete the previous download so left part of the binary behind so you needed to do the whole programming process again after reconnecting.
@KernHerskindNightingale
@KernHerskindNightingale 4 года назад
Thanks for the video. Very helpful and detailed. Cheers.
@plam600
@plam600 6 лет назад
Love your work. Keep those mistakes in! They are great for learning. Wonder if we can flash OpenTX onto the F4 VET6 for a DIY TX. For that price might as well give it a try.
@Beshenya
@Beshenya 3 месяца назад
How to use U8g2lib for OLED displays? Mbed cant see any types of displays.
@darkobul1
@darkobul1 6 лет назад
Haha I was wondering about you getting into stm32. I got bunch of them as well to explore. I was confused at first about tool-chain and how all it works with c. There are abstractions like HAL but learning how to read documentation and all registers and their functions you get a really a lot of insight how to make eficient code. How to use DMA and hooking it up with pin ports. And also hardware interrupts and set their priorities. Cool stuff from the RISC world. There is also RTOS and python I didnt get there yet but RTOS looks cool for some event driven systems. I even started to make test with your code for stepper motors to see how it would perform on STM32F103 but I got sidetracked with other stuff so i just used GRBL port from GitHub which works good. They say 180khz pulse rates can be achieved.
@Mustafff76
@Mustafff76 4 года назад
Thank You very much, Your video really helped me out. I tried programing stm32 using only HAL library, but it seems to complicated for my application. MBed looks realy decent :D
@priyabratasaha5385
@priyabratasaha5385 6 лет назад
Great video. Very educational and helpful.
@electronlab5551
@electronlab5551 4 года назад
Great video.thank you so much
6 лет назад
I prefer writing Makefile, start, link and openocd scripts. Since embedded systems usually run on offline environment. And bare metal development can actually use more flash than with mbed rtos.
@jameslamb4573
@jameslamb4573 6 лет назад
Mbed OS is open source, get if from GitHub and install it on your own computer if you are worried about ownership. I'm not suggesting you are btw.
@jojos681
@jojos681 6 лет назад
ProTektWar (dot) com it is using gcc, but if you have Keil or IAR Compiler it is supported as well.
@sandeepthorvat6395
@sandeepthorvat6395 3 года назад
hi sir how can copy hex file from exeting STM32F103C8T6 chip ??
@thekarter712
@thekarter712 4 года назад
What type of USB cable did u use on STM32F4 nucleo board ?
@wi_zeus6798
@wi_zeus6798 6 лет назад
Thanks for the video!
@electronic7979
@electronic7979 6 лет назад
Useful video 👍 Excellent 👍
@goobisoft4873
@goobisoft4873 6 лет назад
Desperately waiting for plane build part 4
@chrisleech1565
@chrisleech1565 6 лет назад
Hi Chris, I was using the lager of the cheap versions with the JTAG con to run Cleanflight in earlier iterations. Presented by a chap on RCGroups, we would add 10DOF sensors modules and try to get it to work on a 400 class quad. Not enough room on a 250 or lower :-) Plus the gyro was always offset. Sadly the F1 and F.C.'s like th Naze32 are truncated into oblivion and no longer supported. Needs for greater than 256K Flash mem being the key factor? . Not entirely sure . Did you ever hear of this project? Never had much luck with them, but gave it the college try as they say ! I have killed more FC's and STorM32 BGC boards than anyone for the record :-)
@iforce2d
@iforce2d 6 лет назад
I had not heard of that project. I still use F1 boards on my miniquads, perfectly adequate for the job. Just made another naze32 build last week actually :)
@chrisleech1565
@chrisleech1565 6 лет назад
Prefer IPA these days. It all the rage.
@CircuitandoEL
@CircuitandoEL 4 года назад
Hi! The pins of SWDIO and SWCLK is the same for STM32F407ZGT6? Thanks
@iforce2d
@iforce2d 4 года назад
I don't know. But I'm sure there is a datasheet that will tell you.
@TomaszCzajka80
@TomaszCzajka80 6 лет назад
What is the USB port used for on those boards, power only? Can you not use is to program it?
@iforce2d
@iforce2d 6 лет назад
No, that's why the white board I use at first has that extra section, to flash the program onto the main chip, and why I used the ST-Link dongle for the others. Depending on what pins the USB data lines are connected to you can probably do something useful with them though. For example according to the schematic for the large black board, the USB data lines are connected to PA11 and PA12, which are also labelled CANTX and CANRX. So I guess perhaps some kind of CAN bus device could be used with that, I don't know... wiki.stm32duino.com/images/5/5c/STM32_F4VE_SCHEMATIC.PDF
@bennguyen1313
@bennguyen1313 4 года назад
So according to AN2606, it seems all STM32 have a built-in bootloader in ROM. So is the programming method (mbed or iar) always the same.. just copy the bin file to it via usb? If so, how does it know it hasn't already programmed it on the next reboot, and/or know that it's a programming file and not just user data?
@iforce2d
@iforce2d 4 года назад
No, as I said at 0:19 you usually need a STLink programmer, it's not simply 'copying' via USB. As I mentioned at 7:42 the white board has that programmer built in, and it presents itself to the computer as a disk. It detects new files placed on the 'disk' and flashes the main chip, to make life easier for beginners. Normally flashing would be done like I showed at 17:54 and 22:54, to writing directly to a specific memory location.
@bennguyen1313
@bennguyen1313 4 года назад
@@iforce2d Thanks! I *think* I see my problem.. I have a Nucleo board with the St-Linkv3 that looks the same as yours, but apparently not all Nucleos have mbed flashed to it, so I can't program by copying the bin via the mass-storage-data-transfer. Instead, my options seem to be 1) connect my usb directly to the main cpu's usb via the header pins, boot into the BOOT0 bootloader, and finally convert the .bin file to a dfu format (using the DfuSe Demo 3.0.3/3.04 to target the internal flash id (00)) and flash using the dfu programming utility / stm32-versprog. Or 2) compile everything offline as to generate an .elf/.hex/.srec compatible with the st-link / st-flash utilities (which use the cpu's swd/jtag pins). Interestingly the st-link and st-flash utilities, show that they support .bin, yet I couldn't get that to work!
@noweare1
@noweare1 6 лет назад
Do libraries exist for this board like the arduino. For example writing code for a RF board instead of using an existing library like you can for an arduino would be very time consuming.
@iforce2d
@iforce2d 6 лет назад
Thousands of user-contributed things at os.mbed.com/code/ Naturally the more common devices will have more options around. Porting is not that hard actually, eg. for an I2C device the read and write calls just need to be called on a class of the right type.
@ЭльдарБалаканов
Hello! Tell me what is the problem? When using "atan2", the "Call "atan2" is ambiguous" error in Mbed Studio? mbed v5.14.0. What is? Help me, please!
@iforce2d
@iforce2d 5 лет назад
I don't know why you would be asking me this, but anyway... most likely you need to clarify what type of variable you are passing, so instead of eg: atan2(1,1); ... try this instead: atan2((float)1,(float)1); This is a generic C question, not related to mbed specifically.
@ЭльдарБалаканов
@@iforce2d Thank! I'll try! But the fact is that, for example, VisualCode copes with this absolutely normal. Therefore, I thought it was a feature of the library from MbedStudio
@iforce2d
@iforce2d 5 лет назад
Yes, it depends on the compiler, and the definition of the functions or templates that are a possible match for the call being attempted.
@tylersnard
@tylersnard 5 лет назад
Online ide = really smart.
@avejst
@avejst 6 лет назад
Thanks for sharing👍😉
@TuncayKandemir
@TuncayKandemir 5 лет назад
nice job thank you :)
@jojos681
@jojos681 6 лет назад
Great stuff! For the STM32F407VET6 Board I’ve written a SDIO driver for the onboard SD card. Also a FSMC driver for the plugable TFT board. I need to clean it up a little more to make it easier accessible. If interested visit github.com/jojos62
@MrFrobbo
@MrFrobbo 6 лет назад
Great video thank you so much, didn't even know these existed. I'm now stuck trying to work out what's best for my boy and school compatibility etc. But just to let others know there is a plugin for Arduino IDE allowing STM32 dev offline... www.dimdim.gr/2017/01/stm32-microcontrollers/ www.stm32duino.com Quick question, is there a single step mode in the IDE? Cheers
@TheChrisey
@TheChrisey 4 года назад
Lol fortunately for me then as I can speak Korean
@kB-hg2ci
@kB-hg2ci 10 месяцев назад
MBed OS is pure garbage. I could not even get started, I tried two different browsers with no luck. A total wast of time. Run like hell.... DO NOT WASTE YOUR TIME
@iforce2d
@iforce2d 10 месяцев назад
hmm... 'could not get started', 'no luck'... how very vague. iirc I showed all the steps in this video, there were no problems I could see. A better criticism would be that it's kinda wasteful of memory and you can't have quite the full control that you would if programming at lower level, but to call it garbage just because you personally couldn't use it is weak.
@kB-hg2ci
@kB-hg2ci 10 месяцев назад
@@iforce2d i don't doubt the quality of your tutorial. The software is garbage. I moved on to SEGGER, what a brilliant software. Lightning fast and very easy to use. Thanks
@iforce2d
@iforce2d 10 месяцев назад
You still haven't given anything specific about the problem, you merely called it garbage again for who knows what reason. So I don't even know what we're talking about.
Далее
STM32 Guide #2: Registers + HAL (Blink example)
30:02
Просмотров 204 тыс.
What Is Mbed OS (STM32)
10:24
Просмотров 10 тыс.
STM32 Blue Pill vs Black Pill Microcontroller Boards
18:31
Just enough assembly to blow your mind
29:31
Просмотров 113 тыс.
Визитка программиста
19:40
Просмотров 92 тыс.
Weeny solder bot (LinuxCNC on A4 paper size)
58:03
Просмотров 98 тыс.