Skip to main content
  1. Notes/
  2. Embedded Systems/

Embedded Basics

ISR: Interrupt Service Routine
#

  • It is a function that runs automatically when an interrupt happens.
  • Examples of interrupts:
    • A timer tick (SysTick) - SysTick is a timer built into ARM Cortex-M MCUs to generate time delays and periodic interrupts at regular intervals. It can be used for polling sensors, updating displays, generating delays in programs.
    • GPIO pin change (button press)
    • UART received a byte
    • SPI transfer finished
  • When an interrupt occurs, the CPU pauses normal code execution and jumps to the corresponding ISR.

ISR Vector or Interrupt Vector Table
#

  • Is a table of function addresses that tells the CPU which function to run for which interrupt.
  • Like a phonebook for interrupts.
  • On Cortex-M CPUs the ISR vector table is located at the start of FLASH. The CPU always looks here on reset.

ISR Vector and Bootloaders
#

  • CPU rule(Hardware behiviour): At reset, the CPU fetches the interrupt vector table from address 0x00000000
  • But with bootloaders, at reset, for example: 0x00000000 ── Bootloader ISR vector 0x00026000 ── Application ISR vector So at reset:
    1. CPU jumps into bootloader
    2. Bootloader initializes minimal hardware
    3. Bootloader jumps to your application