I'm building grblHAL for Teensy 4.1 and seeing a problem that seems very similar to a problem that was discussed here some time ago. I think it may be related to this problem.
Basically, when certain options (Ethernet that pulls in LWIP, for example) are enabled, there are significant pauses in program execution that make it unusable. I don't believe the problem is the ethernet libs as this problem shows up without it enabled.
The symptom is that the system freezes periodically. It could well be 1786 mS. Though there is a second, shorter freeze that happens. The cycle is long freeze, activity, short freeze, activity in about a 3-4 second period.
The "fix" is to change the size of PROGMEM by adding or removing an item or two. The problem feels a lot like some sort of missed timer interrupt. Of course, this is no fix at all because PROGMEM will change with the enabling of different options. The other problem is that it doesn't always occur for every person building the system even though using (as best I can tell) the exact same source code and build environment (arduino in this case). Probably some library somewhere is slightly different. The good news, the problem shows up immediately so it's easy to "voodoo" fix.
To be honest, I don't understand FrankB's fix in the freeze thread. Not sure how to apply it to grblHAL. Any suggestions greatly appreciated. Wish I had a HW debugger so we could trace this.
Using Arduino 1.8.13 and Teensyduino 1.53.
Current grblHAL can be found here. I didn't include code because, it is huge.
Basically, when certain options (Ethernet that pulls in LWIP, for example) are enabled, there are significant pauses in program execution that make it unusable. I don't believe the problem is the ethernet libs as this problem shows up without it enabled.
The symptom is that the system freezes periodically. It could well be 1786 mS. Though there is a second, shorter freeze that happens. The cycle is long freeze, activity, short freeze, activity in about a 3-4 second period.
The "fix" is to change the size of PROGMEM by adding or removing an item or two. The problem feels a lot like some sort of missed timer interrupt. Of course, this is no fix at all because PROGMEM will change with the enabling of different options. The other problem is that it doesn't always occur for every person building the system even though using (as best I can tell) the exact same source code and build environment (arduino in this case). Probably some library somewhere is slightly different. The good news, the problem shows up immediately so it's easy to "voodoo" fix.
To be honest, I don't understand FrankB's fix in the freeze thread. Not sure how to apply it to grblHAL. Any suggestions greatly appreciated. Wish I had a HW debugger so we could trace this.
Using Arduino 1.8.13 and Teensyduino 1.53.
Code:
Sketch uses 173072 bytes (2%) of program storage space. Maximum is 8126464 bytes.