在RAM中放置bootloader的向量表
typedef void (INTERRUPT *interrupt_handler_t)(void);
struct interrupt_vector {
unsigned char interrupt_instruction;
unsigned char reserve;
interrupt_handler_t interrupt_handler;
};
struct interrupt_vector isr_handler[32] @".memvectab" = {
{0x82, 0x00, __iar_program_start},
{0x82, 0x00, TRAP_IRQHandler},
{0x82, 0x00, NMI_IRQHandler},
{0x82, 0x00, FLASH_IRQHandler},
{0x82, 0x00, DMA1_CHANNEL0_1_IRQHandler},
{0x82, 0x00, DMA1_CHANNEL2_3_IRQHandler},
{0x82, 0x00, RTC_CSSLSE_IRQHandler},
{0x82, 0x00, EXTIE_F_PVD_IRQHandler},
{0x82, 0x00, EXTIB_G_IRQHandler},
{0x82, 0x00, EXTID_H_IRQHandler},
{0x82, 0x00, EXTI0_IRQHandler},
{0x82, 0x00, EXTI1_IRQHandler},
{0x82, 0x00, EXTI2_IRQHandler},
{0x82, 0x00, EXTI3_IRQHandler},
{0x82, 0x00, EXTI4_IRQHandler},
{0x82, 0x00, EXTI5_IRQHandler},
{0x82, 0x00, EXTI6_IRQHandler},
{0x82, 0x00, EXTI7_IRQHandler},
{0x82, 0x00, LCD_AES_IRQHandler},
{0x82, 0x00, SWITCH_CSS_BREAK_DAC_IRQHandler},
{0x82, 0x00, ADC1_COMP_IRQHandler},
{0x82, 0x00, TIM2_UPD_OVF_TRG_BRK_USART2_TX_IRQHandler},
{0x82, 0x00, TIM2_CC_USART2_RX_IRQHandler},
{0x82, 0x00, TIM3_UPD_OVF_TRG_BRK_USART3_TX_IRQHandler},
{0x82, 0x00, TIM3_CC_USART3_RX_IRQHandler},
{0x82, 0x00, TIM1_UPD_OVF_TRG_COM_IRQHandler},
{0x82, 0x00, TIM1_CC_IRQHandler},
{0x82, 0x00, TIM4_UPD_OVF_TRG_IRQHandler},
{0x82, 0x00, SPI1_IRQHandler},
{0x82, 0x00, USART1_TX_TIM5_UPD_OVF_TRG_BRK_IRQHandler},
{0x82, 0x00, USART1_RX_TIM5_CC_IRQHandler},
{0x82, 0x00, I2C1_SPI2_IRQHandler}
};
同时,在链接脚本中,将.memvectab这个section 放置在RAM的0x000000地址处。
|