完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
您好,我们正在研究基于DSPIC33微芯片C的项目,我们从matlab/Simulink开发软件。由于某些原因,我们必须在PIC闪存(代码偏移)中生成自定义地址的程序。在MPLAB上,我们可以使用自定义链接器脚本,并用自己的“Outlook”指定一个“程序起始地址”。集合。它工作完美!但是,我们希望使用Matlab/Simulink生成代码(HEX文件)。附加图像是从Simulink中获取的代码生成参数窗口的截图。有2种方法可以使用自定义脚本文件来生成代码:1 /追加跟随选项到链接器选项字段:- Xlinker - Script =“C:MyStand”MyLink脚本。GLD“2/更新链接器脚本路径字段,并将其设置为C:MyPosijyMyLink脚本。这些方法在Simulink中工作!当我们保存代码生成选项窗口并重新打开它时,似乎Simulink以默认值覆盖修改的字段。同样,如果我们强制从Simulink生成HEX,自定义脚本就被完全忽略了。有人知道在Simulink上做这项工作的方法吗?谢谢。请问候巴斯蒂安。
以上来自于百度翻译 以下为原文 Hello, We are working on project based on dsPic33 microchip µC and we develop software from Matlab/Simulink. For some reasons, we must generate program to custom address in PIC flash memory (code offset). On MPLAB, we can use custom linker script and specify a "program start address" with our own offset. It work perfectly ! But we want to use Matlab/simulink to generate code (Hex file). Attached image is a screenshot of code generation parameter window taken from Simulink. There are 2 ways to use custom script file for code generation : 1/ append following option into linker option field : -Xlinker --script="C:MyProjectmyLinkerScript.GLD" 2/ update linker script path field and set it to C:MyProjectmyLinkerScript.GLD None of these ways works on Simulink ! When we save code generation options window and re-open it, it seems that Simulink overwrites modified fields with default values. In the same way, if we force hex generation from Simulink, custom script is totally ignored. Does anyone know a way to do the job on Simulink ? Thanks in advance. Regards. Sébastien Attached Image(s) |
|
相关推荐
5个回答
|
|
Hi Se巴斯蒂安,这是目前BLUTSET的一个限制。第一个解决方案是在MPLAB X中打开生成的项目,从那里设置自己的编译选项。第二个解决方案是直接替换所使用的GLD链接器脚本(但是这是不建议的)。请看在BoeSt集合的未来版本中改进这一点。请让你在这个论坛的私人信息中发送你的电子邮件。鲁宾
以上来自于百度翻译 以下为原文 Hi Sébastien, This is currently one limitation of the blockset. The first workaround is to open the generated project within MPLAB X, set your own compilation options from there. The second workaround would be to replace directly the .gld linker script being used (however this is not advised). We will look at improving this in future release of the blockset. Please let me your email in Private message within that forum. Lubin |
|
|
|
嗨,鲁宾,这对我们来说不是个好消息。我们也在考虑这2个办法。它成功地完成了工作,但不幸的是,这对我们来说是不现实的。没问题,我会在下午给你发邮件。谢谢你的快速回答。巴斯蒂安
以上来自于百度翻译 以下为原文 Hi Lubin, It's not good news for us. We also think about these 2 workarounds... It does the job successfully but, unfortunately, it is not practical for us. No problem, I'll send you my email in PM. Thanks you for your quick answer. Sébastien |
|
|
|
嗨,巴斯蒂安,我们没有得到任何使用该功能之前的情况。但是,我们已经得到了一个很好的请求:“如何用Bootloader(TynYBLD)预留程序内存。问题是某个库被加载到程序内存的末尾,危及引导程序空间程序。一个简单的解决方案是添加自定义代码:这样的代码可以添加。Edin的Simulink配置参数= & Gt;代码生成= & gt;自定义代码= & Gt;源文件。通过附加的屏幕截图,这个添加的代码有效地移动了以前在0x1CEC中的一些Flash程序。如果你的问题可能被视为程序内存空间的一个约束,那么你的问题和这个问题是一样的吗?鲁宾
以上来自于百度翻译 以下为原文 Hi Sébastien, We did not get any use case for that feature previously. However, we already get a close request: "how to reserve program memory to use with a bootloader (tinybld)". Problem being that some library were loaded at the end of the program memory, jeopardizing the bootloader space program. One simple solution were to add custom code like: char reserved_space[0x1000] __attribute__((space(prog),noload,address(0x1cec))); This code could be added in the Simulink Configuration Parameters => Code Generation => Custom Code => Source file. With the screenshot attached, this added code effectively moved some of the FLASH program which was previously at 0x1cec. If your problem may be seen as a constraint on the program memory space, maybe your problem is the same as this one ? Lubin Attached Image(s) |
|
|
|
嗨,鲁宾,这个解决方案似乎很有趣。我们会尝试并做反馈。谢谢你。问候,巴斯蒂安。
以上来自于百度翻译 以下为原文 Hi Lubin, This solution seems to be interesting. We will try it and make feedback soonly. Thank you again. Regards, Sébastien. |
|
|
|
嗨,鲁宾,我们已经在Simulink中测试了你的最后一个解决方案,程序启动地址已经成功地移动到指定地址,正如你所说的,但是一个新的问题发生了。当我们尝试将我们的引导程序(存储在闪存的第一页中)与这个程序一起生成Simulink,Microchip链接器失败,因为它们之间存在冲突。实际上,问题是在Simulink中生成的程序。我们添加的自定义代码不移动中断向量,也不重置向量。可能我们应该另外添加自定义代码来移动这些代码。问候,巴斯蒂安。
以上来自于百度翻译 以下为原文 Hi Lubin, We have tested your last solution with custom code injection in Simulink. Program start address is successfully moved to specified address as you said but a new problem occurs. When we try to merge our Bootloader program (stored in first page in Flash memory) with this program generated with Simulink, Microchip linker fails because there are some conflicts between them. The problem lies, in fact, in the program generated with Simulink. Custom code we have added does not move the Interruption Vector nor the Reset Vector... May be we should add another custom codes specially to move these ? Regards, Sébastien. |
|
|
|
只有小组成员才能发言,加入小组>>
5250 浏览 9 评论
2037 浏览 8 评论
1958 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3218 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2266 浏览 5 评论
789浏览 1评论
681浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
610浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
685浏览 0评论
583浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-29 10:24 , Processed in 1.869762 second(s), Total 84, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号