Skip to main content
RShiv.1
Associate III
November 18, 2022
Solved

I2C not working with STM32F103C6 and STM32F103C8

we have been trying to get the I2C up on both the controller and no responses from anyone the cubeMx issue if I2C is really a problem..Kindly respond as we are trying to get I2C up ..

requesting the experience forum experts to respond.

Thanks

Ravi

This topic has been closed for replies.
AScha.3
AScha.3Best answer
Super User
November 25, 2022

from the ds you posted, i cannot say, what to do better.

now lets stop  to play blind cow . :)

so look, what drivers exist and learn/copy from them :

here sensirion gives driver for their sensor:

https://github.com/Sensirion/embedded-i2c-scd30

and many others...(also in c++, rust etc.)

https://github.com/paulvha/scd30

https://github.com/sparkfun/SparkFun_SCD30_Arduino_Library

https://github.com/RequestForCoffee/scd30

https://github.com/adafruit/Adafruit_SCD30

https://github.com/Seeed-Studio/Seeed_SCD30

https://github.com/watterott/CO2-Ampel

https://github.com/sinewave-ee/scd30-rs

the driver by sensirion should show you, what to do.

If you feel a post has answered your question, please click on " Best Answer ".

63 replies

RShiv.1
RShiv.1Author
Associate III
November 24, 2022

when I do I2C_Mem_write it passes..but not I2C_Master_Transmit??...anyways I am not getting the intended answer in the buffer...thanks

ONadr.1
Senior III
November 24, 2022

It's time to take the logic analyzer out of the drawer and look at the bus to see what's going on there.

AScha.3
Super User
November 24, 2022

yea, i said 3 days ago:

if still not working - its time, to look at the signal:

take DSO, 1 ch sck , 1 ch sda ; trigger on clk.

then show, what happens on I2C lines.

but he prefers to play blind cow . :)

If you feel a post has answered your question, please click on " Best Answer ".
RShiv.1
RShiv.1Author
Associate III
November 24, 2022

Hi,

sorry I had updated ...I2C is working fine...and I am also able to get the version of the sensor fine.

After which I am trying to read the status ready ..where I am not seeing the flag .

if I just enable version number all is fine..but when I try to get the get ready flag there seems to be problem...more to do with I2C_Mem_write and Mem_read...any suggestion with the way it is called kindly let me know.

Thanks

Ravi

RShiv.1
RShiv.1Author
Associate III
November 24, 2022

it looks more a pointer management issue I guess...I am able to get the version number of the sensor fine if I run only that..but when I enable get ready flag ...even the version number values changing..

let me know..

If I get this properly I will be able to read the perodic mesurement as well as the actual values from sensor...

AScha.3
Super User
November 24, 2022

try...

If you feel a post has answered your question, please click on " Best Answer ".
RShiv.1
RShiv.1Author
Associate III
November 24, 2022

Hi,

I tried with this which says

0693W00000WJQaaQAH.png 

only dddd

but after start periodic measurement need to check for data ready??

anyways will try that also..not getting the values....let me know the change

RShiv.1
RShiv.1Author
Associate III
November 24, 2022

0693W00000WJQdyQAH.pngGet ready status is not seen to check whether sensor is ready to send??..

tried adding that piece of code was well...

any change let me know

thanks and regards

Ravi

AScha.3
Super User
November 24, 2022

so no error, sensor and I2C working ok.

did you power cycle?

power off sensor and STM board, wait, then power up again. sensor need power restart...

If you feel a post has answered your question, please click on " Best Answer ".
RShiv.1
RShiv.1Author
Associate III
November 24, 2022

yes I2C is working ..

0693W00000WJQhqQAH.pngdid the power cycle....power off both sensor and STM board...still not getting any values...