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.

[参考译文] TM4C129DNCPDT:主题:在 TivaWare (TM4C) 中未触发 Timer0A 中断–计时器正在运行、但执行不执行计时器 ISR 中断

Guru**** 2914610 points

Other Parts Discussed in Thread: UNIFLASH, TM4C129DNCPDT

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1648632/tm4c129dncpdt-subject-timer0a-interrupt-not-firing-in-tivaware-tm4c-timer-running-but-isr-not-executingtimer-isr-interrupt-is-not-occuring

器件型号: TM4C129DNCPDT
Thread 中讨论的其他器件: UNIFLASH

您好:

我正在使用 TivaWare DriverLib 处理基于 TM4C 的工程、遇到了一个问题、即使计时器明显在运行、Timer0A 中断也不会触发。 但不点击 watchdogTimerIsr ()

设置详细信息:

  • MCU:TM4C(Tiva C 系列)
  • 工具链:Code Composer Studio
  • DriverLib 的示例
  • 系统时钟:使用进行配置 configSysClock(120000000) 并存储在中 g_ui32SysClock

计时器配置:

我正在将 Timer0A 配置为每 850ms 生成一个中断:

#define WATCHDOG_TIMER_BASE     TIMER0_BASE

#define WATCHDOG_TIMER_PERIPH SYSCTL_PERIPH_TIMER0    

#define WATCHDOG_TIMER_INT      INT_TIMER0A

#define WATCHDOG_TIMER_SUB      Timer_A

static bool s_watchdogTimerRunning = false;

INT aa = 0;

静态 void watchdogTimerIsr (void)

  TimerClear (WATCHDOG_TIMER_BASE、WATCHDOG_TIMER_SUB);
AA++;
 // watchdogCheckIn ();

}

静态 uint32_t watchdogTimerLoadTicks (void)

  uint32_t sysClock = g_ui32SysClock;

  IF (sysClock == 0U)

  {

    sysClock = SysCtlClockGet ();

  }

  返回 ((sysClock / 1000U)* 850)- 1U;

}

void watchdogTimerStart (void)

#if ! defined(Board_control)

  返回;

#else

  uint8_t initTry = 0u;

  if (s_watchdogTimerRunning)

  {

    返回;

  }

  应该做

  {

    SysCtlPeripheralEnable (WATCHDOG_TIMER_PERIPH);

    if (initTry++>= port_init_try_times)

    {

      返回;

    }

    SysCtlDelay (g_ui32SysClock/120000U);

  }

  while(!SysCtlPeripheralReady (watchdog_timer_Periph));

  TimerDisable (WATCHDOG_TIMER_BASE、WATCHDOG_TIMER_SUB);

  TimerConfigure (WATCHDOG_TIMER_BASE、TIMER_CFG_PERIODENT);

  TimerLoadSet (watchdog_timer_base、watchdogTimer_sub、watchdogTimerLoadTicks ());

  TimerClear (WATCHDOG_TIMER_BASE、WATCHDOG_TIMER_SUB);

  TimerIntEnable (WATCHDOG_TIMER_BASE、TIMER_TIMA_TIMEOUT);

  IntDisable (WATCHDOG_TIMER_INT);

  IntRegister (WATCHDOG_TIMER_INT、watchdogTimerIsr);

  IntEnable (WATCHDOG_TIMER_INT);

 // watchdogCheckIn ();

  TimerEnable (WATCHDOG_TIMER_BASE、WATCHDOG_TIMER_SUB);
  IntMasterEnable();

  S_watchdogTimerRunning = true;

#endif

}

void watchdogTimerStop (void)

#if ! defined(Board_control)

  返回;

#else

  if(!s_watchdogTimerRunning)

  {

    返回;

  }

  TimerDisable (WATCHDOG_TIMER_BASE、WATCHDOG_TIMER_SUB);

  TimerIntDisable (WATCHDOG_TIMER_BASE、TIMER_TIMA_TIMEOUT);

  IntDisable (WATCHDOG_TIMER_INT);

  S_watchdogTimerRunning = false;

#endif

}

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

    您好 Sarath、

    在 SDK 的 Timer.c 示例中、中断按不同的顺序配置、首先配置 IntMasterEnable、其次配置 IntEnable、最后配置 TimerIntEnable。 您能否尝试此订单并告诉我问题是否仍然存在?

    谢谢、

    -Eric Rentschler

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

    我们还有一个疑问。 我们如何擦除 tm4c129dncpdt 的整个闪存。 虽然我们使用的是 Uniflash、但我们无法在这里找到选项。

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

    您好 Sarath、

    请使用 LM Flash Programmer 工具擦除闪存: https://www.ti.com/tool/LMFLASHPROGRAMR

    谢谢、

    -Eric Rentschler