完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
你好,Erwan,
我猜spcstudio编译器有问题。 我的项目有3个部分: 1.初始化CAN-LIN-Serial-ADC-PWM-timer等模块 2.阅读eeprom 3.Main Loop 50例同时(1) 在一个开关中,当我检查一些数据时,MCU进入睡眠模式, 有时MCU会正常进入睡眠状态但有时MCU没有正常进入睡眠状态我觉得编译器在这个问题上遇到了一些问题,因为当我编译代码时,某些进入行之间或某些条件发生在代码中程序正常工作所有时间,但如果我添加新代码或代码中发生一些变化,MCU无法正常进入睡眠状态。 我用这个函数给你发送: __attribute __((section(''。codeinram'')))void gotoStandbyMode(void) { WKUP.WISR.R = 0x00040000; //清除中断标志 if((ME.GS.B.S_CURRENTMODE&lt; SPC5_RUNMODE_RUN3)||(ME.GS.B.S_CURRENTMODE&gt; SPC5_RUNMODE_RUN0)) { if(OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_STANDBY))// { SPC5_CLOCK_FAILURE_HOOK(); } } } __attribute __((section(''。codeinram'')))void gotoRunMode(void) { if(OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_DRUN)) { SPC5_CLOCK_FAILURE_HOOK(); } } 我用我发送的样本更改了application.ld。 您在这方面的最早帮助将受到高度赞赏。提前致谢。 最好的祝福, Nazerian Vanima 以上来自于谷歌翻译 以下为原文 Hello Erwan, I have a problem with spcstudio compiler i guess. my project have 3 section : 1.initialize modules like CAN-LIN-Serial-ADC-PWM-Timer 2.Read From eeprom 3.Main Loop with 50 cases in while(1) in one switches when i check some data the MCU goes to sleep mode , some times the MCU go to sleep correctly but some times the MCU not go to sleep correctly i think the compiler have some problems with this issue because when i compile the code with some enters between lines or some condition happen in code the program work correctly all time but if i add new code or some changes happen in code the MCU not correctly go to sleep. I use this functions u send for me : __attribute__ ((section (''.codeinram''))) void gotoStandbyMode(void) { WKUP.WISR.R = 0x00040000; //Clear interrupt flag if ((ME.GS.B.S_CURRENTMODE < SPC5_RUNMODE_RUN3)|| (ME.GS.B.S_CURRENTMODE > SPC5_RUNMODE_RUN0)) { if (OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_STANDBY))// { SPC5_CLOCK_FAILURE_HOOK(); } } } __attribute__ ((section (''.codeinram''))) void gotoRunMode(void) { if (OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_DRUN)) { SPC5_CLOCK_FAILURE_HOOK(); } } i change the application.ld with the sample u send for me . Your earliest help in this regard will be highly appreciated. Thanks in advance. Best Regards, Nazerian Vanima |
|
相关推荐
2个回答
|
|
|
你好Vanima,
你能否确认你使用的编译器? (hightec,freegcc或GHS) 你是SPC5studio 4.1.0吗? 最好的祝福 二万 以上来自于谷歌翻译 以下为原文 Hello Vanima , Could you confirm your compiler used (hightec, freegcc or GHS) Are you on SPC5studio 4.1.0 ? Best regards Erwan |
|
|
|
|
|
嗨二万
感谢您的快速回复 我发现问题不在于编译器,LINFLEX驱动程序会导致MCU无法进入睡眠模式。 我解决了这个问题。 非常感谢 。 最好的祝福 Nazerian Vanima 以上来自于谷歌翻译 以下为原文 Hi Erwan Thanks for your fast response I found The problem it is not for compiler , the LINFLEX Driver cause the MCU not go to sleep mode . I solve this problem . Thanks so much . Best Regards Nazerian Vanima |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1464 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1517 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3662 浏览 1 评论
3855 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2474 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
741浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
673浏览 5评论
720浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
959浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
760浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-8 11:03 , Processed in 0.651451 second(s), Total 45, Slave 38 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1280