完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我正在使用SPC560D MCU的待机模式。数据表提到了使用DRUN或软件复位退出此模式。你能解释一下吗, 1.如何配置DRUN模式?我尝试使用API'halSPCSetRunMode'来切换模式。但是,当用于DRUN模式时,它不会正确退出待机模式,需要重置电源。这件事有什么不足之处吗? 2. SPC560D使用软件复位的方法有哪些?我可以将看门狗复位用作软件复位吗?有没有其他软件重置方法? 在此先感谢您的帮助。 麦克风。 以上来自于谷歌翻译 以下为原文 Hello, I am using standby mode for SPC560D MCU. The datasheet mentions about using DRUN or software reset for exiting this mode. Can you please explain on, 1. How to configure the DRUN mode? I tried using API 'halSPCSetRunMode' for switching between modes. But when used for DRUN mode, it does not exit the standby mode correctly and a power reset is required. Is any thing missing for this? 2. Which are the ways to use software reset for SPC560D? Can I use watchdog reset as a software reset? Is there any other means for software reset? Thanks in advance for any help. Mike. |
|
相关推荐
60个回答
|
|
你好Erwan
非常感谢你对我这个问题的帮助。 我在我的应用程序中测试代码对我来说没关系,但是当从RAM唤醒时有一些RESET问题。 是否存在任何保存闪存地址的方法以及从ram中跳转到此地址的时间? 最好的祝福 Nazerian Vanima 以上来自于谷歌翻译 以下为原文 Hello Erwan Thanks so much for your help in this issue to me. I test the code in my application it ok for me but have some RESET issue when wakeup from RAM . is exist any way to save the flash address and when wakeup from ram jump to this address? Best Regards Nazerian Vanima |
|
|
|
你好Vanima,
你能不能把你的完整应用程序发给我main.c文件? 如果有一些公司限制代码,您可以通过电子邮件直接发送 无论如何,你可以将代码halSPCSetRunMode重新定位在RAM中吗? 如下: 有一件重要的事情。 如果WAKEUP事件处于待处理状态,则无法进入睡眠模式(STANDBY)。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Vanima , Could you send me your full application not only the main.c file ? if there is some company restricted code you can send directly by email anyway could you relocate the code halSPCSetRunMode in RAM ? like below :
there is an important thing. if a WAKEUP Event is pending, you can not enter in Sleep Mode (STANDBY). Best Regards Erwan |
|
|
|
嗨二万
抱歉我迟到了。 我测试了这段代码,但是在产生唤醒信号时MCU被复位。 我将此模式永久用于我的项目我应该在Virtual eeprom中保存我的参数状态。 我不知道这种模式会发生什么。 我发送给我的测试项目这个项目对我的真实项目有相同的反应。谢谢你的关注。 最好的祝福 Nazerian Vanima 以上来自于谷歌翻译 以下为原文 Hi Erwan Sorry For my late answer. I test this code but MCU is reset when the wakeup signal is generated. I use this mode permanently for my project i should save my parameters status in Virtual eeprom. i don't know what happen for this mode. i send my test project for you this project have the same response on my real project.thanks so much For your kind attention Erwan. Best Regards Nazerian Vanima |
|
|
|
嗨二万
我发送了一封关于此问题的电子邮件。 这是待机模式进入和退出的示例。 最好的祝福 Nazerian Vanima 以上来自于谷歌翻译 以下为原文 Hi Erwan I send You an email for this issue . this is an example for standby mode enter and exit . Best Regards Nazerian Vanima |
|
|
|
嗨社区
唤醒后我的复位有些麻烦。我尝试从Standby进入Run。在此模式转换期间,微控制器进行复位,SRAM中的数据丢失。函数存储在.codeinram部分,BKUPRAM FLAG的Boot激活。 这有解决方案吗? 亲切的问候 菲利普 以上来自于谷歌翻译 以下为原文 Hi Community I have some trouble with the reset after wakeup. I try to enter Run from Standby. During this mode transition, the microcontroller gets a reset and the data in the SRAM are lost. Functions were stored in the .codeinram section and the Boot from BKUPRAM FLAG is active. Is there a solution for this? kind regards Philipp |
|
|
|
你好Philipp,
你使用过PLS Debugger吗? 在我们的配置中,默认情况下,硬件重置模式已设置。 你可以禁用这种模式并重新测试吗? (参见UDE目录中的cfg文件) 使用硬件重置模式 启用此选项时,将禁用通过调试器将启动程序计数器设置为已加载程序的起始符号的常规机制。有两种模式可供选择: (使用SPC57补丁的PLS 4.02+中无法选择2种模式) 模拟启动代码:在闪存中搜索有效的复位配置半字(RCHW)。如果找到有效字,则从正确读取地址并将其用作起始地址。该行为类似于上电复位期间的BAM流程。 执行启动代码:如果有可用的启动代码,则将PC设置为启动代码的入口点 如果调试了程序,其中一个额外的加载程序已经闪存到目标中,则此选项特别有用。如果在未连接调试器时应用程序正确启动,则还需要检查该选项。 请注意,如果未正确配置目标处理器,例如没有启动代码或错误的启动代码,使用硬件重置模式可能导致不可预测的行为。 用SPS加载Ram问题将在SPC5Studio 4.0中解决。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Philipp , Did you use PLS Debugger ? In our configuration , by Default , Hardware Reset Mode is set. could you disable this mode please and retest ? (cf cfg file in UDE directory) Use Hardware Reset Mode When this option is enabled the normal mechanism setting the startup program counter to the start symbol of the loaded program by the debugger is disabled. There are two modes selectable: (the 2 modes are not selectable in PLS 4.02+ with SPC57 patches) • Simulate boot code: The flash is searched for a valid reset configuration halfword (RCHW). If a valid word is found, the address is read from the correct and used as the start address. The behavior is similar to the BAM flow during power on reset. • Execute boot code: The PC is set to the entry point of the bootcode if there is boot code available This option is especially helpful if programs are debugged where an additional loader program is already flashed into the target. That option is also needful to check, if the application starts correctly when the debugger is not connected. Be aware that if the target processor is not correctly configured, e.g. there is no boot code or buggy bootcode, using the Hardware Reset Mode can result in unpredictable behavior. Load in Ram issue with PLS will be solved in SPC5Studio 4.0. Best Regards Erwan |
|
|
|
嗨二万
谢谢你的快速回复。是的我正在使用PLS集成调试器,它是在船上提供的。 硬件重置模式已被取消选择,但我使用的是4.04 PLS UDE,因此无法选择模式。 我在我的应用程序中做了一些更改。从BKUP启动Ram已禁用。我需要在SRAM中应用一些数据,这些数据在唤醒后仍然有效。 (从BKUP RAM启动不是必需的,这与我不一致) 新行为是以前的行为。微控制器进入STANDBY状态,如果按下SW2,它就会唤醒。在唤醒过程中,微控制器得到复位。 SRAM中存储的数据通过此复位而损坏。与之前的行为的不同之处在于,在使用PLS进行调试期间不会发生重置。只有在UDE平台关闭且应用程序在没有调试器的情况下运行时才会发生。 在读者进入STANDBY之前,还有另一种存储数据的解决方案吗? (数据闪存没有足够的写周期。配置/时序必须存储在非常切换到待机状态)。 二手硬件:SPC560D Discovery Board 亲切的问候 菲利普 以上来自于谷歌翻译 以下为原文 Hi Erwan Thank you for your fast reply. Yes I’m using the PLS integrated Debugger, which is delivered on board. The Hardware Reset Mode is already deselected, but I’m using 4.04 PLS UDE so have no selectable modes. I did some changes in my application. Boot from BKUP Ram is disabled. I need for my application some data in the SRAM, which should be still valid after wake up. (Boot from BKUP RAM is not necessary, it was a disaccord from me) The new behavior is the behavior before. The microcontroller goes into STANDBY and if the SW2 is pressed it wakes up. During the wakeup process the microcontroller get a reset. The stored data in the SRAM corrupt through this reset. The difference to the behavior before is that the reset doesn’t occur during debugging with PLS. It only occurs if the UDE platform is closed and application is running without the debugger. Is there another solution to store data before the reader goes into STANDBY? (Data Flash has not enough write cycles. The configuration/timings must be stored on very switch into standby). Used Hardware: SPC560D Discovery Board kind regards Philipp |
|
|
|
你好菲利普,
请使用PLS 4.02,此版本更稳定 根据RM,(D Bolero) 第一个8K SRAM仍然可以开启。 ''在此模式下仍然供电的设备的唯一部分是打击垫 映射在唤醒线和电源域#0上,其中包含MC_RGM,MC_PCU, WKPU ,, RTC_API,SIRC,FIRC以及设备和用户选项位。'' 警告,在STANDBY条目之后,调试器由于而失去与目标的连接 电源门控。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Philip, Please use PLS 4.02, this version is more stable According to the RM, (D Bolero) the first 8K SRAM could be still ON. ''The only parts of the device that are still powered during this mode are pads mapped on wakeup lines and power domain #0 which contains the MC_RGM, MC_PCU, WKPU, , RTC_API, SIRC, FIRC, and device and user option bits.'' Warning , after STANDBY entry, the debugger loses connection to the target due to power gating. Best regards Erwan |
|
|
|
菲利普,
完整答案在[DEAD LINK /public/ste2ecommunities/mcu/Lists/SPC56/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/SPC56/Using%20SRAM&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000C7B65FFB6DB42540A4DAECE852348058&TopicsView=https://my。 st.com/public/STe2ecommunities/mcu/Lists/SPC56/AllItems.aspx¤tviews=49]https://my.st.com/public/STe2ecommunities/mcu/Lists/SPC56/Flat.aspx?RootFolder=%2fpublic %2fSTe2ecommunities%2fmcu%2fLists%2fSPC56%2fUsing%20SRAM&安培; FolderCTID = 0x01200200770978C69A1141439FE559EB459D758000C7B65FFB6DB42540A4DAECE852348058&安培; TopicsView = HTTPS%3A%2F%2Fmy.st.com%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSPC56%2FAllItems.aspx&安培; currentviews = 49 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Philipp , Full answer in [DEAD LINK /public/STe2ecommunities/mcu/Lists/SPC56/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/SPC56/Using%20SRAM&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000C7B65FFB6DB42540A4DAECE852348058&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/SPC56/AllItems.aspx¤tviews=49]https://my.st.com/public/STe2ecommunities/mcu/Lists/SPC56/Flat.aspx?RootFolder=%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fSPC56%2fUsing%20SRAM&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000C7B65FFB6DB42540A4DAECE852348058&TopicsView=https%3A%2F%2Fmy.st.com%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSPC56%2FAllItems.aspx¤tviews=49 Best regards Erwan |
|
|
|
嗨二湾,
谢谢您的回复。我希望SRAM Testapplication将包含在下一个SPC5 Studio Release中。 唤醒阶段的重置问题对我来说无法解释。我发现唤醒后软件看门狗复位标志(RGM.DES.B.F_SWT)处于活动状态。有些时候复位标志是外部复位和唤醒后SWT_Reset或仅SWT复位。 有没有人解释这种奇怪的行为? 一些信息: GotoStandby: WKUP。 WISR 。 [R = 0x00000008; //清除中断标志 ((我。 GS 。 乙 。 S_CURRENTMODE &LT; SPC5_RUNMODE_RUN3 )|| (我。 GS 。 乙 。 S_CURRENTMODE &GT; SPC5_RUNMODE_RUN0 )){ 我。 IS 。 [R = 5; //清除状态寄存器位I_IMODE(4)和I_IMTC(1)。 / *启动转换过程。* / 我。 MCTL 。 [R = SPC5_ME_MCTL_MODE( SPC5_RUNMODE_STANDBY )| SPC5_ME_MCTL_KEY; 我。 MCTL 。 [R = SPC5_ME_MCTL_MODE( SPC5_RUNMODE_STANDBY )| SPC5_ME_MCTL_KEY_INV; / *等待模式切换或错误状态。* / (TRUE){ uint32_t r = ME。 IS 。 [R ; (r&amp; 1) ; (r&amp; 4) ; } GotoRun: OSAL_IRQ_HANDLER(){ uint32_t wisr; OSAL_IRQ_PROLOGUE(); wisr = WKUP。 WISR 。 [R ; WKUP。 WISR 。 [R = wisr; 我。 IS 。 [R = 5; 我。 MCTL 。 [R = SPC5_ME_MCTL_MODE( SPC5_RUNMODE_DRUN )| SPC5_ME_MCTL_KEY; 我。 MCTL 。 [R = SPC5_ME_MCTL_MODE( SPC5_RUNMODE_DRUN )| SPC5_ME_MCTL_KEY_INV; (TRUE){ uint32_t r = ME。 IS 。 [R ; (r&amp; 1) ; (r&amp; 4) ; } OSAL_IRQ_EPILOGUE(); } 我用调试器测试了它,没有调试器。所以有相同的行为。 亲切的问候 菲利普 以上来自于谷歌翻译 以下为原文 Hi Erwan, Thank you for your reply. I hope the SRAM Testapplication will included in the next SPC5 Studio Release. The reset behvoir during the wakeup phase is not explainable for me. I figured out that the Software Watchdog Reset Flag (RGM.DES.B.F_SWT) is active after Wakeup. Some time the Reset Flags are External Reset and SWT_Reset after wakeup or only SWT reset. Has anyone an explanation for this strange behavior? Some Information: GotoStandby: WKUP. WISR . R = 0x00000008; //Clear interrupt flag ((ME. GS . B . S_CURRENTMODE < SPC5_RUNMODE_RUN3 ) || (ME. GS . B . S_CURRENTMODE > SPC5_RUNMODE_RUN0 )) { ME. IS . R = 5; // Clearing status register bits I_IMODE(4) and I_IMTC(1). /* Starts a transition process.*/ ME. MCTL . R = SPC5_ME_MCTL_MODE( SPC5_RUNMODE_STANDBY ) | SPC5_ME_MCTL_KEY; ME. MCTL . R = SPC5_ME_MCTL_MODE( SPC5_RUNMODE_STANDBY ) | SPC5_ME_MCTL_KEY_INV; /* Waits for the mode switch or an error condition.*/ (TRUE) { uint32_t r = ME. IS . R ; (r & 1) ; (r & 4) ; } GotoRun: OSAL_IRQ_HANDLER() { uint32_t wisr; OSAL_IRQ_PROLOGUE(); wisr = WKUP. WISR . R ; WKUP. WISR . R = wisr; ME. IS . R = 5; ME. MCTL . R = SPC5_ME_MCTL_MODE( SPC5_RUNMODE_DRUN ) | SPC5_ME_MCTL_KEY; ME. MCTL . R = SPC5_ME_MCTL_MODE( SPC5_RUNMODE_DRUN ) | SPC5_ME_MCTL_KEY_INV; (TRUE) { uint32_t r = ME. IS . R ; (r & 1) ; (r & 4) ; } OSAL_IRQ_EPILOGUE(); } I tested it with the debugger and without the debugger. So there is the same behavior. kind regards Philipp |
|
|
|
你好Philipp,
下一个版本4.0将不包含SRAM STANDBY应用程序。 (进行中) 首先,我们需要实现一个小的更改请求,以允许开发人员创建自己的链接器文件。 (* .LD) 也许是4.1。 因为在每一代application.ld被覆盖之后。 无论如何,在我的应用程序中,当按下按钮SW2时,我可以看到“核心不活动” 我将检查看门狗复位标志(RGM.DES.B.F_SWT)。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Philipp , the next release 4.0 will not contain the SRAM STANDBY Application. (in progress) First, we need to implement for a small change request to permit to the developer to create his own linker file. (*.ld) maybe for 4.1. because after each generation application.ld is overwritten. anyway , in my application, i can see the ''core inactive'' when i push the button SW2 i will check the Watchdog Reset Flag (RGM.DES.B.F_SWT). Best Regards Erwan |
|
|
|
嗨二湾,
谢谢您的回复。我通过禁用看门狗做错了。现在我正确地禁用了看门狗,我有另一种行为。 如果禁用看门狗,则微控制器将无法正确唤醒。我发现阻挡部分是 SPC5_CLOCK_FAILURE_HOOK ()hal_lld_init()函数中的宏。看起来,从DRUN到RUN0的过渡很糟糕。 我认为这是看门狗复位的原因。有什么想法,为什么这种转换失败了。 前置初始化代码: (ME.GS.B.S_CURRENTMODE == SPC5_RUNMODE_DRUN){ 并发布代码 } 亲切的问候 菲利普 以上来自于谷歌翻译 以下为原文 Hi Erwan, Thank you for your reply. I did a mistake by disabling the Watchdog. Now I disabled the watchdog correctly and I had another behavior. If the Watchdog is disabled, the microcontroller, will not wake up correctly. I figured out that the blocking part is the SPC5_CLOCK_FAILURE_HOOK () Macro in the hal_lld_init() function. It look like, that the transition from DRUN to RUN0 failes. I think that’s the reason for the watchdog reset.Have you any idea, why this transition fails. Preclock initialization Code: (ME.GS.B.S_CURRENTMODE == SPC5_RUNMODE_DRUN) { And Post code } kind regards Philipp |
|
|
|
你好Philipp,
在我的例子中,我没有问题,并且没有设置F_SWT。 (仍为0) 在STANDBY ==&gt;之后DRUN ==&gt; RUN0 你能把你的申请寄给我吗? 更新PreClock Init代码后, 我处于DRUN状态。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Philipp , In my example, i have no problem and F_SWT is not set. (still 0) after STANDBY ==> DRUN ==> RUN0 Could you send me your application ? After updating the PreClock Init code , i am in DRUN state. Best regards Erwan |
|
|
|
嗨二万
我向您发送应用程序并不容易,但我将构建一个演示应用程序来重现此问题。 您是否从spc_clock_init中删除了重置标志初始化? // RGM.FES.R = 0xFFFF; // RGM.DES.R = 0xFFFF; 否则,看门狗复位标志始终为零。 谢谢您的回复。 亲切的问候菲律宾 以上来自于谷歌翻译 以下为原文 Hi Erwan It is not easy for me to send you the application, but I will build a demo application to reproduce this issue. Have you removed the reset flag initialization from spc_clock_init? // RGM.FES.R = 0xFFFF; // RGM.DES.R = 0xFFFF; Otherwise the Watchdog reset flag is always zero. Thank you for your reply. kind regardsPhilipp |
|
|
|
嗨二万
您可以在附件中找到看门狗问题的演示应用程序。 请将PA11与PA2连接。 SW2按钮生成唤醒事件。 亲切的问候 菲利普 以上来自于谷歌翻译 以下为原文 Hi Erwan You find can the demo application for the watchdog issue in the attachment. Please connect PA11 with PA2. The SW2 button generates the Wakeup event. kind regards Philipp |
|
|
|
菲利普你好,
当系统在STANDBY Exit上从闪存引导时,问题就会发生。 也许,待机退出后闪光灯还没准备好 我建议你从STANDBY Exit的BAckup RAM启动。 2优点: 1)降低功耗 2)更快的启动时间原因。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Phillip , when the system boots from flash on STANDBY Exit , the issue can happen. Maybe , the flash is not ready after the standby exit i recommend you to boot from BAckup RAM on STANDBY Exit. 2 Advantages : 1) Lower Power Consumption 2) Faster startup time Reason.
Best Regards Erwan |
|
|
|
嗨二万
谢谢你的快速修复。它在我的应用程序中运行良好。 微控制器在唤醒期间仍会产生外部复位。仅当JTAG调试器关闭且发现板作为独立运行时才会出现此问题,您还可以看到复位引脚设置为低电平且红色LED指示灯很快亮起。只有没有调试器才会发生这种情况。 你有解决这种行为的方法吗? 亲切的问候 菲利普 以上来自于谷歌翻译 以下为原文 Hi Erwan Thank you for your fast fix. It works very well in my application. The microcontroller still generates an external reset during wakeup. This behavior occurs only if the JTAG Debugger is closed and the discovery board run as standalone, You can also see that the reset pin is set to low and the red led lights up very shortly. This occurs only without the debugger. Have you also solution for this behavior? kind regards Philipp |
|
|
|
你好Philipp,
为红色领导D2。它似乎与重置模式有关。 我查过了文档。我不知道如何禁用它。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Philipp , for the red led D2. It seems to be linked to the reset mode. I have checked the documentation. I do not know how to disable it. Best Regards Erwan |
|
|
|
嗨二万
谢谢您的回复。 在我看来这是一种奇怪的行为,因为当我使用调试器运行应用程序时,不会发生外部重置事件,并且LED也不会闪烁。 我在勘误表中搜索过,但没有发现这种行为。 如果您有任何想法解决此问题,请告诉我。 亲切的问候 菲利普 以上来自于谷歌翻译 以下为原文 Hi Erwan Thank you for your reply. In my opinion it is a strange behavior, because when I am running the application with the debugger the external reset event doesn't occur and also the LED is not blinking. I searched in the errata sheet, but found nothing about this behavior. Please let me know, if you have any idea to fix this issue. kind regards Philipp |
|
|
|
嗨二湾,
几天后暂停,我找到了解决这个重置问题的方法。似乎CheckStop Reset链接到RESET引脚。没有人会相信它,有注册它。如果注册 RGM。 FBRE 。 乙 。 BE_CHKSTOP 设置为1我与调试器具有相同的行为,没有调试器。因此,将正确设置所有复位标志。感谢您的支持。 亲切的问候 菲利普 以上来自于谷歌翻译 以下为原文 Hi Erwan, After some days pause, I found a solution for this reset issue. It seem s like that the CheckStop Reset is linked to the RESET Pin. And nobody will believe it, there is register for it. If the Register RGM. FBRE . B . BE_CHKSTOP is set to 1 I have the same behavior with the debugger and without the debugger. Therefore all reset flags will be set correctly. Thank you for your support. kind regards Philipp |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2644 浏览 1 评论
3209 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1784 浏览 1 评论
3613 浏览 6 评论
5990 浏览 21 评论
940浏览 4评论
1317浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
585浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1304浏览 3评论
1362浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-26 03:16 , Processed in 1.687008 second(s), Total 117, Slave 98 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号