Repository navigation
edge: fix psoc-edge I2C clock and expose Wire on the header - #38
Merged
Merged
Conversation
AkshayChandra-IFX
force-pushed
the
edge-fix-i2c-clock-div
branch
from
October 29, 2026 06:39
9eb01a3 to
2220b12
Compare
AkshayChandra-IFX
marked this pull request as ready for review
October 29, 2026 08:23
AkshayChandra-IFX
marked this pull request as draft
October 29, 2026 08:24
AkshayChandra-IFX
force-pushed
the
edge-fix-i2c-clock-div
branch
from
October 29, 2026 08:25
2220b12 to
64c4985
Compare
AkshayChandra-IFX
marked this pull request as ready for review
October 29, 2026 09:14
|
Looks good :) |
djaumann
approved these changes
Oct 29, 2026
jaenrig-ifx
force-pushed
the
edge-main
branch
from
October 30, 2026 03:04
4f89386 to
2da7133
Compare
Both I2C clock dividers (peri0_group1_16bit_1 for Wire, peri0_group1_16bit_3 for Wire1) were set to clock-div = <1>, feeding the SCB with 100 MHz and driving SCL at ~6.25 MHz instead of 100 kHz, which broke I2C communication (test_wire_connected1_pingpong). The PSoC Edge I2C driver does not derive the SCB clock from clock-frequency; it uses the devicetree divider with fixed 16x oversampling. Set clock-div = <63>: 100 MHz / 63 = ~1.59 MHz SCB clock (within the PDL 1.55-3.2 MHz range for a 100 kHz master), ~99 kHz SCL. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
SCB0 (P8_0/P8_1) is the internal sensor bus and not on a header, so Wire could not be tested. Map Wire to SCB11 on P17_2/P17_3; mark test_wire_connected1_pingpong as passing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: AkshayChandra-IFX <akshaychandra.nagzarkar@infineon.com>
AkshayChandra-IFX
force-pushed
the
edge-fix-i2c-clock-div
branch
from
October 30, 2026 04:13
64c4985 to
7f7d6ea
Compare
IFX-Anusha
reviewed
Oct 30, 2026
|
|
||
| clocks = <&peri0_group1_16bit_1>; | ||
|
|
||
| pinctrl-0 = <&p17_2_scb11_i2c_scl &p17_3_scb11_i2c_sda>; |
Collaborator
There was a problem hiding this comment.
Here you have updated but still variant.h points to the #define SDA 43 /< P8_1 */
#define SCL 42 /< P8_0 */. So that should be changed right?
Author
There was a problem hiding this comment.
yes. thanks to point out. This is missed, i will update it!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Both I2C clock dividers were set to
clock-div = <1>, which ran SCL at ~6.25 MHz instead of 100 kHz. The PSoC Edge I2C driver uses this divider directly and ignoresclock-frequency. This PR setsclock-div = <63>for Wire and Wire1, giving ~99 kHz SCL.Wirewas on SCB0 (P8_0/P8_1), the internal sensor bus, which isn't on any header. This PR moves it to SCB11 on P17_2/P17_3, next to Wire1, so the loopback test can be wired.A couple of things to keep in mind:
Wireno longer talks to the on-board IMU, pressure and humidity sensors.Wireon its own needs external pull-ups.Related Issue
None.
Context
Wiring: P17_2 ↔ P17_0 (SCL), P17_3 ↔ P17_1 (SDA)