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

[hal] i2c: bus is driven low if building with JTAG/SWD enabled. #2080

Merged
merged 3 commits into from
May 18, 2020

Conversation

XuGuohui
Copy link
Member

Problem

I2C bus is driven LOW after Wire.begin() when building with JTAG/SWD enabled on Electron.

Solution

Initialize I2C pins to be float input.

Example App

#include "Particle.h"

SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(SEMI_AUTOMATIC);

void setup() {
    Wire.begin();
}

void loop() {
}

Steps to test

  1. Build modular firmware with JTAG/SWD enabled:
    make PLATFORM=electron DEBUG_BUILD=y USE_SWD_JTAG=y

  2. Flash system firmware and the above application.

  3. Use logic analyser to monitor the SDA(D0) and SCL(D1) and see if both pins go to high level or not.


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

hal/src/stm32f2xx/core_hal_stm32f2xx.c Outdated Show resolved Hide resolved
hal/src/stm32f2xx/i2c_hal.c Outdated Show resolved Hide resolved
@XuGuohui XuGuohui force-pushed the fix/i2c_debug_build/ch30478 branch from 7cf18ec to 87ac2e0 Compare April 21, 2020 16:30
@XuGuohui XuGuohui requested a review from avtolstoy April 21, 2020 16:30
@avtolstoy avtolstoy added this to the 1.5.1 milestone Apr 22, 2020
hal/src/stm32f2xx/core_hal_stm32f2xx.c Outdated Show resolved Hide resolved
@XuGuohui XuGuohui requested a review from avtolstoy April 23, 2020 14:55
@avtolstoy avtolstoy modified the milestones: 1.5.1, 2.0.0 Apr 28, 2020
@avtolstoy avtolstoy added ready to merge PR has been reviewed and tested and removed needs review labels May 14, 2020
@XuGuohui XuGuohui force-pushed the fix/i2c_debug_build/ch30478 branch from 2bc04ca to 25bb78b Compare May 18, 2020 14:33
@XuGuohui XuGuohui merged commit f1d30dc into develop May 18, 2020
@XuGuohui XuGuohui deleted the fix/i2c_debug_build/ch30478 branch May 18, 2020 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ready to merge PR has been reviewed and tested
Projects
None yet
2 participants