如何知道重置是否是由于看门狗定时器?

⚠️
嗨,...感谢您来论坛。令人兴奋的消息!我们现在正在迁至我们的新论坛平台,将提供更好的功能,并包含在主对话框网站中。所有帖子和帐户都已迁移。我们现在只接受新论坛上的流量 - 请发布任何新线程https://www.dialog-seminile.com/support.。我们将在未来几天修复错误/优化搜索和标记。
6个帖子/ 0新
最后一篇
Ruchi Patel.
离线
最后一次露面:2 years 6 months ago
加入:2017-03-29 10:50
如何知道重置是否是由于看门狗定时器?

Dear Dialog_Support,

我已经将一个变量的值存储到Flash中,我想在看门狗定时器重置后检索该值。但我无法认识到由于看门狗或任何其他原因而发生重置。我读过这篇文章
https://support.dialog-semicondiondiondiondum/how-could-i-know-hether-reset -...
我来知道如果我们在保留RAM中声明变量,那么我们可以在看门狗之后检索它。另一种解决方案是使用外部存储器。当我的应用程序没有任何外部内存时,我必须将变量声明到保留RAM中。我已经尝试这样做,但在看门狗重置后我无法检索其值。因此,您可以建议我将值存储到保留RAM中的任何示例,并在设备重置后重返回来。
Thank you in Advance

带着敬意,
Ruchi Patel.

Device:
PM_DIALOG.
离线
最后一次露面:4天17小时前
职员
加入:2018-02-08 11:03
嗨Ruchi Patel,

嗨Ruchi Patel,

你可以存储你的数据保留RAM as the procured described in the past thread that you have posted. Be aware that after the device resets, your stored data will be lost. Please check the SystemInit() function, and you will find the SetBits16(PMU_CTRL_REG, RETENTION_MODE, 0xF); , so all the bits of the retention ram are set to zero As you already have seen the zeroing out of the retention memory area is something that should be done when the device boots up since the retention area while in deep sleep holds, besides the user data, additional BLE information (BLE heap, stack, etc).

重置后,归零功能将再次运行,并将消除保留存储区域中的任何数据。为了避免您可以做的是要知道您的“数据”驻留在保留存储区域和初始化期间,您应该避免将它们归零。没有参考设计或示例,演示了,我所做的是以下内容:

在SIMPTIONFILE中定义为深度睡眠的保留存储区域分配一个容纳应不初始化的空间。

  • Part of the RETRAM_LEN will be used from your new section so remove from the #define RETRAM_LEN the amount of bytes that you will use and add the size of the new section (the new RETRAM_LEN = RETRAM_LEN – SZ_AFT_RST_DATA):

§ LR_RETENTION_RAM0 0x00080768 (RETRAM_LEN + EXCHANGE_MEMORY_SIZE + SZ_AFT_RST_DATA) {

  • 在从0x00080768开始的lr_retention_ram0中声明一个执行区域。新的执行区域将从0x00080768开始,并且将具有您要求的范围(例如,例如,您想要的范围是SZ_AFT_RST_DATA 80字节)。所以散射文件会改变为:

§ RET_RESET01 0x00080768 UNINIT SZ_AFT_RST_DATA { .ANY (unitialized_data_test)} <- Tag the new area.

  • After doing that the ZI_RET00 will start from the address 0x00080768 + SZ_AFT_RST_DATA and not from 0x00080768.

所以现在您知道将使用Unitialized_Data_Test标记的数据将从地址0x00080768驻留到地址0x00080768 + sz_aft_rst_data。由于您知道您可以转到SystemInit()函数并指示功能不归零0x00080768和0x00080768 + sz_aft_rst_data之间的内存。

//用零填充0x80000 - 0x83000

unsigned int * p_retmem =(无符号int *)0x80000;

for(i = 0xbff; i> = 0; I--)

{

if((p_retmem>(未签名int *)0x80768)&&(p_retmem <(unsigned int *)(0x80768 + 80)))

*(volatile unsigned *)p_retmem++;

别的

*(valaTile unsigned *)p_retmem ++ = 0;

}

谢谢,PM_DIALOG.

Jarirenejensen.
离线
最后一次露面:1 year 2 months ago
加入:2017-02-05 14:44
I need this feature too, in

I need this feature too, in order to do a silent reset in case the watch dog bites.

我正在使用SDK5,这与这种解释不完全兼容。
Can you reapply this guide to SDK5 please?

Jarirenejensen.
离线
最后一次露面:1 year 2 months ago
加入:2017-02-05 14:44
我已经调查了一点

我进一步调查了一点

如果我使用uint8_t silent_reset __attribute __((部分(“保留_mem_area_uninit”))))));(省略ZERO_INIT属性)我的变量“SILENT_RESET”最终在“执行区域RET_DATA”的开始时,它的类型数据不是零 - 如:
0x07FD4804 0x07FD4804 0x00000001数据RW
It does not survive a bite by the watch dog though.

如果我使用__Attribute __((部分(“保留_mem_area_uninit”))));一个人应该认为它最终在执行区域ret_data_uninit,但它最终在lr_irom3结束时 - 为什么??

PM_DIALOG.
离线
最后一次露面:4天17小时前
职员
加入:2018-02-08 11:03
嗨Jarirenejensen,

嗨Jarirenejensen,

keile的扇区是对齐的32个字节,因此应用程序所需的最大未初始化的保留数据(CFG_RET_DATA_UNINIT_SIZE定义在DA1458X_STACK_CONFIG.H标题文件中必须是4(4×8 = 32bytes)的倍数,更大或等于总和总数据。如果CFG_RET_DATA_UNINIT_SIZE在4中不是倍数,则KEIL将其截断为4的最小倍数,否则如果数据不能拟合,则将删除孔部分。请确保CFG_RET_DATA_UNINIT_SIZE为4的倍数。

谢谢,PM_DIALOG.

Jarirenejensen.
离线
最后一次露面:1 year 2 months ago
加入:2017-02-05 14:44
谢谢 - 这就是我

谢谢 - 这是我错过的有点。