完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,
我目前正在使用STM8S003K3,我正在尝试编写一个引导加载程序函数,它将逐行读取S-Record并将包含的数据写入Flash。我已经看到通常的做法是将引导加载程序功能存储在UBC中以提供保护,但是,我目前正在进行原型设计并且还不需要这种级别的保护。我将引导加载程序功能存储在标准程序存储器中区域,其位置由Cosmic Compiler和Linker确定。我正在使用可移动代码部分下指定的链接器命令,我可以从地图文件中看到它正常工作。 我正在努力解决两个主要问题: 1.第一个问题是尝试使用Cosmic在机器库中提供的_fctcpy()函数。每当我调用函数将我的引导加载程序复制到RAM空间时,SWIM调试器就会遇到Comm timeout。 2.每当我通过UART刷新MCU并与设备通信时,设备在调用该功能时会重置。 我遇到的问题是我尝试使用的方法的副产品(即_fctcpy()函数按照引导加载程序函数驻留在UBC中的方式运行,因此在执行副本之前对选项字节执行必要的检查功能?)。 任何帮助将不胜感激。 谢谢, 亚伦 #stm8-uart-bootloader#stm8-debug-problem#stm8#usart-bootloader #cosmic-compiler 以上来自于谷歌翻译 以下为原文 Hi, I am currently working with the STM8S003K3 and I am attempting to write a bootloader function which will take an S-Record line by line and write the contained data to Flash. I have seen that is common practice to store the bootloader function in the UBC to provide it protection, however, I am currently prototyping and don't require this level of protection just yet.I am instead storing the bootloader function in the standard program memory area, the location of which is determined by the Cosmic Compiler and Linker. I am utilising the linker command specified under the moveable code section and I can see that this is working correctly from the map file. There are two main issues which I am struggling with: 1. The first issue is in attempting to use the _fctcpy() function provided in the machine library by Cosmic. Whenever I call the function to copy my bootloader to the RAM space the SWIM Debugger experiences a Comm Timeout. 2. Whenever I flash the MCU and communicate with the device via the UART the device resets upon calling the function. Are the problems I am experiencing a by-product of the method I am trying to use (i.e the _fctcpy() function operates as thought the bootloader function resides in the UBC and so performs the necessary checks on the option bytes prior to executing the copy function?). Any help would be greatly appreciated. Thanks, Aaron #stm8-uart-bootloader #stm8-debug-problem #stm8 #usart-bootloader #cosmic-compiler |
|
相关推荐
2个回答
|
|
你好,
根据你所写的内容,看起来fctcpy()函数没有正确执行(顺便说一下,它只是复制内存区而不检查任何选项字节)。也许你可以一步一步地执行它,看看有什么问题? 如果您无法快速解决,请将地图文件和链接器文件发送给我们( 邮寄地址:support.stm8.free@cosmic.fr )我们会看到这是否足以理解问题所在。 问候, 卢卡(宇宙) 以上来自于谷歌翻译 以下为原文 Hello, from what you write it looks like the fctcpy() function does not execute correctly (by the way it just copies the memory area without checking any option byte). Maybe you can execute it step by step and see what is wrong? If you can't work it out quickly send us the map file and the linker file ( mailto:support.stm8.free@cosmic.fr ) and we'll see if that's enough to understand where the problem is. Regards, Luca (Cosmic) |
|
|
|
嗨卢卡,
不幸的是,我无法单步执行_fctcpy()函数,因为当我尝试调用它时,SWIM接口会遇到通信超时。 我注意到的一件事是在AN2659和支持固件项目中,_fctcpy()函数是在主程序中的原型。我也试过这个没有成功,因为它已经在库中预先定义了,虽然支持固件示例还包括我已经在我的项目中的库等。 当使用Cosmic Compiler文档的可移动代码部分中突出显示的方法时,是否隐式处理堆栈指针(加载到RAM中的相应地址)或者这是由用户决定的? 谢谢, 亚伦 以上来自于谷歌翻译 以下为原文 Hi Luca, Unfortunately I cannot step through the _fctcpy() function as the SWIM Interface experiences a communication timeout when I attempt to call it. One thing which I have noticed is that in the AN2659 and supporting firmware project, the _fctcpy() function is prototyped in the main program. I have also tried this with no success as it's already predefined in the library, although the supporting firmware example also includes the library etc which I already have in my project. When using the approach highlighted in the moveable code section of the Cosmic Compiler documentation, is the handling of the stack pointer (loaded to the appropriate address in RAM) implicitly handled or is this down to the user? Thanks, Aaron |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2635 浏览 1 评论
3208 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1783 浏览 1 评论
3610 浏览 6 评论
5988 浏览 21 评论
939浏览 4评论
1316浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
584浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1303浏览 3评论
1359浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 00:01 , Processed in 1.118150 second(s), Total 81, Slave 64 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号