Skip to content

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

Open
jmchiappa wants to merge 1 commit intoolikraus:masterfrom
jmchiappa:master
Open

add ARDUINO_ARCH_STM32 to take benfit of Wire.begin(sda,scl) configuration#1076
jmchiappa wants to merge 1 commit intoolikraus:masterfrom
jmchiappa:master

Conversation

@jmchiappa
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Owner

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

@jmchiappa
Copy link
Copy Markdown
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