Closed caternuson closed 3 years ago
!? can you try turning on i2c debug in busio?
This is on QT PY, running the adafruit_scd30_test
example, and with #define DEBUG_SERIAL Serial
enabled in Adafruit_I2CDevice.cpp
, and uploading after a complete power cycle.
Looks like the reset failed maybe?
can you compare the data trace with an M4?
Itsy M4
try initing these to zero https://github.com/adafruit/Adafruit_SCD30/blob/master/Adafruit_SCD30.cpp#L293
also this is running past the buffer end https://github.com/adafruit/Adafruit_SCD30/blob/master/Adafruit_SCD30.cpp#L286
OK, back to QT PY with initing those values to zero. But nothing done for the buffer index.
yay ok! PR plz :)
nice spot! thanks.
guess we'll see if/when that buffer index issue causes grief.
Looks resolved: https://forums.adafruit.com/viewtopic.php?f=19&t=175010#p853221
Thanks again @ladyada for the assist!
This sort of thing (stack variables used before initialisation) could easily be detected by static analysis of the code as a prevention measure in the same way that pylint
runs over the CircuitPython libraries.
The gcc
/g++
compiler has enough smarts in it to pick this up too with -Wuninitialized
and/or -Wmaybe-uninitialized
. Antique versions of gcc
may incorrectly inhibit this due to confusion from memcpy()
.
@kevinjwalters yes, please add a check update to the Arduino CI!
Re this thread: https://forums.adafruit.com/viewtopic.php?f=19&t=175010
I've recreated same behavior on QT PY:
And also Itsy M0:
But seems to work just fine on Itsy M4: