Getting Started With STM32 and Nucleo Part 3: FreeRTOS - How To Run Multiple Threads w/ CMSIS-RTOS

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

Комментарии • 75

  • @samchan5251
    @samchan5251 5 лет назад +56

    The best RTOS video so far. Detail enough to get you started, but not too much to scare you off, or put you to sleep.

  • @NFSHeld
    @NFSHeld 3 года назад +13

    Please make the video series on queues, mutexes and semaphores. I'm trying to learn microcontroller programming, and your videos are the best tutorials I could find.

    • @Apocobat
      @Apocobat Год назад +3

      there is a full series on freertos with the esp32, which may vary in syntax but conceptually is mostly the same by this guy as well. Not only does the series cover theory directly, it provides code examples and uses the arduino ide so it is very easy to dig into the examples

    • @karm00n29
      @karm00n29 10 месяцев назад

      You must be proffesional microcontroler programmer now

  • @keyvanshahin1740
    @keyvanshahin1740 4 года назад +6

    Thank you so much for all the great tutorials. I can not remember another learning video that I had to watch each section over and over. you cover everything important in such a short time. Keep up the great work.

    • @keyvanshahin1740
      @keyvanshahin1740 4 года назад

      I also had a question to ask. in the last part of the test you used osDelay for making the delays. out of curiosity I just swapped it with HAL_Delay. What happened is the LED now flashes uniformly. I assume it has something to do with the change from SysTick to Timer 6 that causes this behavior but I can not completely analyze what happens. can you give me a clue?

    • @noweare1
      @noweare1 4 года назад +2

      @@keyvanshahin1740 From what I read in the Docs if osDelay is used as soon as it runs that statement the thread is put in a blocked state and other threads get the cpu. When the time elapses the thread gets put in the ready state. So if you have a bunch of higher priority threads running it could delay the toggle of the led.

  • @noweare1
    @noweare1 4 года назад +5

    I have been trying to use a RTOS and the biggest hurdle I have found is getting them set up correctly. I have tried ChibiOS and freeRTOS and could not set them up correctly. I do have STMCubeIDE and now because of this video I can get a project that compiles. This RTOS stuff could be a good video series. You explain things very well. Thanks

  • @kaylee-xie
    @kaylee-xie 2 года назад +2

    Best RTOS videos! start from easy and demonstrate details while programming so that I can completely understand what happends.

  • @zetaconvex1987
    @zetaconvex1987 3 года назад +1

    Thank you. Very nicely explained.
    I was interested in exploring RTOSs, and I didn't realise that the Cube was already set up to go.

  • @colanuss4985
    @colanuss4985 4 года назад +1

    I really like the topic, also the style and flow of presentation are perfect. Kudos for the preparation work.

  • @ordnanceant
    @ordnanceant 4 года назад +5

    Very good STM32 series good content presented clearly, please do a follow-up to this with more on the FreeRTOS. Also can you please put all the STM32 series into a playlist 😬

  • @adaminsanoff
    @adaminsanoff 4 года назад +1

    Great tutorials. Thank you Shawn and DigiKey!

  • @Hamidfazilati
    @Hamidfazilati 3 года назад

    You speaking so good and also I found answer of my question about multi tasking by STM32 .. also special thanks to ST Micro electronic

  • @m1geo
    @m1geo Год назад

    Nicely sized video! Informative enough to get going, but not too scary.
    I'd be interested in details about synchronising and sharing data between threads.

  • @Cevasho
    @Cevasho 4 года назад

    Amazing video, thank you very much. I was able to understand everything and now ill be working with threads because in some applications I'llbe running they are the proper solution.

  • @PaymaanJafari
    @PaymaanJafari 5 лет назад +5

    25+ yeays in this industry, I‌still really had fun hearing you saying "or you risk injuring humans" :))) sounds like a robot teaching other robots :)

    • @shawnhymel7647
      @shawnhymel7647 5 лет назад +2

      First law of robotics ;P

    • @PaymaanJafari
      @PaymaanJafari 5 лет назад

      @@shawnhymel7647 Still no one could say it that way :))

  • @deepanprasath9732
    @deepanprasath9732 3 года назад

    great video for rtos beginners

  • @antoniodejesusarenasperez6901
    @antoniodejesusarenasperez6901 3 года назад +1

    Excellent tutorial!! thanks a lot

  • @Electronics-c3j
    @Electronics-c3j 7 месяцев назад +2

    Hii I ma from Pune, I have to build A RTOS System For AC using FREERTOS and stm32f401re. I have 4 tasks 1)temperature sensing(continuously) 2) Indore Fan Run 4) compressor fan run 4) change temperature using pushbutton, I know about pushbutton but I didnt understood how do I run this 3 tasks, which schedular components do I use. Please Help.

  • @victorgomez335
    @victorgomez335 4 года назад +1

    Very good video helped me a lot.

  • @dd0356
    @dd0356 3 года назад

    Thanks for this video. It shows some path across the jungle that is stm32cubeide

  • @radhey04ec
    @radhey04ec 4 года назад +2

    please make video on DC motor control and BLDC with STM32

  • @werveson
    @werveson 4 года назад

    Excellent video!

  • @travisfort4700
    @travisfort4700 4 года назад

    Congrats! It's a nice class!

  • @KanagachidambaresanGR
    @KanagachidambaresanGR 2 года назад +1

    Superb got it on my NUCLEO F334R8

  • @Steven_Bennett_YT
    @Steven_Bennett_YT 7 месяцев назад

    I notice that there are many more Task priority levels available in your example than I see with my CubeMX project, which is 7 levels; does it vary with MCU type, or CubeMX version or is there another explanation. Thanks for helpful video.

  • @OzTalksHW
    @OzTalksHW 4 года назад +9

    So good. How do you know the maximum number of threads your STM32 chip comfortable supports?

    • @mneedes2
      @mneedes2 4 года назад +1

      That question doesn't make sense.

    • @shayasshayas4824
      @shayasshayas4824 3 года назад +1

      @@mneedes2 cn
      B
      Mddv2ffnf g and
      Wshmwcncwe2xyur

    • @mneedes2
      @mneedes2 3 года назад +1

      @@Tarkahn2024 Let's hear your answer and then you can tell me why it doesn't really make sense.

    • @RafaelKarosuo
      @RafaelKarosuo 3 года назад +7

      That's an interesting question, I think that it depends on several factors, since each thread could run a different task, maybe one requires 80% of the RAM, maybe some of the threads require a heavy DSP computing part, so it will depend on the target problem and the design you choose to make. Then you start counting response time and memory, and when the controller can't meet your requirements, it means you passed the number of threads for your specific design. So, I may run 1000 threads blinking LEDs, but maybe 5 threads if I'm doing some DSP or using a lot of memory.

    • @polkijain97
      @polkijain97 3 года назад +4

      Threads and context switching commands are pieces of code. All codes occupy memory resources. So the number of threads should depend on the memory resources available. Just check the size of your thread code (in both flash and RAM) and sum them up. If it comes close to the max RAM and Flash (as applicable) you get the max number of threads you can program.

  • @1over137
    @1over137 2 года назад

    I tried to get a BluePill to work with blinky. It failed. I spent 2 hours tracking it down to the interupt vector table not being relocatable in memory, which is apparently meant to be switch on for that MCU type, but was commented out. I learnt a lot along the way though.

  • @UpcycleElectronics
    @UpcycleElectronics 5 лет назад +5

    I don't know if I can use a HAL system without an option to open the pod bay doors.

  • @sidharthap
    @sidharthap 5 лет назад +4

    Heyyyyyy....... why does this seem like déjà vu?!!!

  • @DownhillAllTheWay
    @DownhillAllTheWay 4 года назад +1

    Have you done a video on interrupts using HAL? I can't find one by you, and I'm not getting on too well with interrupt videos by others.

  • @whiteking80
    @whiteking80 Год назад

    I found stm32 + middleware freertos can never be simulated in PROTEUS software the GPIO cannot be set or reset inside the task function. Did I miss something on the setting? Do you have any idea about this issue?

  • @RSolimov
    @RSolimov 3 года назад

    Amazing, videos, so i jumped over to digikey for my products. good price too :)

  • @優さん-n7m
    @優さん-n7m Год назад

    So we created RTOS with 1ms interval to check for what job to run and then we added a large ms delay value into each job as well. This is confusing. When will you create a video that shows how to do the mutex, semaphore stuff?

  • @rajdeepdas86
    @rajdeepdas86 8 месяцев назад

    Thanks so much ❤

  • @purposeoflife47
    @purposeoflife47 3 года назад

    Great man , Thanks

  • @hn13567
    @hn13567 3 года назад

    I was getting the following error after following through:
    _user_heap_stack' will not fit in regionRAM’
    > region `RAM’ overflowed by x bytes.
    I managed to fix this by changing my linker settings for min heap and stack size from 0x200 and 0x400 respectively to 0x100 and 0x100.
    I am new to embedded so i don't quite understand how that fixed it and why it didn't work in the first place?
    I've got Nucleo - stm32f030 with 8KB of SRAM and 64 KB of flash.

  • @bendover-yn2er
    @bendover-yn2er 4 года назад

    Hello, I tried your code on STM32F407VGTx dev board. First of all, when I compile the project it throws errors like "first denied here". So I remove that part and build again but LED never blinks. What happened? Thanks in advance.

  • @coolwinder
    @coolwinder 4 года назад

    Jump to 4:48!

  • @mustafaissa98
    @mustafaissa98 2 года назад

    What if I dont have TIM6 or TIM7? (I use nucleo but with a diffrent model)

  • @adaminsanoff
    @adaminsanoff 3 года назад +1

    How can we run standard main loop parallel to RTOS tasks?

    • @NFSHeld
      @NFSHeld 3 года назад +1

      You don't.
      Simply speaking, your RTOS code IS the infinite loop, where each iteration it first determines which task to run next and then runs that task. Remember, you only have one core, so you need to have some kind of mechanism to ensure that the different bits of code are run "in parallel". That is your RTOS. So there should be no code running "outside of RTOS" once RTOS is started.
      If you want another loop to run "in parallel", you copy the code from the standard main loop into yet another task function that runs concurrently but managed by RTOS. Just make sure to 1) assign the correct priority, 2) put some code to return control to RTOS (like osDelay) at the end of the loop, and in general use the RTOS-compatible timing functions such as osDelay instead of HAL_Delay.

  • @ShanshanJiang2008
    @ShanshanJiang2008 4 года назад +1

    Can we use ThreadX instead of the integrated FreeRTOS?

    • @優さん-n7m
      @優さん-n7m Год назад

      I can't find much resource to use of ThreadX on microcontrollers? Should I kill myself?

  • @olegtschaikowsky8030
    @olegtschaikowsky8030 2 года назад

    Hi Dude, very good tutorial, but if you see accurately this video, you will find out that some actions from you are very, very quick and as observer you can not really realize which menu point you have choosen now.. But thanks a lot and a like for your very good job!

  • @ahmadsadiq40
    @ahmadsadiq40 2 года назад

    Hello sir . I got many errros in vs code when i build the code. Freertos erros many time. Can you please help me to solve it?

  • @abolfazlrajabi7479
    @abolfazlrajabi7479 3 года назад

    very good.

  • @momq1434
    @momq1434 5 лет назад +1

    Hi, Can you please enable the community contribution for subtitles submission.

  • @brendanhayes-oberst1398
    @brendanhayes-oberst1398 2 года назад

    thank you

  • @rafalzasada8826
    @rafalzasada8826 5 лет назад +1

    If I am learning STM32 to get a job as embedded software engineer should I concentrate only on CMSIS? Is CubeMX considered professional tool or is it just for hobbyists?

    • @ShawnHymel
      @ShawnHymel 5 лет назад +7

      CMSIS, STM32 HAL, and CubeMX are all professional tools or libraries. Learning them will help, but an employer might be using something else (say, NXP's toolchain). Knowing how to use CMSIS will help you work across many different ARM platforms, but is sometimes more difficult to get working, as it's lower level. The important thing is to understand the concepts involved: installing a toolchain, manipulating registers, interrupts, counters, etc. If you have a good grasp of those, you can learn any framework you need.

    • @ntd252
      @ntd252 5 лет назад +6

      @@ShawnHymel Can you make a more detailed series about microcontroller and embedded systems with, for example STM32. I love your teaching style with clear explanation and well-prepared examples/projects.

    • @ShawnHymel
      @ShawnHymel 5 лет назад +2

      @@ntd252 I don't have plans for it right now, but good to know there's interest! If you're not familiar with some of the basic concepts, like registers, timers, and interrupts, I highly recommend starting with a simpler microcontroller, such as a PIC or AVR first.

    • @radhey04ec
      @radhey04ec 4 года назад +1

      @@ShawnHymel
      Please make video on DC motor control / BLDC control using STM32.

    • @adaminsanoff
      @adaminsanoff 3 года назад

      If you do not know it, you better start with Arduino.

  • @chenxu6557
    @chenxu6557 Год назад

    i dont quite get how the led blink with this two 500 and 600ms
    video not very clear to me

    • @chenxu6557
      @chenxu6557 Год назад

      it is better to share the code so that we can check parallelly. if i have the code, could i copy it direcly to the cubemx to replace the auto-generated main.c?

  • @horvathbenedek3596
    @horvathbenedek3596 Год назад

    7:20 Sigh... missed opportunity to name the task blink 182

  • @fenderrexfender
    @fenderrexfender 4 года назад

    this is not a rtos semaphores but its a semaphore.
    RunUntillSyncAt(S)
    {
    while (S

  • @furkanayas3339
    @furkanayas3339 Год назад

    Really? I am MSc embedded systems engineer, all of your sentences %100 effective, focused and effective but, Baremetal can run multiple operations, yes i know the job means the os task but most companies emulate a rtos with baremetal. It's commonly used in IoE leaves and standard White goods.

  • @CynthiaGonzalez-r8d
    @CynthiaGonzalez-r8d 2 месяца назад

    60641 Devonte Court