After some time, I discovered gplink option "-f VALUE". How didn't I see it before??
It just does what I needed in a much simpler fashion.

sdcc -mpic16 -p18f4550 "-Wl -f 0xFFFF" file.c

That generates a .hex file with unused program memory filled with 0xFFFF.

Just in case it is useful for somebody.


On Tue, Jan 31, 2012 at 1:22 PM, Diego Herranz <> wrote:
I don't need fuses in the file because fuses are determined but bootloader and you can't change them later.
Fuses are out of the 32K region. That's why I added them because without padding, I couldn't get the full 32K. Adding fuses, which are out of that range, allowed dd to copy 32K.

Exactly, conv=sync does the padding. I read the man page but I didn't see it.

Thank you very much.

On Mon, Jan 30, 2012 at 5:58 PM, Unix Savvy Brian <> wrote: