Skip to main content
KLEE.2
Associate
February 24, 2023
Solved

Can STM32F301 use 3 I2C simultaneously?

  • February 24, 2023
  • 2 replies
  • 2213 views

hello.

I've never used STM32 before.

I'm trying to use it this time. It requires several pins of GPIO and 3 channels of I2C.

I searched and the STM32F301 seemed suitable, so I designed a circuit using it.

I tried setting the PIN using a setting tool called CUBEMX, but there seems to be something wrong.

If I set up I2C3 of STM32F301 using cubemx, exclamation marks appear on all I2C channels.

can i know what is the problem?

0693W00000aHYvdQAG.png0693W00000aHYvTQAW.png

This topic has been closed for replies.
Best answer by christop

You can ignore the exclamation marks on I2C1 and I2C2 as long as you are using all 3 I2Cs in I2C mode.

The exclamation marks are just a warning to inform you that due to potential conflicts with some other peripherals, the peripherals showing the exclamation marks might have some limitations in their usage.

For instance, with the 3 I2Cs selected, once you select I2C3 in I2C mode, it prevents using I2C1 and/or I2C2 in SMBus-Alert mode. You can see that by scrolling down the list of mode selection for I2C1/2, you will see the SMBus-Alert-mode is in purple color meaning it cannot be used unless you resolve the conflict.

2 replies

S.Ma
Principal
February 24, 2023

If the chip has in its block diagram 3 I2C HW IP cell, you can have 3 I2C bus run concurrently, as long as the proper SW is developped. Same for SPI or USART.

IMHO, one solution I would think of is to create a printer-like spooler for each one of them, queuing the I2C bus requested messages and callbacks. This could be implemented as an interrupt-based state machine. This is not provided as default much simpler provided examples.

KLEE.2
KLEE.2Author
Associate
February 24, 2023

Thank you for the reply.

The diagram for the STM32F301 shows 3 I2C's.

Before the PCB artwork, I only looked at the datasheet and wondered if I had properly assigned the functions to the pins, so I only set the pins in advance.

However, a 'conflict' message occurred.

If this message occurs, can I not use 3 I2C at the same time?

The signal specified as IPMI should operate as a slave, so an interrupt method will be used, but the rest will be used as polling as needed.

christop
christopBest answer
ST Employee
February 24, 2023

You can ignore the exclamation marks on I2C1 and I2C2 as long as you are using all 3 I2Cs in I2C mode.

The exclamation marks are just a warning to inform you that due to potential conflicts with some other peripherals, the peripherals showing the exclamation marks might have some limitations in their usage.

For instance, with the 3 I2Cs selected, once you select I2C3 in I2C mode, it prevents using I2C1 and/or I2C2 in SMBus-Alert mode. You can see that by scrolling down the list of mode selection for I2C1/2, you will see the SMBus-Alert-mode is in purple color meaning it cannot be used unless you resolve the conflict.

KLEE.2
KLEE.2Author
Associate
February 24, 2023

thank you It helped a lot. :)