[AURIX™] AURIX™ TC275处于比较模式的STM0在闪存擦除后停止触发中断怎么解决?

[复制链接]
1346|11
 楼主| laocuo1142 发表于 2024-6-13 11:00 | 显示全部楼层 |阅读模式
我将 STM0 设置为 TC275 比较模式,以运行一个简单的操作系统。
在我的应用程序中,代码的运行符合预期。
现在,我开始在引导加载程序中使用相同的逻辑,但不幸的是,我发现在擦除/写入闪存后,定时器中断不再被触发。
调试时 我注意到STM0_CMP0 寄存器停止递增,但 STM0_tiM0 却一直正常运行。
下面是我的定时器代码和擦除功能的片段,其中我禁用了重置功能。
初始化函数
EXTERN bool_t IFX_OSISR_Initialise(void){    /* Set timer configuration to default values */    IfxStm_Timer_Config timerConfig;    bool_t status = FALSE;    IfxStm_Timer_initConfig( timerConfig,  MODULE_STM0);    timerConfig.base.frequency       = IFX_OSISR_STM_CLK_FREQ;      /* timer frequency */    timerConfig.base.isrPriority     = ISR_PRIORITY_TIMER_STM;      /* interrupt priority */    timerConfig.base.isrProvider     = IfxSrc_Tos_cpu0;             /* interrupt provider */    timerConfig.base.minResolution   = (1.0 / timerConfig.base.frequency) / 1000; /* Mini resolution of the timer in seconds */    timerConfig.comparator           = IfxStm_Comparator_0;         /* Comparator used for timer */    /* Initialize the STM timer with the user configuration */    status = IfxStm_Timer_init( g_timerDriver,  timerConfig);//     IfxStm_Timer_setSingleMode( g_timerDriver,1);    return status;}

启动功能

void IFX_OSISR_Start(void){    /* Start the STM */    IfxStm_Timer_run( g_timerDriver);}
中断处理程序
IFX_INTERRUPT(interruptHandlerSTM, 0, ISR_PRIORITY_TIMER_STM);
void interruptHandlerSTM(void){    /* Clear the interrupt flag and set the next compare value */    IfxStm_Timer_acknowledgeTimerIrq( g_timerDriver);    /* Increment number of ticks since startup */    OsIsr_cntTicks = (OsIsr_cntTicks + 1u);    /* execute handler of OS module */    OS_ActivateTask();}
我的擦除闪存功能按预期运行,而且是通过 SPRAM 运行的。

            boolean iState = IfxCpu_disableInterrupts(); /* Get the current state of the interrupts and disable them*/            uint16 endInitSafetyPassword = IfxScuWdt_getSafetyWatchdogPasswordInline();            IfxScuWdt_clearSafetyEndinitInline(endInitSafetyPassword);            /* Erase the given sector */            IfxFlash_eraseMultipleSectors(sector.startAddress, 1);            IfxScuWdt_setSafetyEndinitInline(endInitSafetyPassword);            IfxFlash_waitUnbusy(FLASH_MODULE0, sector.flashType);            IfxCpu_restoreInterrupts(iState);
smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/AURIX-TC275-STM0-in-compare-mode-stops-triggering-interrupts-after-flash-erase/td-p/705592
suw12q 发表于 2024-6-20 12:38 | 显示全部楼层
要解决AURIX™ TC275处于比较模式的STM0在闪存擦除后停止触发中断的问题,您可以检查中断配置
cen9ce 发表于 2024-6-20 13:42 | 显示全部楼层
确保在闪存擦除后重新配置了中断。有时,闪存擦除可能会导致中断配置丢失,因此需要在擦除后重新配置中断
g0d5xs 发表于 2024-6-20 15:47 | 显示全部楼层
在闪存擦除后,可能需要重新初始化STM0模块。确保重新设置比较模式和中断触发条件
b5z1giu 发表于 2024-6-20 16:05 | 显示全部楼层
确保中断优先级设置正确。如果中断优先级不正确,可能会导致中断无法触发
y1n9an 发表于 2024-6-20 17:13 | 显示全部楼层
在闪存擦除后,确保中断标志被清除。如果中断标志未被清除,可能会导致中断无法再次触发
tax2r6c 发表于 2024-6-20 18:21 | 显示全部楼层
如果存在已知的固件问题,可能需要更新固件版本以解决该问题
lamanius 发表于 2024-6-20 19:46 | 显示全部楼层
建议联系AURIX™ TC275的技术支持团队,寻求他们的帮助和建议
su1yirg 发表于 2024-6-21 08:27 | 显示全部楼层
对于特定的嵌入式系统问题,可能需要深入的硬件和固件调试,因此建议在解决问题时谨慎操作,并在必要时寻求专业支持
lix1yr 发表于 2024-6-21 09:10 | 显示全部楼层
我觉得你可以仿真看看,你咋擦除的?
d1ng2x 发表于 2024-6-21 12:00 | 显示全部楼层
可能是擦错地方了吧,导致程序崩溃了
空间规划科 发表于 2024-6-30 16:58 | 显示全部楼层
在使用 Infineon AURIX TC275 进行闪存擦除或写入操作时,可能会影响到定时器中断的触发,导致一些预期行为发生变化。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1296

主题

6239

帖子

15

粉丝
快速回复 在线客服 返回列表 返回顶部