my case (button is on PC13) if I set it to EXTI13 I get this error while compiling: HAL_EXTI_IRQHandler(&H_EXTI_13); undeclared
@stm32world4 сағат бұрын
Based on the information you give me here I don't have a good response. Not sure if you are using STM32CubeMX, but if you do, a common mistake (which I have done many many times) is to enable the GPIO as EXTI but NOT configuring the NVIC to handle that interrupt. There are two steps in STM32CubeMX. Enabling the interrupt in NVIC will configure the interrupt handler resulting in the callback function being called.
@abhimanyuawakeКүн бұрын
Hello, i am using nucleo board STM32401RE. i am getting "../FATFS/Target/user_diskio_spi.h:8: error: unterminated #ifndef" this error
@stm32worldКүн бұрын
Line 8 in that file in my repository is a comment line, so not sure where you got it from. Check my repository here: github.com/STM32World/stm32fun/tree/master/stm32world_spi_sd_fatfs/FATFS/Target
@kirkb3575 күн бұрын
Very helpful. Thank you
@stm32world5 күн бұрын
You're welcome, glad to be of help.
@niclash5 күн бұрын
The only thing I can think of is that C programmers don't write "uint8_t *ap = &a[0];" If one just want the address of the start of the array, then "uint8_t *ap = a;" is the more common and less verbose way. This is especially common when manipulating "strings" which in C doesn't exist and are simply "character arrays". I suggest that you make a video on strings, since it often confuses newcomers.
@stm32world5 күн бұрын
Yes, I know this but wanted to make it clear - hence more verbose ;) I should have mentioned that.
@stm32worldКүн бұрын
You are absolutely right about the strings. I originally planned that but by the time I was getting around to it the video was getting too long. I will add one.
@kirkb3576 күн бұрын
I have some microcontroller experience but am new to the STM32 and their IDE. Your video was extremely helpful in deciphering their way of doing things 😎 Your next video is on my list. Hoping to control an OLED display shortly.
@stm32world5 күн бұрын
I actually just picked up a bunch of sensors, displays and other stuff in preparation for future videos. One of those little SSD1306 OLED displays were one of them and they are quite easy to get working. I am glad you enjoyed the videos.
@funstuff62415 күн бұрын
@stm32world I now have a 1306 OLED working with the Blue Pill, but using the Arduino IDE. I was unable to make it work with the STM IDE so your video would be appreciated 😎
@stm32world5 күн бұрын
A video will come probably in a couple of weeks.
@sergo434019 күн бұрын
Thank you, I repeat everything after you, so far everything is working out, but I have contacted AI several times, he is helping everyone now.
@stm32world19 күн бұрын
Well, I can guarantee you that NO AI is involved in any of my videos ;) Only experience and knowledge. I would however be curious to know which part you felt was missing in order for you to make it work.
@sergo434019 күн бұрын
Hooray! Finally, I got the LED on the STM32F411CEU6 to blink! For two days I was persistently delving into the first two lessons, I kept thinking when it would blink, I was about to give up, but I spent a lot of money and ordered a lot of parts. Before your videos, I tried to run the STLink-V2.1 and STM32F103CBT6 Blue Pill Plus bundle and I even succeeded, the LED blinked, but the happiness did not last long. Pill F103CBT6 stopped accepting the firmware, I thought that STLink-V2.1 was not updated correctly, but in conjunction with STM32F411CEU6 it works fine, which is now confirmed by the blinking LED. And Pill F103CBT6 LED still blinks, but no program sees it, maybe I'll gain some knowledge and figure out what happened to it.
@stm32world19 күн бұрын
I think I mentioned it in the first video, but most of the boards with stm32f103 contain fake chips and _that_ is just a waste of time. As far as I know F401 and F411 are all originals and thus behave the way described by ST in the datasheets.
@sergo434020 күн бұрын
Thank you! You explain in great detail, just right for beginners. I decided to delve into this topic, as I recently dove into the world of FPV mini-drones. I want to try to get into the brains of drones. I ordered different test boards from WeAct Studio: STLink-V2.1, STM32F103CBT6, STM32F405RGT6, STM32F411CEU6 and STM32G431CBU6. And I also ordered an additional STM32F411RE Nucleo-64. I hope your tutorials will help. Thank you for sharing your knowledge!
@stm32world20 күн бұрын
Thank you for the kind words. I am trying to strike a right balance but I am still learning and I might get it wrong in some videos. As for buying multiple development boards you did - as I was hinting in video 1 - the right thing! STM32 is often confusing to newcomers due to the sheer number of different models available. Being able to work with multiple of them and shift between them will enable you to pick the right one for whatever project you are using in the future. As a goto for learning exercises I often myself end up with one of the F4 series - either F411 or F405. For a start you might end up using the Nucleo board due to it's built-in st-link which I think have both serial and swo pins connected.
@timucinkanatli679420 күн бұрын
if you use "volatile" while defining like this: uint8_t volatile buf[32232] .... the compiler will not optimise and delete it even it is not used after
@stm32world20 күн бұрын
Right - didn't occur to me but you are right. This is a learning experience for me too and I wish there were more comments like yours.
@stm32world20 күн бұрын
Actually volatile might not be enough. I just tried it and it will still optimise it out with volatile. I am going to dig further into this.
@timucinkanatli679420 күн бұрын
@@stm32world Try __IO instead. It is not universal but STCubeIDE might be more happy with it
@timucinkanatli679420 күн бұрын
@@stm32world Try __IO instead. It is not a C keyword but STM32CubeIDE might like it better
@timucinkanatli679420 күн бұрын
@@stm32world Can you try __IO instead
@KeyserTheRedBeard25 күн бұрын
Impressive video, STM32World. Looking forward to your next upload from you. I smashed the thumbs up button on your content. Keep up the fantastic work! The way you explained the practical implications of the low-speed internal RC oscillator was enlightening. Have you considered how external factors might further influence the accuracy of your timing calculations?
@stm32world25 күн бұрын
I can't remember if it shows but if you look at the measurements they drift quite a lot. I think it is quite temperature dependent. Anyway - as pointed out it _is_ within specs, so it is just something one need to take into consideration ;)
@stm32world18 күн бұрын
I measure the LSI by counting pulses based on timing from the HSE. The HSE will remain fairly precise at all time - without looking up the crystal specs we're talking ppms of drift. As mentioned, the RC oscillator is a different beast. I suggest you calculate worst case and THEN add a safety margin of 20-30 %.
@larbibenmoussa126925 күн бұрын
GREAT CONTENT!, i am an intermediate embedded programmer and STM32 is absolutely terrifying to me as i bought a couple blue pills that i struggled to even make work so thank you very much!
@stm32world25 күн бұрын
I think I mentioned in that video that most of the so-called blue-pill board use clone MCU's which cause all kinds of headaches.
@niclash25 күн бұрын
Yeah, it is important from a software point of view to consider a) the spec limits and b) the "jitter" in the code, which may happen from interrupt disable and such. I generally advice to kick the WD twice within the worst-case according to spec (1 second in this case). Another thing is to consider what the WD is "protecting" against. We have MCU failures due to EMI where everything stops (except the WD one hopes), but also against software bugs where code hangs in a loop, or gotten into an invalid state and doesn't do the right thing. Having the "WD kick" in an interrupt routine may not be ideal, and one should possibly put the "kick" in the main loop of the application. And that location may have way more "jitter" to consider. Kicking the WD is cheap, and doesn't hurt to do it too often.
@stm32world25 күн бұрын
In this particular case what annoyed me initially was that the behavior i saw did not match the theoretical one. Understand how bad the RC LSI is helped with the understanding and well - calculated from the measured LSI the numbers add up ;)
@stm32world25 күн бұрын
If you use the WWDG it does hurt to do it too often. That one is a tricky beast ;) In fact I'd say it is mostly useful to check the NVIC still behaving as it has the ability to fire an interrupt shortly before resetting but well within the allowed window.
@niclash25 күн бұрын
@@stm32world Alright, although the (lack of) accuracy is right there in the datasheet, nearly a 3x variance allowed.
@niclash25 күн бұрын
Never used the WWDG.... Looking forward to the episode about it. ;-)
@stm32world23 күн бұрын
Not looking forward to making it - if anything but interrupt driven. The benefit of the WWDG is that you do get an optional warning interrupt before the reset.
@bubaks226 күн бұрын
❤
@stm32world25 күн бұрын
Glad you enjoyed
@mail8752327 күн бұрын
CAN and CAN FD is also a preferred topic
@stm32world24 күн бұрын
CAN is definitely in the pipeline ;)
@mail8752328 күн бұрын
If I may suggest an idea for a series of new videos, it is a socially useful project useful in practical life. For example, a PID thermostat with modbus communication protocol. I believe you will like the proposal and your video tutorials are otherwise excellent.
@stm32world28 күн бұрын
Yes, I am quite sure I will end up with something like that. Perhaps not modbus as I have no gadgets lying around supporting it, but CAN might be an option. While I can of course make a series I am limited somewhat by viewers patience ;) I have to come up with videos that will fit in an under 30 minutes time frame roughly.
@mail8752327 күн бұрын
@@stm32world For a video that is too long, please focus on the topic without a lot of talking around the topic and nice chat. I think that's the problem and not 1 hour video too long
@RehanNasar-k5e28 күн бұрын
Great job with the videos! These are really helpful.
@stm32world28 күн бұрын
Thank you very much for your kind words. Glad to be of help.
@FrancisekTАй бұрын
great video
@stm32worldАй бұрын
I am glad you enjoyed it and I hope you learned something from it.
@hertz7588Ай бұрын
Once again, much appreciated.
@stm32worldАй бұрын
I'd be very curious if you feel I skipped too quickly over some of the stuff. I am still trying to find the right balance.
@hertz7588Ай бұрын
@@stm32world No, there was enough information and the various options that needed to be enabled or set. It’s a good grounding, just requires some practice for me to become proficient.
@stm32worldАй бұрын
I can not get into how many times I forgot to enable interrupts in stm32cubemx - that is just the way it goes ;) Have fun.
@hertz7588Ай бұрын
Much appreciated. Great help in understanding STM environment. Some videos on Dual core with Display such as STM32H7 DISCO + Touch GFX would be nice.
@stm32worldАй бұрын
I will probably get around to some displays, but the problem with those are that they are all different. I have some devices with ST7789 display and some with ILI9341 with or without touch. The dual core mcus will be in some distant future - there's plenty of stuff to dive into in the basic devices and you should master the basics first.
@hertz7588Ай бұрын
@@stm32world Thanks for the reply
@alejandrobenavides612Ай бұрын
Very much enjoying the series so far! Thank you for creating these videos
@stm32worldАй бұрын
Glad you enjoy them - still got a few to go if you are at #4. I try to publish a few every week.
@PatrickHoodDanielАй бұрын
Excellent video. I know nothing about FreeRTOS and I am happy to learn something about it. Keep up the great work!!
@stm32worldАй бұрын
Thank you for the kind words. If you are interested in trying out FreeRTOS you should have a look at the first two videos. The first one introduces the basic concepts and the second one dives into how to gather performance statistics. If memory serves me you are using an STM32F0xx. I am sure it _can_ fun FreeRTOS but you might be a bit memory restricted on that one ;)
@PatrickHoodDanielАй бұрын
@@stm32world Thanks. I will definitely watch those videos.
@5-Minute-SYАй бұрын
Hi . Great playlist! Super helpful . Can u make a playlist about Linux ? That will be so nice . Thank you .
@stm32worldАй бұрын
Well - I have been using Linux for 25 years (since kernel < 1.0) so that might actually be an option. Wouldn't fit in this channel though, so it would be a new channel I guess.
@5-Minute-SYАй бұрын
@@stm32worldLooking forward to it
@breadx333Ай бұрын
thanks for the tutorial 😊
@stm32worldАй бұрын
You're welcome
@breadx333Ай бұрын
is it mainly used in time critical applications like RTOS to exactly be sure that tasks work correctly otherwise it will reset it?
@stm32worldАй бұрын
Most embedded applications are meant to run for a long time, hours, days, weeks, month. If not carefully designed for example the heap _can_ get fractmented. A watchdog (mostly the IWDG) can ensure the device will restart and continue running. The IWDG can be used in any long-running application. If timing critical, the WWDG might be more obvious for FreeRTOS. I will do that in a later video (already recorded) (and added to the github repo). To summarise, a watchdog is one of those things that _really_ shouldn't be necessary but in real world applications it can often be helpful.
@mealshake4284Ай бұрын
Great work ! you need to show from creating the project and share the final code on github for example so we can reproduce it and build it or integrate it in an existant code. Thanks.
@stm32worldАй бұрын
I did in the first couple of videos. All the examples are available from Github.
@edwardcomeau2625Ай бұрын
I was looking for PICO PIO work with DMA to do basically the same, read a message to idle into a DMA buffer - found this video very informative on what I'm trying to do being on the right lines and if I can't achieve with PIO then great to know about what the STM32 can do as another option. Great video!
@stm32worldАй бұрын
When I discovered that one about a year ago I think I was quite surprised that this is not being mentioned more often. The receive to idle makes it much easier to work with serial receive. Happy you enjoyed the video! Check out my other videos in the series - you might find another surprise or two (bit banding is a life safer too).
@breadx333Ай бұрын
Great tutorial. Do you know about system design?
@stm32worldАй бұрын
Well, I know some things ;) But you would need to be a bit more specific what you have in mind.
@breadx333Ай бұрын
@@stm32world I want to know how to design the architecture before starting a project. For example a simple project here: some sensor with display and menu in it which is controlled by buttons. Should I use bare metal for that, what interrupts to have, if I use RTOS what tasks do I need, how to create menu, share&log data and ... I know this should come from experience, but I lack of it(( I would very like it if you had some videos about how systems like coffee machine, digital watch, camera, sensors of cars, rockets and etc, work from the abstract software embedded engineer's view
@stm32worldАй бұрын
@@breadx333 Well - personally I try to break it down in a modular fashion. 1 block is the MCU and whatever is required to run that, 2nd block perhaps the display and so on and so forth. If possible I like to get everything up and running on an appropriate dev board, test display, test buttons etc. Once I feel confident I know how to throw it all together using the right pins I create a schematics and from that a PCB. There's a LOT of documentation on the stm32world wiki - check this for example: stm32world.com/wiki/MIDItio - it even documents changes between first and second revision.
@stm32worldАй бұрын
@@breadx333 The "system" does not matter. What you always do is to break the "system" down into manageable parts and then attack the parts individually. Understand the parts before you attempt to throw the system together.
@stm32worldАй бұрын
"bare metal" as you put it or rtos really doesn't matter. Every time I have begun a project with FreeRTOS I have ditched it at the end. It usually end up making things more complex rather than simpler. An interrupt driven approach is usually simpler. But again - get the hardware and individual components right first - then throw it all together.
@mealshake4284Ай бұрын
You are doing great job ! I saw in the planned videos you will talk about USB and DIY Bootloader, can you explain and show : - How to flash fw through USB without any buttons, just using PC software using DFU or MSC (UF2) - USB IP or USB WIFI for vendor specific devices Thanks.
@stm32worldАй бұрын
USB will come later. I am struggling a bit coming up with ideas which will be possible to squeeze into < 30 min videos. The bootloader - well - first you should check the earlier video on jumping to the built-in bootloader. With enough storage on-board it _would_ be possible to do this more elegantly so that video would come after I have been showing SPI flash ;) Your comments and suggestions are greatly appreciated!
@breadx333Ай бұрын
thanks for the video. could you teach us how to work with sd cards?
@stm32worldАй бұрын
That is a pretty good idea. I don't have a STM32World board designed yet but I might throw one together. Alternative I do have a couple of STM32F405 based boards with a SD card slot on them. The sd card interface is quite simple. The hard part is to use the FAT library actually.
@stm32world11 күн бұрын
I hope you checked the last couple of videos - #33 and #34
@niclashАй бұрын
Referencing main.h in library isn't a good idea. Should only reference what is actually used, for instance a particular header file. If it is a variable, then declare it "extern int some_var" in the library.
@stm32worldАй бұрын
Ok, point taken. In this case a few typedefs
@breadx333Ай бұрын
To use the live expression do I need to configure the MCU's debug mode to Trace Asynchronous SW mode or Serial Wire is enough? Also can I use st-link v2 for that or do I need JTAG?
@stm32worldАй бұрын
I think you will find an answer to your questions in Tutorial video #17 kzbin.info/www/bejne/oF6qkniQgNeemLM In short, you can use a st-link v2 if it is an original. The Chinese clones do not include a SWO pin by default.
@stm32worldАй бұрын
Sorry, I missed the "live expression" part of your question. And no, no need for Trace - Serial Wire is enough and that will work with any st-link - even the Chinese clones.
@niclashАй бұрын
"/ pow(2,4)" == ">> 4"
@stm32worldАй бұрын
Right - but I lifted the formulas straight from the datasheet. Easier to toubleshoot later.
@milanercegovic8413Ай бұрын
Hi, nice video, I have shield that fits on Arduino Mega 2560 for electronic lead screw, it has connection to fit, spindle encoder,100 line hand encoder. stepper drivers, LCD, rotary switches, push buttons, menu buttons, joystick etc. Each pin is pull up with 1K Resistor. To make shield for STM32F767ZI to fit above things, can board handle it, it say pins are 5v tolerant. Or to install 3v3 to 5v level shifters. Thank you.
@stm32worldАй бұрын
That's a tricky one. Ultimately it will probably boil down to how much current will run into all the pins on the stm32 when going low and that could become a bad thing. You would have to read the datasheet for your specific mcu and schematics of the "shield". 5V tolerant pins is a nice thing but they probably shouldn't be relied on without careful consideration. I have used it a few times - for example to drive ws2812 leds (which require 5V data).
@milanercegovic8413Ай бұрын
@@stm32world Thank you, to be on safe side use level shifters 3v3 to 5v for each pin, can you recommend which shifters for analog pins and digital pins.Thank you very much.
@stm32worldАй бұрын
Sorry, no - the recommendation would be the same - look at the schematics and the datasheets for the individual stuff.
@niclashАй бұрын
@12:25 Nitpick; It is not "after reset" but "after initialization".
@stm32worldАй бұрын
Hmmm, yeah - you are probably right about that, but nitpicking back - IF the initialisation is run at each reset then that would technically also be the same. I am going to test this, which _can_ be done the moment "main" is called before the HAL/NVIC etc. get executed.
@wwadleyАй бұрын
Yes, a very comprehensive overview of the GPIO! Thank you very much.
@stm32worldАй бұрын
I hope it is useful. I am doing a deeper dive into the HAL library in the next few videos.
@niclashАй бұрын
So the code for the STM32F411 wasn't identical?
@stm32worldАй бұрын
There was one declaration different - which was so far fetched I didn't even bother to check.
@stm32worldАй бұрын
And I know it's embarrassing - hence the video title ;)
@stm32worldАй бұрын
Sorry about the audio in this one - don't know what happened.
@LuthfanTaufiqArrafi2 ай бұрын
I can't add serial output using st link v2 (chinese). In the video, you didn't add swo and I don't think it's necessary. Is swo still needed to bring up serial even if it is not added in the ioc file? btw, ur videos help me so much, thx uu
@stm32world2 ай бұрын
The clone ST-Link devices does not have serial or swo (swo _can_ be added with a bit of tweaking). So, if you want to use that you have to use a separate usb-serial adaptor. You don't need both swo and serial. Both can be used to print debug statements and the swo can do tons of other stuff - like monitoring variables "live". I made my own st-link which can do it all ( stm32world.com/wiki/DIY_STM32_Programmer_(ST-Link/V2-1) )
@J3derNurEinKreuz2 ай бұрын
That's a really nice trick, thanks for sharing. In a real world application I would disable interrupts before messaging with the stack. Saw the missing assignment to now right after you copied it and waited asking myself, when will be notice :-)
@stm32world2 ай бұрын
If you read the evaluation part of the wiki article (here: stm32world.com/wiki/STM32_Jump_to_System_Memory_Bootloader#Evaluation) yes - it could potentially go wrong and I guess disabling interrupts would improve that.
@stm32worldАй бұрын
And yeah - took me a while to notice the missing assignment - long enough that I had to pause the recording while I figured it out ;) Wait until you see the solution to the Crazy Mystery video I posted some days back.
@IsaacFraser-y4x2 ай бұрын
great vid, ta
@stm32world2 ай бұрын
Thanks, glad you liked it.
@niclash2 ай бұрын
Pretty awesome.
@stm32world2 ай бұрын
I expected to be shot down for messing with the bloody stack ;) But thanx.
@stm32world2 ай бұрын
Let's put it this way - normally the stack is better left to the compiler ;(
@stm32world2 ай бұрын
The next I2C video is still a work in progress. I got a bit bored with I2C so decided to squeeze in a few other videos. It will go up soon so have patience.
@LarsBgildThomsen2 ай бұрын
Got into this video planning a short video on the topic of bit-banding (as opposed to bit banging).
@LarsBgildThomsen2 ай бұрын
I can't wait to see if anyone have a suggestion to this one!
@PatrickHoodDaniel2 ай бұрын
Came here to say thanks for coming to the livestream. Just subscribed to your channel. I will be watching your videos.
@stm32world2 ай бұрын
That is very cool! I am at least 12-14 hours ahead of you timezone wise, so I had to leave the live stream before you were done - sorry about that.
@stm32world2 ай бұрын
I do have a few comments on your live stream but I'll post that on your channel. Any comments on my videos is greatly appreciated. I am still in an early learning phase when it comes to videos.
@xOWSLA2 ай бұрын
YOU ROCK! Thanks for the nieche content!
@stm32world2 ай бұрын
Thanx. I actually didn't think this particular video would be well received - might make more like this.
@wwadley2 ай бұрын
My vote is short and sweet: 10 minutes or less. Thank you for these videos. You are making the material very accessible.
@stm32world2 ай бұрын
Your comment is much appreciated ;) From the limited experience I got so far, 10 minutes or less is hard though. There's simply not enough time to explain. But I will try to make them as short as possible.
@car_dot1102 ай бұрын
What IDE are you using? is it Eclipse?
@stm32world2 ай бұрын
Check the first video in the series, which covers installation and setup as well as hardware needed. It's ST's STM32CubeIDE - which is Eclipse based. The entire series is described here: stm32world.com/wiki/STM32_Getting_Started_Tutorial_Video_Series_(by_STM32World)
@ngouanewhoumand19992 ай бұрын
Thanks you very much
@stm32world2 ай бұрын
You are most welcome. Will dig deeper in the following 2-3 videos although I might get bored and squeeze something else in.
@stm32world2 ай бұрын
As mentioned in this video I considered if this was too basic to be worth a video. However, reasoning that this IS supposed to be a "start from scratch" tutorial series, I decided to post it anyway. Let me know if you want more or less of this.