send output from bootloader


I don't know if this question has been asked before.

I currently working on creating my own bootloader for a Mega 2560. Everything works fine, but I wish to know a little more about what is happing, behind the scenes, when a bootloader executes. So my question is, is it possible to send data, like Serial.print in an app. via the usb, and displaying the data in the sketch editors monitor?

I have modified the original stk500boot.c source code, and looking through the souce code, I found it contains functions, that looks like they can do this (PrintString, PrintHex etc.).

So, is it possible?


Yes, absolutely. Basically, it is serial communication same as sketch uploading. However, it can be time critical since uploading protocol has some timing. EDIT: I am supposing you want to use another serial port, isn't it.