完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
大家好,
我正在使用SPC56EL60L3和SPC5STUDIO v5.0。 我有两个不同的应用程序: - 引导加载程序应用程序 - 主要应用 我们的想法是从闪存扇区0(闪存地址0x00000000)开始加载引导加载程序应用程序,并从闪存扇区3(闪存地址0x0001C000)开始加载主应用程序。 我对.ld脚本进行了一些更改以调整闪存设置。 对于引导程序,我有: 记忆 { flash:org = 0x00000000,len = 112k ram:org = 0x40000000,len = 128K 我能想到减小尺寸...... 对于应用程序,我有: 记忆 { flash:org = 0x0001C000,len = 1M - 0x0001C000 ram:org = 0x40000000,len = 128K 我刷了两个应用程序,看起来微控制器开始运行引导加载程序。 我有以下问题: - 这个程序对吗?只需开发两个独立的应用程序并闪存到不同的扇区,使链接器脚本设置变为现实? - 如何从引导加载程序跳转到主应用程序? 谢谢。 问候 亚历山德罗 以上来自于谷歌翻译 以下为原文 Hello everyone, I am working with SPC56EL60L3 and SPC5STUDIO v5.0. I have two different applications: - a bootloader application - the main application The idea is to have the bootloader application loaded starting from flash sector 0 (flash address 0x00000000) and the main application loaded starting from flash sector 3 (flash address 0x0001C000). I made some changes to the .ld script to adjust flash settings. For the bootloader I have: MEMORY { flash : org = 0x00000000, len = 112k ram : org = 0x40000000, len = 128K }I could think of reducing the size... For the application, I have: MEMORY { flash : org = 0x0001C000, len = 1M - 0x0001C000 ram : org = 0x40000000, len = 128K }I flashed both applications and it looks like the microcontroller starts running the bootloader. I have the following questions: - is this procedure right? Just developing two separate applications and flash to different sectors chnaging the linkers script settings? - how do I do to jump to the main application from the bootloader? Thank you. Regards Alessandro |
|
相关推荐
8个回答
|
|
|
嗨Alessandro,
在附件中,您可以找到我已修改的2个测试应用程序(SPC56ELxx_RLA Boot和SPC56ELxx_RLA SERP测试应用程序),以便向您展示如何从启动测试应用程序(SPC56ELxx_RLA Boot)跳转到主测试应用程序(SPC56ELxx_RLA SERIAL测试应用程序)对于DiscoveryPlus)。请注意,这两个测试应用程序是在SPC5Studio 5.2.3(目前,最新发布的版本)下开发的,并在Leopard Discovery板(SPC56EL70L5)上进行了测试。在存档文件中,您还可以找到2个application.ld文件:application_boot.ld和application_serial.ld。由于SPC5Studio每次运行代码生成时都会重新生成application.ld文件,请确保在编译2个测试应用程序之前将生成的application.ld文件替换为存档文件中的文件。 正如您在代码中看到的那样,启动测试应用程序只会跳转到固定位置(0x1C000)。相反,主测试应用程序必须编译为从0x1C000开始,并且必须包含中断初始化代码才能正确支持中断管理。 请允许我建议您首先在核心闪存中编写主测试应用程序,然后在启动测试应用程序中编程(这样程序计数器将直接定位在启动测试应用程序的开头,您可以简单地开始执行通过运行核心)。请随时与我联系以获取任何其他信息或支持。 最好的祝福, 路易吉 以上来自于谷歌翻译 以下为原文 Hi Alessandro, in attachment you can find 2 test applications (SPC56ELxx_RLA Boot and SPC56ELxx_RLA SERIAL Test Application for DiscoveryPlus) that I have modified in order to show you how to jump from a boot test application (SPC56ELxx_RLA Boot) to a main test application (SPC56ELxx_RLA SERIAL Test Application for DiscoveryPlus). Please, note that these 2 test applications have been developed under SPC5Studio 5.2.3 (at the moment, the last released version) and tested on a Leopard Discovery board (SPC56EL70L5). In the archive file you can also find 2 application.ld files: application_boot.ld and application_serial.ld. Since SPC5Studio regenerate the application.ld files every time you run a code generation, please, make sure to replace the generated application.ld files with the ones present in the archive file before to compile the 2 test applications. As you can see surfing in the code, the boot test application makes only a jump to a fixed position (0x1C000). Instead, the main test application has to be compiled to start from 0x1C000 and has to contain the interrupt initialization code in order to correctly support the interrupt managment. Please, let me suggest you to program in the core flash memory firstly the main test application and secondly the boot test application (in this way the program counter will be positioned directly at the begin of the boot test application and you can start the execution simply by running the core).Please, feel free to contact me for any other informtation or support. Best regards, Luigi |
|
|
|
|
|
你好Luigi Zambrano,
我也有类似的查询。 我正在使用SPC560B54L5发现板(768k闪存和64k RAM)和SPC5studio v5.2.3 我为Boot loader和主应用程序编写了单独的测试应用程序。我试图使用前2个扇区用于引导加载程序,从第三个扇区(0x0000C000)我试图加载主应用程序。 我已经完成了与你的建议相同但仍然跳转到主应用程序没有得到分支。我也提到了你的测试应用程序,但我不清楚哪个指令导致从引导加载程序跳转到主应用程序。请在代码中澄清跳转指令。 我附上我的测试应用程序供您参考。 期待您的宝贵指导, 提前致谢, 问候, R.Santhamurthy 以上来自于谷歌翻译 以下为原文 Hi Luigi Zambrano, I too have similar query. I am using SPC560B54L5 Discovery Board(768k Flash and 64k RAM) with SPC5studio v5.2.3 I written individual test application for Boot loader and main application. I am trying to use first 2 sectors for Boot loader and from the third sector (0x0000C000) I am trying to load the main application. I have done the same as your suggestion but still the jump to the main application is not getting branched.I also referred to your test applications but I am not clear with which instruction causes jump from boot loader to main application. Kindly clarify on jump instruction in your code. I am attaching my test application for your reference. Looking forward for your valuable guidance, Thanks in Advance, Regards, R.Santhamurthy |
|
|
|
|
|
嗨R.Santhamurty,分支在启动测试应用程序的文件crt0.s中
/ *分支到主要应用程序* / e_lis%r3,HI(0x0001C000) e_or2i%r3,LO(0x0001C000) mtctr%r3 se_bctrlRegards, 路易吉 以上来自于谷歌翻译 以下为原文 Hi R.Santhamurty, the branch is in the file crt0.s of the boot test application /* Branch to the main application */ e_lis %r3, HI(0x0001C000) e_or2i %r3, LO(0x0001C000) mtctr %r3 se_bctrlRegards, Luigi |
|
|
|
|
|
嗨R.Santhamurty,在附件中你可以找到一个带有启动测试应用程序(0x00000)的示例,该应用程序分支到在SPC5Studio 5.2.3下开发的Bolero B Discovery(SPC560B54L5)的主测试应用程序(0x10000)。
如有任何其他问题或支持,请随时与我联系。 问候, 路易吉 以上来自于谷歌翻译 以下为原文 Hi R.Santhamurty, in attachment you can find an example with a boot test application (0x00000) that branches to a main test application (0x10000) for Bolero B Discovery (SPC560B54L5) developed under SPC5Studio 5.2.3. Please, feel free to contact me for any other question or support. Regards, Luigi |
|
|
|
|
|
嗨路易吉,
谢谢你提供一个例子。 看看我见过的代码,你在调用main函数之前更改了crt0.s文件,添加了以下代码: / *分支到主要应用程序* / e_lis%r3,HI(0x0001C000) e_or2i%r3,LO(0x0001C000) mtctr%r3 se_bctrl 好的,了解如何在装配中做到这一点。 对于我的应用程序,我需要在C中做同样的事情。在微控制器启动时启动booloader,它需要做一些事情(听CAN总线接收传入消息等等)然后,一旦完成,它需要调用主应用程序(从0x00010000开始闪烁)。 换句话说,我需要从bootloader main函数跳转到应用程序。 我怎么能在C中这样做? 谢谢。 问候 亚历山德罗 以上来自于谷歌翻译 以下为原文 Hi Luigi, thank you for providing an example. Looking at the code I've seen you changed the crt0.s file adding the following piece of code, before the call to the main function: /* Branch to the main application */ e_lis %r3, HI(0x0001C000) e_or2i %r3, LO(0x0001C000) mtctr %r3 se_bctrl Ok, understood how to do it in assembly. For my application I need to to the same thing in C. The booloader is launched at microcontroller startup, it needs to do some stuff (listening to the CAN bus for incoming messages, etcc...) and then, once finished, it needs to call the main application (which is flashed starting from 0x00010000). In other words I need to jump to the application from the bootloader main function. How can I do this in C? Thank you. Regards Alessandro |
|
|
|
|
|
嗨Alessandro,
它应该在main函数中移动分支指令。在附件中,您可以找到新版本的启动测试应用程序,我在其中移动了主要的分支instrunctions。请与此测试应用程序一起使用与旧的启动测试应用程序版本共享的相同application.ld文件。 问候, 路易吉 以上来自于谷歌翻译 以下为原文 Hi Alessandro, it is enought to move the branch instructions in the main function. In attachment you can find a new version of the boot test application in which I have moved the branch instrunctions in the main. Please, use with this test application the same application.ld file that I have shared with the old boot test application version. Regards, Luigi |
|
|
|
|
|
你好Luigi Zambrano,
引导加载程序的附加示例正如您所解释的那样工作。但是我需要在引导加载程序部分包含GPIO和串行输出操作。 我用所有必要的组件更新了示例,但LED和串行写入都没有执行。从引导加载程序,它直接跳转到主应用程序。即使我试图增加引导加载程序大小并将跳转地址修改为修改后的地址,但问题仍然重复。 我正在通过它附上编辑过的项目,并通过它分享您解决问题的建议。 以上来自于谷歌翻译 以下为原文 Hi Luigi Zambrano, The attached example for boot loader is working as you explained. However I need to include GPIO and serial output operations in Boot loader section. I updated the example with all the necessary components but neither the LED nor serial write is getting executed. From the boot loader it directly jumps to main application. Even I tried to increase the Boot loader size and modified the jump address to modified address, but still the issue repeats. I am attaching the edited projects with this, kindly through it and share your suggestions in resolving the issue explained. |
|
|
|
|
|
嗨R.Santhamurty,
为了在引导测试应用程序的主要部分中执行某些代码,显然您必须将跳转移动到引导测试应用程序主体中的主要测试应用程序。此外,在跳转之前,您必须在DRUN模式下移动内核,因为clocktree init函数(将由主测试应用程序重新执行)将其作为要求。在附件中,您可以找到具有所需修改的引导测试应用程序。请注意,这个新的启动测试应用程序使用我上次与您共享的相同application.ld文件。 问候, 路易吉 以上来自于谷歌翻译 以下为原文 Hi R.Santhamurty, in order to execute some code in the main of the boot test application, obviously you have to move the jump to the main test application in the main of the boot test application. Moreover, before the jump, you have to move the core in DRUN mode because the clocktree init function (that will be re-executed by the main test application) has it as requirement. In attachment you can find the boot test application with the required modifications. Please, note this new boot test application use the same application.ld file that I shared you last time. Regards, Luigi |
|
|
|
|
只有小组成员才能发言,加入小组>>
stm32mp157的异核通信的rpmsg_sdb的m4固件和a7驱动该如何编写?
1453 浏览 0 评论
stm32f103用freertos对一个采样率为1kHz的传感器,进行采样,数据出差
1502 浏览 0 评论
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
3649 浏览 1 评论
3842 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
2461 浏览 1 评论
STM32H7打开DCache后,出现了串口接收信息为空的现象,是哪里出了问题?
727浏览 5评论
用NANO STM32F103RBT6的开发板烧录不了是哪里出了问题?
661浏览 5评论
710浏览 5评论
外部中断触发类型为双边沿触发,进入中断回调后有什么办法判断该边沿是上升沿还是下降沿?
941浏览 5评论
STM32L071CBT6低温环境下无法正常工作是什么原因引起的?
745浏览 5评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 05:27 , Processed in 1.069135 second(s), Total 86, Slave 69 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1798