2024-09-26 11:35 PM - last edited on 2024-09-27 12:09 AM by Andrew Neil
Hi everyone, My name is Emmanuel Katto. I am having trouble initializing the I2C interface on the STM32F4 series. Could someone provide a simple example or point me to resources that detail the setup process?
Looking forward to your responses.
Thanks in advance!
Best,
Emmanuel Katto
2024-09-27 12:21 AM
Welcome to the forum.
You posted this under STM8 - I've moved it to STM32 for you.
The best way to get started would be with an STM32F4 Nucleo board
https://www.st.com/en/evaluation-tools/stm32-nucleo-boards.html
If you're using STM32CubeIDE, start a project for one of the Nucleo boards; there are examples which illustrate most of the STM32's features - including I2C.
https://www.st.com/en/development-tools/stm32cubeide.html
https://www.youtube.com/playlist?list=PLnMKNibPkDnGtuIl5v0CvC81Am7SKpj02
The HAL documentation is here:
2024-09-27 12:45 AM
Good video here on getting started with an STM32 Nucleo board:
https://www.youtube.com/watch?v=hyZS2p1tW-g
2024-09-27 06:45 AM
STM32CubeMX will provide the initialization code for you.
You can see an example usage of I2C here:
Note that I2C requires external pullups of around 2.2kOhm on the SDA and SCL lines.