Re: [EE] Saving "printf" arguments for later? Real-time on slow processor.
Allen Mulvey <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.pic |
|---|---|
| Message-ID | <[email protected]> |
I had been following this thread with some interest. Some time ago I ran into something quite peculiar involving printf. In recent years I have used, almost exclusively, ESP devices, mostly ESP32. My code is full of Serial.print Serial.println statements so I can follow the program flow in trial runs. I would occasionally get a device that compiled well apparently with plenty of resources to spare but the device would get into a continual reboot loop at runtime. Somewhere I read that this was caused by the Serial.print statements and replacing them with one printf statement would fix the problem. To me this seemed counter-intuitive. I expected printf to have much more overhead. But it works! I now use printf whenever there is more than one variable to display and sometimes even for only one. I have no idea why this is. Does anyone know? Thanks. My IDE is Arduino with which I have had an ongoing love / hate relationship. I keep saying I need to get something better but I really don't want to endure another learning curve. Thanks again, Allen Mulvey