Beyond Printf(): Better Logging Practices for Faster Debugging

All of us who do some programming know that logging is a time-tested way to output messages about the internal state of our code. With varying degrees of adjustable granularity, these messages allow us to keep track of not only the state of the application, but also its overall health. …read more

Continue reading Beyond Printf(): Better Logging Practices for Faster Debugging

Hackaday Podcast 071: Measuring Micrometers, the Goldilocks Fit, Little Linear Motors, and 8-bit Games on ESP32

Hackaday editors Mike Szczys and Elliot Williams fan through a fantastic week of hacking. Most laser cutters try to go bigger, but there’s a minuscule one that shows off a raft of exotic components you’ll want in your bag of tricks. Speaking of tricks, this CNC scroll saw has kinematics …read more

Continue reading Hackaday Podcast 071: Measuring Micrometers, the Goldilocks Fit, Little Linear Motors, and 8-bit Games on ESP32

Tic-Tac-Toe Implemented in Single Call to printf()

[Nicholas Carlini] programmed a C implementation of two-player Tic Tac Toe, and he did it in a single call to printf(). The arguments for that single function call get mind-bendingly complex, so it may come as no surprise that it was written for The International Obfuscated C Code Contest …read more

Continue reading Tic-Tac-Toe Implemented in Single Call to printf()

Debugging with Serial Print at 5333333 Baud

Debugging with printf is something [StorePeter] has always found super handy, and as a result he’s always been interested in tweaking the process for improvements. This kind of debugging usually has microcontrollers sending messages over a serial port, but in embedded development there isn’t always a hardware UART, or it might already be in use. His preferred method of avoiding those problems is to use a USB to Serial adapter and bit-bang the serial on the microcontroller side. It was during this process that it occurred to [StorePeter] that there was a lot of streamlining he could be doing, and …read more

Continue reading Debugging with Serial Print at 5333333 Baud

Backchannel UART without the UART

Anyone who has worked with a microcontroller is familiar with using printf as a makeshift debugger. This method is called tracing and it comes with the limitation that it uses up a UART peripheral. Believe it or not, there are 8051 variants out there that come with only one serial block and you are out of luck if your application needs it to communicate with another device.

[Jay Carlson] has a method by which he can piggyback these trace messages over an on-chip debugger. Though the newer ARM Cortex-M software debugger already has this facility but [Jay Carlson]’s hack is …read more

Continue reading Backchannel UART without the UART