Freezing Problem.


Well-known member
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.
Sketch uses 173072 bytes (2%) of program storage space. Maximum is 8126464 bytes.
Current grblHAL can be found here. I didn't include code because, it is huge.
Actually, I changed startup.c based on Frank's posting and that resolved the problem. So, I surmise it is the same problem as in the long thread.

I could go looking but maybe someone knows off the top of their head if this change to startup.c is included in 1.54 beta?
Updated to 1.54 (thanks for all that hard work guys!) and the problem seems to be resolved.
Hello! I’m have a random boot freezing. Sometimes it starts, sometimes no. I’m using a TFT_eSPI library and many fonts in progmem. I can’t to explain how to reproduce this because it’s random. I using last core with Arduino ide 2.2.1
Can you tell which model Teensy and what version of TeensyDuino you are using?

If you can create a small program that shows the problem and post it here, it might be possible to help you trouble-shoot. If that's not possible, the only thing I can suggest is that you try commenting out parts of your program until the problem goes away. Perhaps that will give a clue as to where the problem is.
Without any info... here's a completely blind guess. Maybe you have Teensy 4.0 or 4.1, and maybe you also have it connected to other circuitry which has a separate power source, *and* maybe that separately powered circuitry drives one of Teensy's pins or has a pullup resistor which tries to feed current into Teensy through an I/O pin while its power is turned off? And continuing the blind guesswork, perhaps sometimes that leakage current causes Teensy to partially power up in the wrong order, which would prevent it from booting.

I can’t to explain how to reproduce this because it’s random.

You could at least try to *show* us as much details as possible, ideally with photos of the hardware and a copy of the smallest / simplest code which still reproduces the problem. When we can see more of what you're actually doing, we're often able to help more than just blind guessing.
Why without any info?)

Teensy 4.1 (this was discussed)
Arduino IDE 2.2.1
Last Teensy Core for Arduino IDE (TeensyDuino?) is 1.58.1

About code... I think about it. I think, it will be TFT_eSPI library with many fonts. I will try it and write.