title: Why do the usual STM32 start ups define the vector table with fewer entries than in the reference manual?
body: <p>I'm learning low-level details of the STM32. I am puzzled by how the vector table is setup.</p>
  <p>In the <a href="https://www.st.com/resource/en/reference_manual/cd00171190-stm32f101xx-stm32f102xx-stm32f103xx-stm32f105xx-and-stm32f107xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf" rel="nofollow noreferrer">reference manual</a>, table 63, it lists the STM32F103C8's vector table. It goes from <code>0x00000000</code> through <code>0x00000130</code>. However, if you look at the generated files from STM32CubeMX (like startup_stm32f103xb.s), you notice it only lists entries until <code>0x00000108</code>, and at this address is the magic number <code>0xF108F85F</code>, which I eventually found information about <a href="https://stackoverflow.com/questions/50977529/arm-cortex-m3-boot-from-ram-initial-state">here</a>.</p>
  <p>Why does the generated code's vector table have fewer entries than the reference manual's vector table? Are those last few entries not actually used, or they can somehow be omitted without consequence? Position 0x108 should be the handler for interrupt &quot;TIM5 global interrupt&quot;. I don't know what this is but why is it that somehow the magic number above can be here instead of the actual handler?</p>
  <hr />
  <p>It begs a related but different question, which is that on some bare metal STM32 code, the only entries defined in the vector table are the stack pointer and the reset handler. No other handlers. What happens here? Are those interrupts disabled by default? Or is that that since those handlers are undefined, the mcu behaviour will be undefined should those interrupts occur and the code just assumes those interrupts will not happen?</p>