Skip to main content
FHui.1
Associate
March 24, 2020
Solved

PB5 remap pin on STM32F103C8

  • March 24, 2020
  • 9 replies
  • 5987 views

The pin PB5 used by SPI1 in REMAP mode conflicts with the SMBAl pin of i2c1, how to configure it as the MOSI function of SPI1 on STM32F103C8?

PB5 seems to be used as SMBA by default when we use SPI1(remap mode) and i2c1 at the same time. Even if I configure i2c1 to standard i2c mode, PB5 is not released as MOSI. So, how to force PB5 into SPI1_MOSI on STM32F103C8?

​

0693W000000UZykQAG.jpg

This topic has been closed for replies.
Best answer by waclawek.jan

I don't use the 'F1, but you may be in a situation where you simply can't use a peripheral because of conflicts like these. This is the inherent limitaion of the (rather old) 'F1 family. Use a different STM32 family; you may be able to find a model with fairly similar pinout.

JW

9 replies

waclawek.jan
waclawek.janBest answer
Super User
March 24, 2020

I don't use the 'F1, but you may be in a situation where you simply can't use a peripheral because of conflicts like these. This is the inherent limitaion of the (rather old) 'F1 family. Use a different STM32 family; you may be able to find a model with fairly similar pinout.

JW

Amel NASRI
ST Technical Moderator
March 26, 2020

Hi @FHui.1​ ,

If you use the STM32CubeMX tool, you should be able to resolve such conflict and generate code that initializes SPI and I2C pins properly.

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
FHui.1
FHui.1Author
Associate
March 27, 2020

I'll try to use STM32CubeMX, thanks.

waclawek.jan
Super User
March 26, 2020

0693W000000UqD2QAK.png

JW

FHui.1
FHui.1Author
Associate
March 27, 2020

Thank you very much

waclawek.jan
Super User
March 27, 2020

Hi @Amel NASRI​ ,

My impression was, that in 'F1 all functions mapped to a pin are active at once, i.e. there's no prioritization between them, and the only way to use only one of them is to disable the modules all other functions belong to, in RCC.

IIRC, this is even used as a hack where USART Rx and timer channel on one pin are used at once to provide a timeout for the UART Rx, I believe there's an official ST appnote dealing with this.

So, I am a bit surprised this is mentioned as erratum at all. It's annoying indeed, especially since one would expect the SMBUS features to be off when SMBUS is not used in the I2C module, but IMO it's not that different from other pins with multiple functions. This is simply F1's inherent limitation.

Btw. note that there are several such combinations mentioned in the surrounding errata.

I don't use 'F1.

JW

Nesrine.JLASSI
Visitor II
March 30, 2020

Hello @FHui.1​ 

Thanks for the feedback, it will be fixed next CubeMX version.

We will come back to you if there is any update.

Best regards,

Nesrine

waclawek.jan
Super User
March 30, 2020

Thanks, Nesrine.

JW