I have been searching around the web, but didn't find anything useful telling me how to start.
I have an Atmega328p. I think this is the easiest controller to start with for this kind of things.
I would like to write my own bootloader. Where should I start to write code for?
Bootloader is essentially a bare-metal program that is running on your micro, listening to one or more communication interfaces (Serial, SPI, USB or you name it..) with a specific protocol. Then, on the PC/programmer side there is a "client" software that can some binary (but not limited to) and send it using that protocol to the bootloader. Then upon reception the bootloader will store the received data in some known memory location and issue a "jump" (or "branch" or "goto" or whatever) to the start of that data, thus triggering execution of it assuming it is an executable code. So, you bootloader at very minimum should be capable of:
1) Using one of the communication channels
2) Implementing a specific protocol
3) Storing the received executable in some memory
4) Trigger the execution of that code
From here it's you implementation choice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With