This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] [参考译文] 【常见问题解答】MSPM0G3507:如何将 ISR 放入 MSPM0 器件的 SRAM

Guru**** 2794765 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1622275/faq-mspm0g3507-how-to-put-the-isrs-into-sram-for-mspm0-deivces

器件型号: MSPM0G3507

  1. 使用 DL_Interrupt_registerInterrupt 函数定义使用的所有中断。(该函数会将矢量表复制到 SRAM 中、并根据需要修改中断 ISR 入口地址)

image.png

示例:   

DL_Interrupt_registerInterrupt (

    ((uint32_t) UC0_INT_IRQn)、BSL_PI_UART_ISR);

BSL_PI_UART_ISR 是 ISR 函数名称

2.  

将所有 ISR 函数定义到 SRAM 中。 只需在下面添加定义

#if Defined (__ti_version__)|| Defined (__TI_COMPILER_VERSION__)

#define RAMFUNC \

   __attribute__((section(“.TI.ramfunc")“))__attribute__((noinline))

#elif defined (__GNUC__)

#define RAMFUNC __attribute__((section(“.ramfunc")“))__attribute__((noinline))

#elif defined (__iar_systems_icc__)

#define RAMFUNC __ramfunc _attribute__((noinline))

#else

#error “此函数不支持编译器“

#endif

使用它、如下所示

RAMFUNC 静态空洞 BSL_PI_UART_ISR (void)

//函数

}