cancel
Showing results for 
Search instead for 
Did you mean: 

PB5 remap pin on STM32F103C8

FHui.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

9 REPLIES 9

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 Employee

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 Accept as Solution on the reply which solved your issue or answered your question.

0693W000000UqD2QAK.png

JW

Thank you very much

I'll try to use STM32CubeMX, thanks.

Ok @Community member​ , I'll raise it as a request to our STM32CubeMX team because it allows enabling I2C clock at the same time while SPI is remapped.

Thanks.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

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

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

Thanks, Nesrine.

JW