FreeRTOS Tutorial 7 || MUTEX || STM32 || CubeIDE

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 เม.ย. 2020
  • Purchase the Products shown in this video from :: controllerstech.store
    ________________________________________________________________________________________
    How to use MUTEX in STM32.
    This is Part 1 of the video, and it covers the basic usage.
    Part 2 will cover priority inversion and priority inheritance, and will be live very soon.
    FREERTOS Playlist • FreeRTOS TUTORIALS
    To download the code, goto
    controllerstech.com/freertos-...
    ________________________________________________________________________________________
    ****** SUPPORT US BY DONATING*****
    paypal.me/controllertech
    ******Join the Membership******
    / @controllerstech
    Join the Discord Server / discord
    Join the Telegram Group t.me/controllerstechdiscuss
    Follow me on Instagram / controllerstech
    For more info, visit www.controllerstech.com
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 16

  • @ricardocano7118
    @ricardocano7118 ปีที่แล้ว +1

    Excellent work and explanation!!! I will continue with your videos

  • @user-zt4om6rv6h
    @user-zt4om6rv6h หลายเดือนก่อน

    Hii, Series going excellent. 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 didn't understood how do I run this 3 tasks, which schedular components do I use. Please Help.

  • @chianlee
    @chianlee 2 หลายเดือนก่อน

    Hi admin, your video found me. Thank you very much.
    When I try to execute with 3 Task HPT (High), MPT (Medium), LPT (Low). It worked repeatably HPT,MPT,HPT,LPT,... so on.
    Why could It be ? Logically, MPT has higher priority than LPT so I think LPT can not never take Mutex, as HPT immediately take Mutex once MPT releases. Below is my terminal monitor.
    Starting...
    Mutex is created !
    HPT_Task is running... HPT_Task is taking Mutex...
    MPT_Task is running... MPT_Task is taking Mutex...
    HPT_Task is running... HPT_Task is taking Mutex...
    LPT_Task is running... LPT_Task is taking Mutex...
    HPT_Task is running... HPT_Task is taking Mutex...
    MPT_Task is running... MPT_Task is taking Mutex...
    Thank you for your time.

  • @shawntaylor9509
    @shawntaylor9509 3 ปีที่แล้ว +2

    I have more than one function using the same USART Peripheral (USART6) - can I use the Mutex within all functions?

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว +2

      Yeah you can. But remember that out of the waiting tasks, the one have higher priority will take the mutex first

  • @MrHause13
    @MrHause13 4 ปีที่แล้ว

    Do I understand it correctly? HPT can't send message until Mutex is held by MPT?
    And one more question. In the first step of running code when HPT wait 2s in Send function why MPT is not trying to get mutex? MPT executes when HPT is ended. When in the second step when MPT hold mutex HPT is about taking that mutex. That's strange for me.

    • @ControllersTech
      @ControllersTech  4 ปีที่แล้ว +3

      1. Yes HPT can't send until it gets the mutex, which is held be MPT.
      2. MPT is not trying because it's priority is less than HPT. It cannot preempt HPT. But this is not the case when MPT is running. HPT can and did preempt MPT. But couldn't get the mutex.
      This is the entire purpose of mutex and semaphore. Even tasks with low priority can block high priority tasks, from accessing any resource simultaneously.

    • @MrHause13
      @MrHause13 4 ปีที่แล้ว

      And this is a perfect conclusion. Thanks !

    • @MetaVerseMan1
      @MetaVerseMan1 3 ปีที่แล้ว

      @@ControllersTech But HPT did get the mutex after MPT used it and even before it left the mutex, HPT acquired it, printed and then left it. Later MPT came out. How is that, can you please let me know.

    • @ControllersTech
      @ControllersTech  3 ปีที่แล้ว

      Can u point out the time in the video

    • @MetaVerseMan1
      @MetaVerseMan1 3 ปีที่แล้ว

      @@ControllersTech time at 9:20
      HPT preempt MPT and acquired mutex, later after HPT exited, MPT exited later. How is that, where MPT has acquired the mutex .

  • @hasanatl4823
    @hasanatl4823 4 ปีที่แล้ว +2

    I don't understand you. Why didn't you use cubmx to create function? cubeMx can create mutex and semaphore , Doesn't we better easy using them?

    • @ControllersTech
      @ControllersTech  4 ปีที่แล้ว +5

      The objective is to use the pure RTOS functions to do things. It will be helpfull as you can use the same functions in a non arm based controllers too.
      And if u understand these functions, then cmsis is a piece of cake.

    • @hasanatl4823
      @hasanatl4823 4 ปีที่แล้ว

      @@ControllersTech thanks for the answer