简体   繁体   English

MSP430F5436A 锁定

[英]MSP430F5436A Lock Up

We have a product that uses an MSP430F5436A.我们有一款使用 MSP430F5436A 的产品。 It has been in production for several years.它已经生产了几年。 Over the past several months we have had reports from production that a few units are not shutting down completely, their power LED is staying on.在过去的几个月里,我们收到生产报告,称有一些装置没有完全关闭,它们的电源 LED 一直亮着。 The power LED is driven by an I2C GPIO expander, it's not connected directly to the MSP430.电源 LED 由 I2C GPIO 扩展器驱动,它不直接连接到 MSP430。

When the user hits the power button the MSP430 is supposed to shut down a lot of peripherals, turn off the power LED, and enter LPM2.当用户按下电源按钮时,MSP430 应该关闭许多外设,关闭电源 LED,并进入 LPM2。 Periodically a timer interrupt wakes it up from LPM2 to check to see if the power button has been hit to turn the device back on and to do some other house keeping.定时器中断会定期将其从 LPM2 唤醒,以检查是否已按下电源按钮以重新打开设备并进行其他一些内务处理。

After the user hits the power button there is a delay before the device powers off which is driven via a timer ISR.用户按下电源按钮后,设备关机前会有一段延迟,这是通过定时器 ISR 驱动的。 I ripped that out and put in a delay loop.我把它撕掉并放入一个延迟循环。 Within that delay loop I am rapidly toggling a different LED that is connected directly to the MSP430.在该延迟循环中,我快速切换直接连接到 MSP430 的不同 LED。

If I make the loop duration shorter than two seconds the device is able to get into LPM successfully and the LED stops toggling.如果我使循环持续时间短于两秒,则设备能够成功进入 LPM 并且 LED 停止切换。 If I set the loop longer than two seconds I can observe the lock up behavior I am seeing.如果我将循环设置的时间长于两秒,我可以观察到我所看到的锁定行为。 Sometimes the LED is left in an on or off state, that is random.有时 LED 处于打开或关闭状态,这是随机的。

I have attempted to disable all maskable interrupts prior to entering the loop.我试图在进入循环之前禁用所有可屏蔽的中断。 That had no effect.那没有效果。 I also put code in the SYSNMI and UNMI vectors to detect if either of those were firing and neither is firing.我还在SYSNMIUNMI向量中放置了代码,以检测它们中的任何一个是否在触发,都没有触发。 Also, there is no RTOS, this is a cooperative multi-tasking system.此外,没有 RTOS,这是一个协作式多任务系统。 So it seems to be locking up while executing the loop its self.所以它似乎在自己执行循环时锁定了。

Eventually my device reboots from this lockup but it is due to a watchdog reset.最终我的设备从此锁定重新启动,但这是由于看门狗重置。 I print the reset source at startup.我在启动时打印重置源。 The device also recovers if I pull out and reinsert the battery.如果我拔出并重新插入电池,设备也会恢复。 However, the device stays in a locked up state if I pull the reset line low.但是,如果我将复位线拉低,设备将保持锁定状态。 I also have trouble JTAGGing firmware onto the device once it is locked up.一旦设备被锁定,我也有麻烦 JTAGGing 固件到设备上。

I've looked in the errata for the MSP430F5436A for mentions of lock up behavior and the only mention isn't relevant.我查看了 MSP430F5436A 的勘误表中提到的锁定行为,唯一提到的是不相关的。

Unfortunately, due to the packing and construction of the device it is difficult to probe some of the nets, but not impossible.不幸的是,由于设备的包装和构造,很难探测一些网,但并非不可能。

I can connect to the device with a debugger, but the debugger (CCS 7 + MSP-FET430UIF) looses its connection with the device shortly after the device starts running.我可以使用调试器连接到设备,但调试器 (CCS 7 + MSP-FET430UIF) 在设备开始运行后不久就断开了与设备的连接。 That is something that is always true and is a design issue.这总是正确的,并且是一个设计问题。 We have frequent timer interrupts occurring so this behavior may not be avoidable.我们经常发生定时器中断,因此这种行为可能无法避免。

The power source for the device is stable and it is operating on my bench and not in a high EMI/EMF environment.该设备的电源是稳定的,它在我的工作台上运行,而不是在高 EMI/EMF 环境中运行。 However, when this loop occurs some peripherals and power supplies would have been shut down.然而,当这个循环发生时,一些外设和电源将被关闭。 So it is possible some sort of anomaly is occurring on one of the MSP430's power rails or a GPIO pin.因此,MSP430 的其中一个电源轨或 GPIO 引脚上可能发生某种异常。

What could be causing this lock up behavior?什么可能导致这种锁定行为? Are there any persistent registers I can read on reset that would give me a clue, or are there any pins/nets I can probe that would give me a clue?是否有任何我可以在重置时读取的持久寄存器可以给我一个线索,或者是否有任何我可以探测的引脚/网络可以给我一个线索?

Update: I have probed VCC for the MSP430, rails that power peripherals the MSP430 is connected to, and the reset line.更新:我已经探测了 MSP430 的 VCC、为 MSP430 连接的外围设备供电的电源轨以及复位线。 I see no changes on any of these at the time of the lock-up.在锁定时,我没有看到任何这些变化。

Edit: The following is the delay loop that I added编辑:以下是我添加的延迟循环

        dprintf(PRINT_LOG, "Entering delay loop");
        __disable_interrupt();
        enable_backlight();
        for(uint16_t j = 4u; 0u < j; --j)
        {
            __delay_cycles(14680064/20); // ~50mS delay w/ 14.680064 MHz MCLK
            toggle_backlight();
        }
        disable_backlight();
        __enable_interrupt();
        dprintf(PRINT_LOG, "Exiting delay loop");

I incorrectly assumed that the hang was occurring within my delay loop because interrupts were disabled, and that the loop wasn't completing.我错误地认为挂起发生在我的延迟循环中,因为中断被禁用,并且循环没有完成。 It turns out the loop is running to completion, and after interrupts are enabled an ISR is entered for an event that occurred during the execution of the loop.事实证明,循环一直运行到完成,并且在启用中断后,会为循环执行期间发生的事件输入 ISR。 The hang occurs in that ISR.挂起发生在该 ISR 中。

Shortly after the delay loop (in time, but somewhere else altogether in code) a GPIO interrupt is disabled.在延迟循环之后不久(及时,但在代码中的其他地方),GPIO 中断被禁用。 When I power down the device a peripheral that is holding a pin high is shut off, and that pin eventually drops.当我关闭设备电源时,将引脚保持为高电平的外围设备将关闭,该引脚最终会下降。 If I make the delay loop short the loop is exited and that particular interrupt is disabled before the pin drops.如果我使延迟循环短路,则循环将退出,并且在引脚掉落之前禁用该特定中断。 If the delay loop is long the pin drops and when the GIE bit is reset by __enable_interrupt();如果延迟循环很长,引脚就会下降,并且当 GIE 位被__enable_interrupt();复位时__enable_interrupt(); a context switch to that GPIO interrupt begins.到该 GPIO 中断的上下文切换开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM