Is there any easy way to upload the Arduino Bootloader and a Sketch to the Atmega 328 using an Arduino as the programming platform?
I'm looking to put together a project for our hackspace and so may need to add the bootloader and sketches to a lot of ICs.
A follow on question. From reading the articles am I right that the Sketch when uploaded starts at 0000hx while the bootloader, depending on it's sizes starts at one of the following:
Meaning if I wanted to manually create a 32K hex file I could take the original sketch hex and the relevant hex file for the bootloader being used and put them together in a 32k hex file.
I assume I wouldn't have to care about what's between the Sketch hex and the Bootloader hex?
Also, even if the bootloader is smaller than 4096 (and space permitting) could I start all versions of a bootloader at 7000?
The bootloader is indeed just code at the top end of program memory. It you wanted to have a bootloader, and an initial sketch you need to make the BOOTRST fuse jump to the bootloader first.
I assume I wouldn't have to care about what's between the Sketch hex and the Bootloader hex?
No, it would normally be 0xFF.
I think with my hex (file) uploader sketch, if you save program memory to disk it saves all of memory, but I might be wrong.
Also, even if the bootloader is smaller than 4096 (and space permitting) could I start all versions of a bootloader at 7000?
Yes, if the bootloader is compiled to run at that address. However Optiboot, for example, is not.
There are assorted methods and utilities for merging two .hex files (assuming that they don't overlap.) It's almost trivial to do manually with a text editor. Here's one: bialix.com