O'Reilly logo

Embedded Systems Architecture by Daniele Lacamera

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Startup code

In order to boot a workable system, we need to define the interrupt vector, and associate pointers to defined functions. A typical startup code file for our reference platform places the interrupt vector in a dedicated section, using the GCC attribute section. As the section will be put at the beginning of the image, we must define our interrupt vector starting with the reserved space for the initial stack pointer, followed by the system exception handlers.

The zeros correspond to the positions of the reserved/unused slots:

__attribute__ ((section(".isr_vector")))void (* const IV[])(void) ={    (void (*)(void))(END_STACK),    isr_reset,    isr_nmi,    isr_hard_fault,    isr_mem_fault,    isr_bus_fault,    isr_usage_fault,    0, 0, 0, 0,    isr_svc, isr_dbgmon, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required