Skip to content

Chunks not working on ESP32 #64

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

Closed
caternuson opened this issue Sep 24, 2021 · 10 comments
Closed

Chunks not working on ESP32 #64

caternuson opened this issue Sep 24, 2021 · 10 comments

Comments

@caternuson
Copy link
Contributor

Related:
https://forums.adafruit.com/viewtopic.php?f=25&t=183433

Recreated using pixels_test example from AMG88xx library.

Screenshot from 2021-09-24 12-42-17

Seems related to usage of stop parameter here:

if (!_read(read_buffer, read_len, false)) {

which was not in previous chunk code:
https://github.com/adafruit/Adafruit_AMG88xx/blob/90e9eea8c43b6a173f10029029cec85ab1818823/Adafruit_AMG88xx.cpp#L234

@ladyada
Copy link
Member

ladyada commented Sep 24, 2021

erm, should probably pass stop thru there yeah?

@caternuson
Copy link
Contributor Author

caternuson commented Sep 24, 2021

It's passing through to the actual read start here:

size_t recv = _wire->requestFrom((uint8_t)_addr, (uint8_t)len, (uint8_t)stop);

But seems to be more fundamentally broken. Better example. Using a Feather ESP32. Nothing fancy, just try a read of 32 bytes:

#include <Wire.h>

#define WIRE Wire
#define I2C_ADDRESS (0x69)
#define READ_SIZE (32)

void setup() {
  Serial.begin(9600);
  while(!Serial);

  uint8_t buffer[READ_SIZE];
  
  WIRE.begin();
  WIRE.requestFrom(I2C_ADDRESS, 32, true);
  uint32_t count = 0;
  while (WIRE.available() and count < READ_SIZE) {
    buffer[count++] = WIRE.read();
  }
}

void loop() {
}

Generates expected traffic:
screenshot

Change:

  WIRE.requestFrom(I2C_ADDRESS, 32, true);

to:

  WIRE.requestFrom(I2C_ADDRESS, 32, false);

and nothing happens on the bus.

Above test done with ESP32 BSP 2.0.0

@ladyada
Copy link
Member

ladyada commented Sep 24, 2021

try using something else, esp 2.0.0 broke a ton of stuff

@caternuson
Copy link
Contributor Author

Just to document behavior on a different platform - Qt Py M0

stop = true
qtpy_m0_true

stop = false
qtpy_m0_false

@ladyada
Copy link
Member

ladyada commented Sep 24, 2021

k, looks right to me, there's a stop in the first one, none in the second

@caternuson
Copy link
Contributor Author

Yep. Just documenting expected behavior. Qt Py works as expected.

Just tried with ESP32 BSP 1.0.6 and same results as with BSP 2.0.0.

@ladyada
Copy link
Member

ladyada commented Sep 24, 2021

yah ok try
espressif/arduino-esp32#4729 (comment)

@caternuson
Copy link
Contributor Author

hey! i know that pr :)
espressif/arduino-esp32#5470 (comment)

it does something different, but not the expected. basically same behavior either way.

stop = true
feather_esp32_pr5683_true

stop = false
feather_esp32_pr5683_false

@ladyada
Copy link
Member

ladyada commented Sep 24, 2021

ok please reply to that PR with the deets of what isnt workin

@caternuson
Copy link
Contributor Author

Closing. For now at least. The base issue for this is in the ESP32 BSP and, per comment here:
espressif/arduino-esp32#5702 (comment)
can not be supported for ESP32.

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

No branches or pull requests

2 participants