完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
为了节省您一些浪费的时间,我已经摒弃了我想与您分享的奇怪的STVD行为。
我编译并运行了ADC应用程序(使用定时器和A / D)。我设法使用Cosmic和Raisonance工具集完成了这项工作。然后我制作了一份副本,并开始修改ADC应用程序。原始应用程序包含一个名为main.c的文件。由于一些奇怪的原因,STVD会编译每个文件,但后来决定无法访问main.c中的main函数,并创建自己的无限循环main.c文件,它将调用MAIN.C.不过,我的main.c将在项目中,但它的MAIN.C似乎是使用的那个。除非我编译原始应用程序ADC,否则STVD将始终拒绝使用我的main.c.当然,我的应用程序和原始ADC似乎都是IDENtiCAL。最后,为了解决看似STVD错误的问题,我不得不将main.c重命名为其他东西,例如mainFile.c,现在这个mainFile.c没有被STVD替换为空的main.c 其他人都有这种经历吗? 丹尼尔 以上来自于谷歌翻译 以下为原文 Just to save you some wasted time, I have discouvered a strange STVD behaviour I would like to share with you. I have compiled and run the ADC application (uses timer and A/D). I managed to do this using both the Cosmic, and Raisonance toolsets. I have then made a copy, and started to modify the ADC application. The original application contains a file called main.c. For some strange reason, STVD would compile each file, but then decide that the main function in main.c cannot be reached, and create its own infinite loop main.c file, which it would call MAIN.C. Straingely, my main.c would be in the project, but its MAIN.C would seem to be the one used. Unless I compile the original application ADC, STVD would always refuse to use my main.c. Of course, my application, and the original ADC seemed to be IDENTICAL. Finally, to fix what seems to be a STVD bug, I had to rename main.c to something else, say mainFile.c, and now this mainFile.c is NOT replaced by STVD with the empty main.c Anyone else has had this experience? Daniel |
|
相关推荐
2个回答
|
|
丹尼尔你好,
使用STVD创建工作空间/项目时,会在Cosmic(或Raisonance)目录中创建一个空的main.c文件。仅对于Cosmic,还会在同一位置创建stm8_interrupt_vector.c。关于STM8S-Discovery示例,这两个文件都已移至项目src目录(Project / ADC / src)。然后,您必须在STVD中指定此新位置。考虑Cosmic编译器,请遵循以下过程: Clic项目>设置...... Clic the''Linker''选项卡 将“类别”从“常规”更改为“输入” 检查''Vector File Name''是否指向与正确的main.c文件(.. .. src stm8_interrupt_vector.c)位于同一位置的stm8_interrupt_vector.c文件。如果没有,浏览它和clic OK。现在您的运行链接您的应用程序代码而不是该工具自动创建的main.c文件。 希望这有帮助 最好的祝福 以上来自于谷歌翻译 以下为原文 Hello Daniel, When you create a workspace/project with STVD, a empty main.c file is created in the Cosmic (or Raisonance) directory. For Cosmic only, the stm8_interrupt_vector.c is also created at this same location. Regarding STM8S-Discovery examples , both these files have been moved to the project src directory (Project/ADC/src). Then you have to specify this new location in STVD. Considering Cosmic compiler, follow the procedure : Clic Project>Settings... Clic the ''Linker'' tab Change ''Category'' from ''General'' to ''Input'' Check that ''Vector File Name'' point the stm8_interrupt_vector.c file which is at the same location as the right main.c file (....srcstm8_interrupt_vector.c) . if not, browse it and clic OK. Now your run link your application code instead of main.c file automatically created by the tool. Hope this help Best Regards |
|
|
|
你好Stefast,
谢谢您的回复。 我知道新工作区会导致创建默认的main.c,但是,我使用了这个示例,只是在同一个工作区中创建了一个新项目。我已将ADC项目中的文件复制到我的新项目中,并添加了更多我自己的代码。 STVD现在开始抱怨我的main函数中的第一行(位于main.c中,就像ADC的主要功能一样),无法访问,编辑器向我展示了默认的MAIN.C创建文件。奇怪的是,当我在工作区窗口中启用show file path时,我的main.c正被使用......无论如何,我注释掉了main.c中所有添加的指令,直到新项目因为相同(我认为... )作为ADC项目,但仍然,STVD不喜欢我的main.c.将main.c重命名为mainFile.c解决了这个问题;我已经添加了我的代码,事情似乎没问题...... 我已经开始使用Raisonance工具集而不是Cosmic,因为中断似乎不再被服务(在我的项目中);我会尝试看到你建议的矢量文件名选项;我不清楚Cosmic链接器如何知道哪个处理程序应链接到哪个中断向量,Raisonance代码至少有一些处理程序编号(不知道它是否与链接的方式相同)。 问候, 丹尼尔 丹尼尔 以上来自于谷歌翻译 以下为原文 Hello Stefast, Thank you for your reply. I understand that a new workspace results in the creation of a default main.c, however, I used the example and simply created a new project in the same workspace. I have copied the files from the ADC project, into my new project, and added more code of my own. STVD started now to complain about the first line in my main function (located in main.c, just as the main function of ADC was), being unreachable, and the editor showed me the default MAIN.C created file. Strangely, when I enabled show file path in the workspace window, my main.c was being used... Anyway, I commented out all my added instructions from main.c, until the new project because the same (I think...) as the ADC project, but still, STVD did not like my main.c. Renaming main.c to mainFile.c solved the problem; I have added back my code, and things seemed to be ok... I have started to use the Raisonance toolset rather than Cosmic, because interrupts did not seem to be serviced anymore (in my project); I will try to see that Vector File Name option you are suggesting; it was not clear to me how the Cosmic linker would know which handler should be linked to which interrupt vector, the Raisonance code at least has some numbering for handlers (don't know if that is the way it does the linking). Regards, Daniel Daniel |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2738 浏览 1 评论
3241 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1810 浏览 1 评论
3650 浏览 6 评论
6039 浏览 21 评论
1339浏览 4评论
201浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
353浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
444浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
274浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 06:37 , Processed in 1.176796 second(s), Total 79, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号