Think

  • English
  • Fran├žais

On twitter

@chtronche

- 35 days ago

(actually, it's a Kinetis K20, not an AVR)
h J R
@chtronche

- 41 days ago

If it crashes, it's not the libraries, it's not the compiler, it's not the hardware. Look into your code first.
h J R
@chtronche

- 41 days ago

As a lesson, although the crash occurred in a rather experimental library that had suffered bugs in the past, I had been using it for several years now without a glitch. So it had to be my code. Once I was in that state of mind, spotting the problem was rather quick.
h J R
@chtronche

- 41 days ago

To tell the whole story, a sprintf overrunning a buffer on the stack (local variable) was altering the virtual function table of the object (this is C++ on AVR), thus crashing at the very point of the function call. Paranormal, I tell you.
h J R
@chtronche

- 41 days ago

Never use sprintf, use snprintf instead,especially in embedded systems... The non-believers will go to hell, which actually is the place where you spend your week-end debugging erratic seemingly paranormal behaviors...
h J R