Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stm32f103xx: I2C has no internal pullups and af config #10395

Closed
MrKevinWeiss opened this issue Nov 15, 2018 · 3 comments · Fixed by #10607
Closed

stm32f103xx: I2C has no internal pullups and af config #10395

MrKevinWeiss opened this issue Nov 15, 2018 · 3 comments · Fixed by #10607
Assignees
Labels
Area: boards Area: Board ports Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: question The issue poses a question regarding usage of RIOT

Comments

@MrKevinWeiss
Copy link
Contributor

Description

When using the nucleo-f103rb the standard configuration is i2c0 on PB8 and PB9 the AFIO periph clock must be enabled
RCC->APB2ENR |= 0x00000001;
and the pin must be remapped to those pins
AFIO->MAPR |= AFIO_MAPR_I2C1_REMAP;
Also due to the hardware constraints it seems like the internal pullup cannot be enabled since the pins must be set to GPIO_AF_OUT_OD.

In the reference manual it seems like it is impossible to do so (in section 9.1.9 Alternate function configuration it states that 'The weak pull-up and pull-down resistors are disabled.')

I am not sure if anything can be done about requiring external pullups.

Steps to reproduce the issue

Try to use the i2c0 on any nucleo103xx on PB8 and PB9.

Expected results

It works.

Actual results

It doesn't work and will hang

@MrKevinWeiss MrKevinWeiss added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: question The issue poses a question regarding usage of RIOT Platform: ARM Platform: This PR/issue effects ARM-based platforms Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Area: boards Area: Board ports labels Nov 15, 2018
@MrKevinWeiss MrKevinWeiss self-assigned this Nov 15, 2018
@MrKevinWeiss
Copy link
Contributor Author

@aabadie, @haukepetersen, or @dylad, I would like your input on how to cleanly add an remap config and if you know any way to try to activate the pullup.

@maribu
Copy link
Member

maribu commented Nov 28, 2018

The same issue affects the blue pill (and clones). Using PB6 and PB7 instead is my proposed solution in that case, because than no remapping of the first I2C interface is required. Would that be an option for the Nucleo as well?

@MrKevinWeiss
Copy link
Contributor Author

MrKevinWeiss commented Nov 28, 2018

Ya but then you would have to use some morpho pins (I think) and not the nice labeled/standard sda and scl. I think it should eventually be fixed in the CPU as those pins should be usable.

When I find I can try to figure something out, I just didn't want it forgotten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Platform: ARM Platform: This PR/issue effects ARM-based platforms Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Type: question The issue poses a question regarding usage of RIOT
Projects
None yet
2 participants