完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,
我正在尝试让我的SPC560C05L3进入待机模式,但它无法正常工作。我也尝试过其他模式,让控制器进入每个RUN模式都没问题,但其他模式不起作用。 我用这段代码: ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE)| SPC5_ME_MCTL_KEY; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE)| SPC5_ME_MCTL_KEY_INV; 如果(ME.GS.B.S_MTRANS){ Send_CAN_message(); } 但它不起作用。我也没有得到我的CAN消息,处理器只是继续运行其余的代码。我已经检查了我的唤醒,除了1之外所有唤醒都被禁用,并且那个没有激活的触发器并且根本没有触发。 我错过了让控制器进入待机模式的东西吗? 谢谢, 米切尔 #spc560-mcu #standby 以上来自于谷歌翻译 以下为原文 Hi everybody, I'm trying to get my SPC560C05L3 into Standby mode, but it's not working. I also tried other modes, and getting the controller into every RUN mode is no problem, but the other modes just don't work. I use this bit of code: ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE) | SPC5_ME_MCTL_KEY; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE) | SPC5_ME_MCTL_KEY_INV; if(ME.GS.B.S_MTRANS){ Send_CAN_message(); } but it's not working. I also don't get my CAN message and the processor just continues running the rest of the code. I already checked my wake-ups, and all wake-ups are disabled except 1, and that one doesn't have an active trigger and isn't triggered at all. Am I missing something to get the controller into standby mode? Thanks, Mitchel #spc560-mcu #standby |
|
相关推荐
9个回答
|
|
更新:我改变了一些设置,当我尝试进入STANDBY时,控制器冻结。使用调试器停止时,它显示它位于以下行:
0x000000E0:78 00 00 00 E_B _IVOR1(0x000000E0) 谁知道怎么会发生这种情况? 以上来自于谷歌翻译 以下为原文 Update: I changed some settings around, and when I try to go into STANDBY, the controller freezes. When stopping with the debugger, it shows that it is on the following line: 0x000000E0: 78 00 00 00 E_B _IVOR1 (0x000000E0) Anybody know how that can happen? |
|
|
|
你好Mitchel,
你能确认一下你的设备吗? 我认为您的CAN配置阻止进入低功耗模式(STANDBY) 当MCR [MDIS]位置位时,进入CAN的低功耗模式。 也许,您应该在进入STANDBY模式之前发送CAN消息。 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Mitchel , Could you confirm your device used ? I think that your CAN configuration is preventing to go in Low Power modes (STANDBY) This low power mode for CAN is entered when the MCR[MDIS] bit is asserted. Maybe , you should send a CAN Message before entering in STANDBY Mode. Best regards Erwan |
|
|
|
嗨二湾,
感谢您的回复。我正在使用SPC560C50L3。 我更新了我的代码,因为我虽然做了同样的事情。我现在有以下内容: WKUP.WISR.R = 0x200; //状态标志 ME.IS.R = 5; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE)| SPC5_ME_MCTL_KEY; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE)| SPC5_ME_MCTL_KEY_INV; 使用此代码,我可以看到调试器进入待机模式,但我仍然看到它转到我之前复制的行: 0x000000E0:78 00 00 00 E_B _IVOR1(0x000000E0) 所以我能想到的是它确实进入了待机状态,但随后冻结了该线路。让控制器再次工作的唯一方法是使用电源循环。 问候, 米切尔 以上来自于谷歌翻译 以下为原文 Hi Erwan, Thank you for reply. I'm using a SPC560C50L3. I updated my code because I though the same thing. I now have the following: WKUP.WISR.R = 0x200; // Status flag ME.IS.R = 5; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE) | SPC5_ME_MCTL_KEY; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE) | SPC5_ME_MCTL_KEY_INV; With this code, I can see with the debugger that it goes into standby mode, but I still see that it goes to the line I copied before: 0x000000E0: 78 00 00 00 E_B _IVOR1 (0x000000E0) So what I can figure is that it does go into standby, but then freezes on that line. The only way to get the controller working again is with a power cycle. Regards, Mitchel |
|
|
|
好的,另一个更新:
我添加了一个循环到交换机到备用(从SPC5演播室功能SetRunMode复制和修改)来检查模式转换是否正常。 WKUP.WISR.R = 0x200; //状态标志 ME.IS.R = 5; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE)| SPC5_ME_MCTL_KEY; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE)| SPC5_ME_MCTL_KEY_INV; for(;;){ uint32_t r = ME.IS.R; if((r& 1U)== 1U){ 打破; } if((r& 4U)== 4U){ 打破; } } 我现在得到以下结果: 目标模式是STANDBY(0xD)。 ME.GS表示正在进行转换。然而,就是这样。没有其他事情发生。我等了2分钟,但它似乎没有进入待机模式。我是否必须手动禁用所有外围设备?我虽然CPU会处理它。 谢谢, 米切尔 以上来自于谷歌翻译 以下为原文 Ok, another update: I added a loop to the switch to standby (copied and modified from the SPC5 studio function SetRunMode) to check if the mode transition is ok. WKUP.WISR.R = 0x200; // Status flag ME.IS.R = 5; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE) | SPC5_ME_MCTL_KEY; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE) | SPC5_ME_MCTL_KEY_INV; for ( ; ; ) { uint32_t r = ME.IS.R; if ((r & 1U) == 1U) { break; } if ((r & 4U) == 4U) { break; } } I now get the following results: The target mode is STANDBY (0xD). ME.GS is indicating a transition is in progress. However, that's it. Nothing else happens. I waited 2 minutes, but it doesn't seem to go into standby mode. Do I have to disable all peripherals manually? I though that the CPU would handle that. Thanks, Mitchel |
|
|
|
另一个更新。
我让控制器进入低功耗模式(无法检查它是否处于待机状态,但是调试器说''目标已经进入STOP状态',所以至少有一些东西。但是,现在出现了下一个问题:将其解决。 我有一个唤醒事件设置: void setup_wakeup_trigger(void){ WKUP.WIPUER.R = 0xFFDFF; //除了使用的焊盘外,启用所有内部上拉(外部下拉) WKUP.WIREER.R = 0x200; //上升沿启用 WKUP.WISR.B.EIF = 0x200; //状态标志 WKUP.WIFER.B.IFE = 0x200; //过滤 WKUP.WRER.R = 0x200; //启用唤醒功能 } 但是,当我翻转此打击垫上的开关(PB [10])时,没有任何反应。有人有什么想法吗? 以上来自于谷歌翻译 以下为原文 And another update. I get the controller into low power mode (can't check if it's standby, but the debugger says ''Target has entered STOP state'', so at least something. However, now comes the next problem: getting it out. I have a wake-up event setup: void setup_wakeup_trigger(void){ WKUP.WIPUER.R = 0xFFDFF; // enable all internal pull-up except the pad used (external pull-down) WKUP.WIREER.R = 0x200; // Rising edge enable WKUP.WISR.B.EIF = 0x200; // Status flag WKUP.WIFER.B.IFE = 0x200; // Filter WKUP.WRER.R = 0x200; // Enable wakeup } However, when I flip the switch on this pad (PB[10]), nothing happens. Anybody any ideas? |
|
|
|
另一个更新(今天取得了很大的进步:))
我现在正处于可以将控制器置于STANDBY并将其唤醒的位置。但是,唤醒它时,启动无法正常工作。它不会运行我的代码,只是在禁用和启用全局中断之间跳过。我也试过从SRAM启动,但这并没有改变任何东西。 据我了解,退出STANDBY应该等于重置权?或者这个假设不正确? 以上来自于谷歌翻译 以下为原文 And another update (made great progress today :)) I'm now at the point where I can get the controller in STANDBY and wake it up. However, when waking it up, the boot doesn't work correctly. It doesn't run through my code, it just skips between disabling and enabling global interrupts. I also tried boot from SRAM, but that doesn't change anything. As far as I understand, comming out of STANDBY should be equal to a reset right? Or it that assumption incorrect? |
|
|
|
你好Mitchel,
你进步的好消息;-) , 这些文件中有一些有趣的东西: http://www.st.com/content/ccc/resource/technical/document/application_note/4d/3b/ac/a3/d4/c0/46/16/DM00074056.pdf/files/DM00074056.pdf/jcr:内容/翻译/ en.DM00074056.pdf 从STANDBY出去后 这就像破坏性的重置。 你应该检查你的州。 STANDBY ==> DRUN ==> RUN0 你能检查一下你的RGM_STANDBY吗? 从备份RAM指示灯启动 - 此位指示系统是否将从备份启动 RAM或闪存退出STANDBY退出。 0在STANDBY出口处从闪光灯启动 1从STANDBY出口的备份RAM启动 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Mitchel, Good News for your progress ;-) , There is some interesting things in these document : http://www.st.com/content/ccc/resource/technical/document/application_note/4d/3b/ac/a3/d4/c0/46/16/DM00074056.pdf/files/DM00074056.pdf/jcr:content/translations/en.DM00074056.pdf After go out from STANDBY It is like a destructive reset. You should check your state. STANDBY ==> DRUN ==> RUN0 Could you check your RGM_STANDBY ? Boot from Backup RAM indicator — This bit indicates whether the system will boot from backup RAM or flash out of STANDBY exit. 0 Boot from flash on STANDBY exit 1 Boot from backup RAM on STANDBY exit Best Regards Erwan |
|
|
|
嗨二湾,
谢谢你的文件。我来看看是吧。 至于RGM_STDBY:0x0000。 我也试过从备份ram = 1启动,但这并没有改变任何东西。我进入了与从flash启动相同的循环。 至于状态,我的调试器不够快。最小刷新时间是500ms,然后我只看到从STANDBY到RUN0的变化,所以不能检查除了DRUN之间的内容 问候, 米切尔 以上来自于谷歌翻译 以下为原文 Hi Erwan, Thanks for the document. I'll take a look at is. As for RGM_STDBY: 0x0000. I also tried booting from backup ram = 1, but that didn't change anything. I got into the same loop as booting from flash. As for the state, my debugger isn't fast enough. Minimum refresh time is 500ms, and then I only see the change from STANDBY to RUN0, so can't check what's in between besides DRUN Regards, Mitchel |
|
|
|
嗨二湾,
我仍然没有应用程序工作,但我确实发现了一些奇怪的东西。 我将备用转换代码更新为以下内容: RGM.STDBY.B.BOOT_FROM_BKP_RAM = 0; WKUP.WISR.R = 0xFFFFFFFF; //状态标志 ME.IS.R = 5; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE)| SPC5_ME_MCTL_KEY; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE)| SPC5_ME_MCTL_KEY_INV; for(;;){ } 去STANDBY后我真的不在乎它做了什么,所以我把它放在一个不定式循环中。在转到STANDBY之后,调试器说''Target已进入STOP状态''就像之前和创建唤醒触发时一样,它说''Target已经离开STOP状态'并且没有正常继续。到目前为止没什么新鲜事。 但是,当我停止调试器以查看它运行的代码中的位置时,它仍然处于不定式for循环中。好像我的SPC560没有重置。怎么可能? 谢谢, 米切尔 以上来自于谷歌翻译 以下为原文 Hi Erwan, I still don't have the application working, but I did found something weird. I updated my standby transition code to the following: RGM.STDBY.B.BOOT_FROM_BKP_RAM = 0; WKUP.WISR.R = 0xFFFFFFFF; // Status flag ME.IS.R = 5; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE) | SPC5_ME_MCTL_KEY; ME.MCTL.R = SPC5_ME_MCTL_MODE(STANDBY_MODE) | SPC5_ME_MCTL_KEY_INV; for ( ; ; ) { } I don't really care what it does after going to STANDBY, so I just put it in an infinitive loop. After going to STANDBY, the debugger says ''Target has entered STOP state'' like before and when creating the wake up trigger, it says ''Target has left STOP state'' and doesn't continue properly. Nothing new so far. However, when I stop the debugger to see where in the code it is running, it's still in the infinitive for loop. It seems like my SPC560 isn't resetting. How is that possible? Thanks, Mitchel |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2375 浏览 1 评论
3111 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1678 浏览 1 评论
3497 浏览 6 评论
5848 浏览 21 评论
837浏览 4评论
1212浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
479浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1191浏览 3评论
1244浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-9-10 23:03 , Processed in 1.359602 second(s), Total 93, Slave 76 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191