Description
I'm trying to set up multi-master I2C communication on board running an ATSAMD21G18 (2 masters and slave so far) with this code: https://github.com/kb-/Arduino-I2C-2way-anydata/tree/dd5597835c9a8a89ff23cc17605bb6f59faa5699
One of the masters randomly hangs after a large number of transfers (around 70 000 on average), always at line 526 of SERCOM.cpp
The same behavior occurred on 5 different boards I tried, 2 different models.
I'm getting this in the backtrace but can't figure out what's wrong :
(gdb) bt
#0 0x0000331a in SERCOM::sendDataMasterWIRE (
this=this@entry=0x20000300 , data=)
at /home/oe/.arduino15/packages/misfittech/hardware/samd/1.0.0/cores/arduino/SERCOM.cpp:526
#1 0x0000275a in TwoWire::endTransmission (this=this@entry=0x2000018c ,
stopBit=stopBit@entry=true)
at /home/oe/.arduino15/packages/misfittech/hardware/samd/1.0.0/libraries/Wire/Wire.cpp:134
#2 0x00002784 in TwoWire::endTransmission (this=this@entry=0x2000018c )
at /home/oe/.arduino15/packages/misfittech/hardware/samd/1.0.0/libraries/Wire/Wire.cpp:151
#3 0x0000224c in loop ()
at /home/oe/sketchbook/Master_test_i2c_data2/Master_test_i2c_data2.ino:81
#4 0x00003846 in main ()
at /home/oe/.arduino15/packages/misfittech/hardware/samd/1.0.0/cores/arduino/main.cpp:46
It doesn't occur with one master only (4 000 000 successful transfers).