Re:When printf debugging is a luxury (2010)
by sliverstorm on Saturday January 03, 2015 @04:36PM
(#8832081)
I grew fond of printing a char, after I spent some time snooping a uart. The o-scope in capture mode (I realize this wasn't always an option) grabs the char. Handy because I find char waveforms very easy to recognize at just a glance, and you don't have to measure periodicity or count toggles.
Even if you don't have a uart, you can write a little proc to bit-bang a pin.
Re:When printf debugging is a luxury (2010)
by ijager on Saturday January 03, 2015 @06:09PM
(#8832414)
When developing for microcontrollers and for example my leds aren't working, I like to define a place in memory where I write values to depending on the place in code. Then just read out that memory address with OpenOCD (jtag of swd).
#define debugVar ((uint32_t *) 0x10007000)
*debugVar = 1;
*debugVar = 2;
*debugVar = 0xdeadcafe;
Re:When printf debugging is a luxury (2010)
by pantalaimon on Saturday January 03, 2015 @07:18PM
(#8832613)
I found tiny printf incredibly useful for this
[1] http://www.sparetimelabs.com/tinyprintf/tinyprintf.php [2] https://github.com/cjlano/tinyprintf (32bit version)
I love ARM semihosting for this reason. It's obviously insanely slow, but unlike a UART it doesn't need any extra hardware and the target is halted while the slow bit is taking place.
There the debugging is toggling a port pin and examining with an oscilloscope. I typically toggle it different numbers of times at different places in the code to see where I've got to.