cancel
Showing results for 
Search instead for 
Did you mean: 

I2C in CMSIS RTOS v1 with Stm32F0 in Stm32CubeIDE

Piyoosh
Associate III

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.

3 REPLIES 3
Andrew Neil
Super User

Is this basically the same question as here:

https://community.st.com/t5/stm32-mcus-embedded-software/stm32f103c8t6-icm20948-imu-not-detected-when-using-freertos-with/td-p/811570 ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
mƎALLEm
ST Employee

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.

 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
KnarfB
Super User

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