R-Pi to STM f303k8

I’m trying to connect a GUI interface on a Raspberry pi 3 (Sliders and buttons) to control output and show input from an STM F303k8. I understand the protocol of I2c but don’t know how to find the address of the STM. Also, I don’t know the syntax for setting the STM as a slave and RPI as a master. If someone could help me with syntax and finding the address of my device it would be much appreciated.

It seems when I connect my STM to the RPI via SCL and SDA lines there is no initiation and the I2Cdetect command on the RPI doesn’t pick up on the STM connection.

Hi there,

for the I2c slave on the Mbed device you need to use I2CSlave API, and its method called address will set address defined by user.

For detecting I2C on the RPI side, I recommand to search on internet but it will be something like this.

This can help with start on the RPi side. And watch out for on pull-ups.

BR, Jan


I had a similar problem with my current project. I wanted to connect a PC/Raspberry Pi to a STM32F303RE. It is a robot application and I considered UART serial, I2C, SPI and CANbus.

In the end I decided on UART serial. It may be the oldest of the low speed busses, but it is near universal and I have been running it at 250000 bits per second from a laptop with no problems (also works fine at 460800). These speeds match standard I2C speeds.

Where possible, I like to run protocols based on ASCII strings which makes debugging much, much easier.

Maybe a UART bus would be a better option.