News for hackers. Stuff that matters.
Re:When printf debugging is a luxury (2010) by niccl on Saturday January 03, 2015 @03:35PM (#8831901)
Luxury. We used to _dream_ of printf debugging when we're doing embedded microcontroller systems! (at least the ones I work on).

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.

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)

Re:When printf debugging is a luxury (2010) by ctz on Saturday January 03, 2015 @03:52PM (#8831965)
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.
Re:When printf debugging is a luxury (2010) by dkersten on Sunday January 04, 2015 @10:22AM (#8834623)
I did this too. My life was a lot simpler on the projects where I could connect to UART and actually output text, but that wasn't always the case.