cvmanjoo / AT24Cxx

I2C EEPROM Library for Arduino
The Unlicense
3 stars 5 forks source link

Xaio #1

Open Gregj888 opened 2 years ago

Gregj888 commented 2 years ago

It appears the library bricks the Seeduino XIAO. 2 different boards. Ordered a programmer to re-flash.

For now, be careful...

jwhitham commented 1 year ago

This happened to me as well, but with the Adafruit Circuit Playground Express (CPE). It seems that even just adding

#include <AT24Cxx.h>
#define EEPROM_ADDRESS 0x50
AT24Cxx eep(EEPROM_ADDRESS, 32);

to an Arduino sketch is enough to prevent it booting up properly. The serial port is no longer visible in the Arduino IDE.

I was able to recover the CPE and reprogram it by double-pressing the reset button.

I did some more investigation, as I have a J-Link device and can dump and reprogram the CPE's memory. I didn't find anything of concern. The program had been uploaded correctly, the bootloader was intact and still protected by the BOOTPROT setting. It just seems like the program crashes on startup. Perhaps this is because the AT24Cxx constructor calls "Wire.begin()". This could be happening too early in the boot process, and the result is a crash. In other libraries, Wire.begin() is called from a "begin()" function.

cvmanjoo commented 6 months ago

I have the same issue on Arduino Uno R4. Any idea how to fix it?

jwhitham commented 6 months ago

To make it boot up, you have to either (1) force the device to stay in the bootloader, so that the broken firmware can be replaced, or (2) buy a hardware programmer such as a J-Link and use this to erase the broken firmware. Try pressing the reset button twice quickly. https://support.arduino.cc/hc/en-us/articles/5779192727068-Reset-your-board

I never figured out a way to use EEPROM in my project. I think you'd probably want to use a different library, but I don't have any particular recommendation.

Gregj888 commented 6 months ago

There are a few libraries that will brick a XIAO. As far as the EEPROM, we've been using EEPROMS on 3-4 versions of our boards for the XIAO and the BLE-33-IOT. We ended up trying a couple of eeprom libraries. I believe we ended up with the I2C_EEPROM@1.8.2 library by Rob Tillaart.

Star with the I2C examples and make sure you can find the EEPROM, then use the EEPROM examples to read/write/read a little data to check that out.

We also found several versions of the IDE were problematic. 1.18 was OK and 2.3.0 seems good.

Some bricked XIOSs (and BLEs) came back with the double reset and others needed the J-link, on some computers. The USB support is different on different from PC to PC so may want to try another PC too.

Good luck.