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

add ARDUINO_ARCH_STM32 to take benfit of Wire.begin(sda,scl) configuration #1076

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jmchiappa
Copy link

STM32 controllers have several I2C peripherals. So user could choose one of them by selcting the right SDA/SCL.

…eral I2C peripherals and user can choose one of them
@olikraus
Copy link
Owner

olikraus commented Dec 18, 2019

Did you test this?
STM32 does not support the "Wire.begin(sda,scl)" configuration:

https://github.com/stm32duino/Arduino_Core_STM32/blob/d2ebcd532164a2ed2f74f9337bd86fab766ea133/libraries/Wire/src/Wire.h#L87

void begin(bool generalCall = false);
void begin(uint8_t, bool generalCall = false);

This means: Your patch can not work and will probably break the STM32 support.

@jmchiappa
Copy link
Author

Did you test this?
STM32 does not support the "Wire.begin(sda,scl)" configuration:

https://github.com/stm32duino/Arduino_Core_STM32/blob/d2ebcd532164a2ed2f74f9337bd86fab766ea133/libraries/Wire/src/Wire.h#L87

void begin(bool generalCall = false);
void begin(uint8_t, bool generalCall = false);

This means: Your patch can not work and will probably break the STM32 support.

@olikraus ,
Yes, I did. I've tested this patch on my own stm32duino fork. A PR that adds a new "begin" method has been approved recently stm32duino/Arduino_Core_STM32#838 and will be available soon in the 1.8.0.

@olikraus
Copy link
Owner

Maybe there should be an additional check for the lib version. Is this possible?

@jmchiappa
Copy link
Author

@olikraus ,
STM32duino 1.8.0 has been released with the new begin method stm32duino/Arduino_Core_STM32#838.
As you requested, I've successfully tested this PR with Stm32duino 1.8.0 on :

  • Nucleo L476RG (I2C on pin D44 (SCL) and D43 (SDA)
  • Nucleo F411RE (I2C on pin D6 (SCL) and D3 (SDA)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants