我将 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
共1条
1/1 1 跳转至页
TC275处于比较模式的STM0在闪存擦除后停止触发中断怎么解决?

关键词: TC275 Aurix 中断 闪存
共1条
1/1 1 跳转至页
回复
打赏帖 | |
---|---|
汽车电子中巡航控制系统的使用被打赏10分 | |
分享汽车电子中巡航控制系统知识被打赏10分 | |
分享安全气囊系统的检修注意事项被打赏10分 | |
分享电子控制安全气囊计算机知识点被打赏10分 | |
【分享开发笔记,赚取电动螺丝刀】【OZONE】使用方法总结被打赏20分 | |
【分享开发笔记,赚取电动螺丝刀】【S32K314】芯片启动流程分析被打赏40分 | |
【分享开发笔记,赚取电动螺丝刀】【S32K146】S32DS RTD 驱动环境搭建被打赏12分 | |
【分享开发笔记,赚取电动螺丝刀】【IAR】libc标注库time相关库函数使用被打赏23分 | |
LP‑MSPM0L1306开发版试用结果被打赏10分 | |
【分享开发笔记,赚取电动螺丝刀】【LP-MSPM0L1306】适配 RT-Thread Nano被打赏23分 |