我将 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 跳转至页
回复
我要赚赏金打赏帖 |
|
|---|---|
| OK1126B-S开发板下函数构建及步进电机驱动控制被打赏¥25元 | |
| 【S32K3XX】LPI2C 参数配置说明被打赏¥20元 | |
| OK1126B-S开发板的脚本编程及应用设计被打赏¥27元 | |
| 5v升压8.4v两节锂电池充电芯片,针对同步和异步的IC测试被打赏¥35元 | |
| 【S32K3XX】S32DS LPI2C 配置失败问题解决被打赏¥22元 | |
| 【S32K3XX】FLASH 的 DID 保护机制被打赏¥19元 | |
| OK1126B-S开发板串口通信及其使用被打赏¥18元 | |
| 【S32K3XX】多核 CORE ID 获取被打赏¥18元 | |
| OK1126B-S开发板的GPIO资源及其使用被打赏¥20元 | |
| 【分享开发笔记,赚取电动螺丝刀】三分钟快速上手驱动屏幕(Arduino IDE环境)被打赏¥23元 | |
我要赚赏金
