0

i am familiar with uploading an arduino bootloader onto an atmega328p using another arduino via the arduino IDE. i have also installed software 'sketches' using that process which i believe leaves out the bootloader(meaning one wouldnt be able to upload new sketches in the future via usb). my question is: is it possible to load both the bootloader and a software program onto the chip via icsp? many thanks in advance.

1 Answer 1

2

The Arduino builder creates for AVR boards not only hex file for the sketch, but it creates a combined hex with bootloader and sketch too. It is for example for Blink.hex a Blink_with_bootloader.hex. If you use in IDE the "Export compiled binary" command in Tools menu, the builder puts the hex files next to ino file in your sketch folder.

If you want the command "Upload using programmer" to upload hex with the bootloader, modify in platform.txt the tools.avrdude.bootloader.pattern key to use "-Uflash:w:{build.path}/{build.project_name}_with_bootloader.hex:i"

7
  • Hi thanks very much for this. where can i find platform.txt?
    – Danny
    Nov 6, 2019 at 15:08
  • it depends if it is the core bundled with IDE, then in IDE installation folder, or if it was installed with Boards Manager then packages are located in ~/.arduino15/packages/ on Linux and %userprofile%\AppData\Local\Arduino15\packages\ on Windows (AppData is a hidden folder).
    – Juraj
    Nov 6, 2019 at 15:30
  • yeah theres no txt file in there, just folder containing arduino cores i have installed...(i am on windows 10
    – Danny
    Nov 6, 2019 at 16:06
  • something like packages/arduino/hardware/avr/1.6.21
    – Juraj
    Nov 6, 2019 at 16:26
  • hi i really appreciate this help by the way but am still having trouble. i tried editing the file but it had no effect (still uploading the hex file from the temp directory. i noticed that the platform.txt file was in a folder called 1.8.1 and the version of arduino i am running is 1.8.9 so i thought maybe i am editing the wrong document. so i removed the file from the folder, restarted arduino and tried uploading, expecting an error or something and it acted normally which makes me think that its not paying any attention to this file....?
    – Danny
    Nov 7, 2019 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.