1
\$\begingroup\$

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.

asked Oct 23, 2013 at 8:06
\$\endgroup\$
8
  • \$\begingroup\$ Can you put your startup code and configuration here? \$\endgroup\$ Commented Oct 25, 2013 at 12:34
  • \$\begingroup\$ Even if I have my startup.asm completely empty, and (for the test) don't have any initialization for anything (ports, timers, interrupts, etc.) the interrupt vector is still generated by the compiler. Actually, a completely empty startup.asm and a main source file only containing void main(){} still does generate the interrupt vectors. In the project configuration I couldn't find anything relevant, and I hunted on Google for possible #pragma settings, without luck so far. \$\endgroup\$ Commented Oct 25, 2013 at 12:58
  • \$\begingroup\$ How is your Code Generation config? Have you put Program type as 'Application' or 'Boot Loader'? \$\endgroup\$ Commented Oct 25, 2013 at 13:32
  • \$\begingroup\$ Boot loader, but it happens with both. \$\endgroup\$ Commented Oct 25, 2013 at 13:41
  • \$\begingroup\$ Have you seen this FAQ? I think it's rather gcc-specific but may be worth a read, especially #18. \$\endgroup\$ Commented Oct 25, 2013 at 16:01

2 Answers 2

1
\$\begingroup\$

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.

answered Oct 29, 2013 at 6:00
\$\endgroup\$
1
  • \$\begingroup\$ I know. This has been discussed in the comments. The question is, how exactly to do it as I couldn't find a way for it in the mentioned compiler. And if I write it all in Assembly I still have to compile it to machine code. \$\endgroup\$ Commented Oct 29, 2013 at 7:10
1
\$\begingroup\$

The CodeVision Advanced (costing 50 € more than the standard version) has an option for it in the Project|Configure|C Compiler|Advanced menu.

answered Aug 22, 2017 at 5:12
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.