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

ESP32 I2C repeat start error #9617

Open
1 task done
benas1989 opened this issue May 12, 2024 · 0 comments
Open
1 task done

ESP32 I2C repeat start error #9617

benas1989 opened this issue May 12, 2024 · 0 comments
Labels
Status: Awaiting triage Issue is waiting for triage

Comments

@benas1989
Copy link

Board

ESP32_DevKitc_V4

Device Description

CY8CMBR3110

Hardware Configuration

CY8CMBR3110

Version

latest master (checkout manually)

IDE Name

PlatformIO

Operating System

MacOS 14.2.1

Flash frequency

default PlatformIO

PSRAM enabled

no

Upload speed

default PlatformIO

Description

Hello,
I'm trying to write library for CY8CMBR3110 ic. Try to read register but get eror.
This chip send nack when checking inputs or sleeping etc. So I have to use repeat start.
I check same program on arduino nano. Everything works.

ESP32 serial output

[ 16048][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop returned Error -1
Data received: 20
[ 18049][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop returned Error -1
Data received: 20
[ 20050][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop returned Error -1
Data received: 20
[ 22051][E][Wire.cpp:499] requestFrom(): i2cWriteReadNonStop returned Error -1

Arduino nano serial output:

Data received: 0
Error: 2
Error: 2
Data received: 0

Sketch

#include <Arduino.h>
#include "Wire.h"

void setup() 
{
  Serial.begin(9600);
  Serial.println("Inializing...");
  Wire.begin();
}

void loop() 
{
  Wire.beginTransmission(0x37);
  Wire.write(0xAA);
  int result = Wire.endTransmission(false);
  if (result == 0)
  {
    Wire.requestFrom(0x37,1);
    int data;
    while (Wire.available())
    {
      data = Wire.read();
    }
    Serial.print("Data received: ");
    Serial.println(data);
    delay(1000); 
  }
  else
  {
    Serial.print("Error: ");
    Serial.println(result);
  }
  delay(50);
}

Debug Message

.

Other Steps to Reproduce

Arduino nano - everything works no errors.

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@benas1989 benas1989 added the Status: Awaiting triage Issue is waiting for triage label May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting triage Issue is waiting for triage
Projects
None yet
Development

No branches or pull requests

1 participant