Electronic – How to stop CodeVision from generating the interrupt vector

atmegabootloader

CodeVision has a lot of nice features, among them the automatic generation of the interrupt vector.

However, now I'm working on a very small bootloader, and I can't afford any interrupts. CodeVision still happily generates the interrupt vector at the beginning of the Flash memory, and I couldn't find a way to turn it off.

It is crucial, as the interrupt vector would take up 25% of the space in the flash memory for the smallest bootloader. (128 words bootloader, and the interrupt vector needs 32 words for a 16k atmega)

I set "Use an external startup initialization file" and I use my own startup.asm. Even if I don't include anything about the interrupt vectors, they are still generated for the executable.

Best Answer

Generally to remove whole section like that you will need to use a custom linker script and you may need to modify or remove some of the behind-the-scenes startup code that compilers usually throw in. Although for a 128 word bootloader, you may be better served writing it in assembly.