I'm trying to communicate with an EEPROM chip using SPI. When I run under the debugger, the EEPROM doesn't respond; without the debugger running, it seems to work fine.
What difference could running under the debugger be making?
I'm trying to communicate with an EEPROM chip using SPI. When I run under the debugger, the EEPROM doesn't respond; without the debugger running, it seems to work fine.
What difference could running under the debugger be making?
Depends on your EEPROM, if it does not like breaks in between SPI read/write bytes then it probably wont respond. Check the commands sent to the EEPROM and its response using logic analyzer with and without debugger.
The broken behaviour happens even without any breakpoints set. Looking on an analyser with and without debugger, the signals are pretty much identical.
There must be a difference either in the data sent or in the timings. There is no other explanation to it. The timing could be different in us - ms. Also check if there are any floating pins and all pins are pulled down or pulled up correctly if they require it.
So, we got it working and the problem was this:
The EEPROM has a HOLD pin which needed to be pulled-up in order for it to work. Although the datasheet showed an example schematic with that pin floating (internal pullup implied) that was not the case and an external pullup was needed.
We think the debugger/non-debugger difference in behaviour was caused by different levels of noise on the floating pin with/without the debugger running. Bit weird, but 100% reproducible.
That is a bit strange that the noise was making this 100% reproducible. Would you please mind telling us the EEPROM spec, could be fun for others to try figure it out what cause this. Most probably some electrical resonance.