USB – Serial Debugger

This shows the moisture sensor from my previous entry with one exception – I added the USB Serial port. I have used various serial ports for debugging in the past, but never the USB despite I have always had it on my boards (almost always) – I simply never took the time to figure out how it worked before. And once I did I was puzzled about how easy it was.

Yes we have JTAG/SWD with single step debugger etc, but you do need a serial line to print info on during a real-time loop – not a lot of info, but triggered info about what is happening. You need this to verify that your system is working and to debug problems. Or to put it in a different way – you CAN manage without as I just had to in a project, but that will cost you a lot of extra hours.

USB is perfect for maintenance and debugging – it only takes two pins and all software topside and embedded is free – only a few lines of code and you have a debug serial running.

In this case I will also use LoRa and I will even look into having a LoRa based Bootloader. A bootloader is a small program that download and start the real program. To do so you need to do a few tricks that I will get back to, but it is not difficult.


Something else that is handy is a proper serial debugger/logger application. This is something I want to create and it is very straight forward. You make a debugger that send info in a selected format and then you add logic to the top-side utility to filter and process that. I tend to do this as per need, so I will look into creating a proper one that I can re-use more because it is an important part of your development time/productivity.

Leave a Reply