Skip to main content
Associate II
October 25, 2024
Solved

Unable to select PB6 for I2C1_SCL on STM32F103C8

  • October 25, 2024
  • 3 replies
  • 1701 views

Hi,

Trying to use I2C1 with REMAP=0 and as long as understand the SCL and SDA pins are PB6 and PB6. Along with I2C I am using some other peripherals as well. I am unable to select PB6 for I2C SCL PIN. Please see attached screenshot. Not sure why it wont let me select that default PIN. I am quite sure I am not using any other MASKED function for this PIN.

technofection_0-1729854964045.png

 

    Best answer by STTwo-32

    Hello @technofection 

    As said @Tesla DeLorean , there is an errata about that. The errata 2.3.7 of the ES096 Rev15 says that:

    When the following conditions are met:
    • I2C1 and SPI1 are clocked.
    • SPI1 is remapped.
    • I/O port pin PB5 is configured as an alternate function output
    there is a conflict between the SPI1 MOSI and the I2C1 SMBA signals (even if SMBA is not used).

    And the workaround is:

    Do not use SPI1 remapped in master mode and I2C1 together.
    When using SPI1 remapped, the I2C1 clock must be disabled.

    So, if you are remapping the SPI1, the I2C1 should not be used as said on the errata. 

    I've escalated this to our MX Team so they can ensure the correction (under internal ticket number 195083).

    PS: Issue solved on the last release of the STM32CubeMX

    Best Regards.

    STTwo-32

    3 replies

    RobK1
    Associate II
    October 25, 2024

    If you select 'I2C under "Mode", the pins will automatically be selected.

     

     

    RobK1_1-1729856252731.png

     

    Associate II
    October 25, 2024

    Hi Rob,

    I do expect the same behaviour, but as soon as I enable I2C1, the REMAPPED pins are selected automatically. Please see the screenshot...

    technofection_0-1729857052027.png

    STTwo-32
    Technical Moderator
    October 25, 2024

    Hello @technofection and welcome to the ST Community.

    Please add your .IOC file here so I can check. It works fine on my side.

    Best Regards.

    STTwo-32

    Associate II
    October 25, 2024

    Hi @STTwo-32 Here is the ioc file ...

    STTwo-32
    STTwo-32Best answer
    Technical Moderator
    October 25, 2024

    Hello @technofection 

    As said @Tesla DeLorean , there is an errata about that. The errata 2.3.7 of the ES096 Rev15 says that:

    When the following conditions are met:
    • I2C1 and SPI1 are clocked.
    • SPI1 is remapped.
    • I/O port pin PB5 is configured as an alternate function output
    there is a conflict between the SPI1 MOSI and the I2C1 SMBA signals (even if SMBA is not used).

    And the workaround is:

    Do not use SPI1 remapped in master mode and I2C1 together.
    When using SPI1 remapped, the I2C1 clock must be disabled.

    So, if you are remapping the SPI1, the I2C1 should not be used as said on the errata. 

    I've escalated this to our MX Team so they can ensure the correction (under internal ticket number 195083).

    PS: Issue solved on the last release of the STM32CubeMX

    Best Regards.

    STTwo-32

    Associate II
    October 25, 2024

    Thanks for pointing to that.. That makes sense.  So basically, CubeIDE must disable I2C1 and I2C2 completely if SPI1 is remapped, as PB5 is common (SMBA Pin). Is that correct?