And everything collapsed!
The CDC USB routine was working well until now. It is working very well on my early prototypes, I made 3 more identical one and the PIC just stop running randomly after a few seconds up to several minutes. USB communication stops and LEDs turns off. It still respond to the INT0 interrupt though, and resume normal operation after reset... until it crashes again randomly.
I am puzzled as the hardware is strictly identical, the only difference I could spot is in the silicon revision of the PIC18LF14K50, says 0000006 on the working batch and 0000005 on the batch that crashes. I have inserted a simple blinking LED loop routine at the very beginning of my code, and it still crashes and stop blinking. Removing part of the program related to USB solve the crashing problem so I would think that there is something wrong in the USB CDC code I have modified.
Problem is that in the revision errata there is nothing linked to the USB SIE, and I am totally clueless about where to start to debug this issue. What could be wrong to have the PIC crash at a random time interval? some kind of buffer overflow?
Bookmarks