Short Version: Does anyone have, or know of, a super simple AVR bootloader (i.e. C source code and explanation/tutorial)?
Long Version: I’m currently using an ATMega168 as the brains of a robotic helicopter (work in progress), which has a wireless serial radio connecting it’s UART pins to a ground computer. The helicopter is connected to a 5 degree of freedom safety stand for testing and development, and I have things like control loop gains as well as telemetry sent over the wireless serial link.
The problem is that every time I want to tweak the actual microcontroller program during an experiment (i.e. change the structure of a control loop, not just its gains) I have to walk over from the computer to the test stand, switch off the motor controller board (for safety), plug the programmer into an unfortunately cumbersomely located ISP header (my fault), walk back to the computer, download the program, walk back to the helicopter, unplug the header (also somewhat cumbersome), switch the motor controller back on, walk back over to the computer, send a command to ramp the throttle, walk back over to the helicopter, press the ARM button (only works after ramping throttle), and finally walk back over to the computer and resume my experiment. I got a wireless keyboard which makes things a little better, but this still eats up a lot of my testing time.
My dream is to turn the throttle all the way down from the ground computer, tweak and compile the AVR code, send the new hex file over the wireless radio, turn up the throttle back up, and continue the experiment all without getting up from my seat.
I’ve been looking into this just a little, and it seems like the super-basic and application specific boot loader I would need could be written in like a page of code. It also seems like figuring out how to do it will end up taking (me) way longer than all my back and forth walking and plugging and unplugging. Still, I really like the idea.
Getting the helicopter quasi-flying is far more important to me right now than neat features like wireless microcontroller reprogramming, but if anyone has some source code or can point me in a good direction that would get me there more quickly, it would totally be worth it (plus having more neat features is always good!). I know the ATMega168 on the X2 must have a UART-based bootloader of some sort, but I don’t know if it would help in this case.
Thanks for any input.