…but how do you debug the code?

Continuing the theme of board bring-ups, I did one a few years ago with a high-profile customer, probably the foremost manufacturer of LCD TVs in Europe.  We were the back-end scaling and LCD driving part of the design and Micronas were the front-end video decoder and deinterlacer.  They had sent over 3 FAEs to tune their video decoder whereas it was just me from our side.

However, it wasn’t just the FAEs that were unbalanced.  The customer had 3 hardware engineers and just 1 software engineer.  I had done my homework and got the latest software build for our part so I was pretty confident that we’d get the software running quickly and start knocking off their software bugs at a good rate.

I would normally insist on doing a schematic and layout check before the customer signed off the PCB for manufacture but I figured that these guys knew what they were doing, so I didn’t in this case.  As it turned out, that was a mistake.

I had unpacked my evaluation board and ROM emulator (this was before the days of JTAG debugging) and was raring to go when I noticed something odd about their board.  I go to plug in my emulator and find there is no debug socket to plug it in to.  When I asked where it was, they told me they didn’t put it on because they didn’t think they would need it.

So I asked the software engineer, “How do you debug the code without an emulator?”

“Oh,” he said, “I just flash it down and use printf debugging.”

Well, anyone who has ever debugged code knows that printf debugging is only really workable for small amounts of code or for where you really have no other choice.  To debug the amount of code in your average TV you really need to set breakpoints in the code, single-step through lines of code and be able to inspect variables.

Bearing in mind that this was the first prototype board and there are usually going to be hardware changes before the final hardware, I could not believe they had not put a debug connector on the board.  By all means, don’t populate it on production board or even have a break-off board.  It’s not as if there was any space constraint!

Well, I said to the 3 hardware engineers who were standing around twiddling their thumbs, “Take this board and de-solder the FLASH memory.  Then wire the address and data pins to this connector.”  After about an hour, they came back with the board.  I plugged in the emulator and the code ran nicely.  I could set hardware breakpoints and debug code quickly.

The story has a happy ending.  Not only did the board work well but it went on to be this company’s best selling LCD TV chassis ever!

Leave a Reply

Your email address will not be published. Required fields are marked *