Skip to main content
Graduate II
June 11, 2025
Question

I2C in CMSIS RTOS v1 with Stm32F0 in Stm32CubeIDE

  • June 11, 2025
  • 3 replies
  • 545 views

Hi 

I need a guidance to use I2C communication protocol with stm32f103c8t6 using  CMSIS RTOS v1. Can any one suggest any tutorial or article which can help me out to understand and implement it for my project.

    This topic has been closed for replies.

    3 replies

    Super User
    June 11, 2025
    Technical Moderator
    June 11, 2025

    As said by @Andrew Neil , it's more or less the same question as this post but that one is generic.

    I don't think there is a tutorial for that specific use case stm32f103c8t6+CMSIS RTOS v1+I2C.

    Start a simple project and proceed step by step:

    1- Create a very simple project using stm32f103c8t6+CMSIS RTOS v1 and create a task where you toggle a LED.

    2- If all is OK, try communicating with the sensor outside the task I mean before calling the task create.

    3- If all is OK, read the sensor inside the task.

     

     

    Super User
    June 11, 2025

    HAL communication and using RTOS are independent concepts. In simple cases, the combination will simply work as without RTOS.

    But, if you use the HAL API from within a task, the RTOS scheduler will influence the timing. If this is not permissible, you may increase the task's priority, switch to interrupt or DMA based communication, or protect your critical code with a critical section etc.. 

    The "Mastering the FreeRTOS™ Real Time Kernel" tutorial explains some useful general concepts: 161204_Mastering_the_FreeRTOS_Real_Time_Kernel-A_Hands-On_Tutorial_Guide.pdf

    hth

    KnarfB