Booloader programming by Arduino UNO

Dear all,

I would like to implement a simple bootloader via SPI from Arduino UNO. The idea is that Arduino read a *.hex file and send all datas to slave. May I know if I should read byte by byte as reading a raw text file or there is some specific library to do the job ?

P/S: below is a part of hex file opened in text editor
:020000040000fa
:080000000002040000000000f2
:020000040000fa
:0400080006030000eb
:020000040000fa
:04000c0048030000a5
:020000040000fa
:040010008803000061
:020000040000fa
:0400140026030000bf
:020000040000fa
:040018006803000079
:020000040000fa

Thank you in advance !

I have no idea about programmers. But you can read using readBytesUnil() to read a single line.

The source code of ArduinoISP is available in the examples of the IDE; it can be of help to see how they approach it using serial comms. Or you don't have to reinvent the wheel :wink:

I'm aware that a few projects have been done with SD cards to store hex files; you will have to do some research as I can't remember the details.

sterretje:
I have no idea about programmers. But you can read using readBytesUnil() to read a single line.

The source code of ArduinoISP is available in the examples of the IDE; it can be of help to see how they approach it using serial comms. Or you don't have to reinvent the wheel :wink:

I'm aware that a few projects have been done with SD cards to store hex files; you will have to do some research as I can't remember the details.

Thank you for your reply. As I have no experience in programming bootloader so I don't know how exactly they do in reality. I believe that the simplest idea is to read all character of *.hex file and send them to the right memory placement on the slave side.
I will try to do some research, If you have any idea or example projects (even in other environment/hardware), please send me. Thanks again :slight_smile:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.