1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好?
我有一个bootLoader开发问题?我已经使用SPC560P44成功调试了bootLoader,但是我不太确定如何从应用程序跳转到bootloader? 我们的常规方法是将引导功能放在绝对地址?我们可以通过调用函数指针跳转到引导加载程序?但是在SPC5Studio中我们不知道如何将函数放在绝对地址?有谁能知道这个?欣赏 收到你的回复? #bootloader 以上来自于谷歌翻译 以下为原文 Hello everyone? I have an issue with bootLoader development?I have debug the bootLoader successfully with SPC560P44, but I am not quite sure about how to jump to bootloader from the application program? our conventional method is putting the boot function at the absolute address?and we can jump to bootloader by call the function pointer?but in the SPC5Studio we don't know how to put the function at the absolute address?Can anyone know this ?Appreciate to receive your reply? #bootloader |
|
相关推荐
14个回答
|
|
你好,
您可以使用以下代码在两个wa中执行跳转 void(* fptr)(void); uint32_t jump_address fptr =(void(*)(void))jump_address; fptr();如果使用spc5studio编译应用程序,请考虑: 要跳转的地址不是编程的第一个地址(这是引导头),而是存储在二进制文件的下一个32位位置的值。例子vuint32_t jump_address; jump_address_pointer ='你编程二进制的地址'+ 4UL; jump_address = *((vuint32_t *)(jump_address_pointer));在跳转之前,必须切换到DRUN模式,停止使用外设并禁用中断if(SPCSetRunMode(SPC5_RUNMODE_DRUN)== CLOCK_FAILED){ SPC5_CLOCK_FAILURE_HOOK(); } sysTimeWaitMilliseconds(200); can_lld_stop(安培; CAND1); //停止引导加载程序应用程序使用的外围设备 SPCSetPeripheralClockMode(SPC5_PIT_PCTL,SPC5_PIT_STOP_PCTL); //停止奥萨尔 irqIsrDisable();问候, Procolo 以上来自于谷歌翻译 以下为原文 Hello, you can perform the jump in two wa using the following codes
Procolo |
|
|
|
你好Procolo?
谢谢你的回复?我已经从bootloader成功跳转到应用程序了?它运行得很好?但我有问题从APP跳转到bootloader,它的功能位于0xb800?我使用了相同的跳转功能。我可以发现它已经通过PC指针跳转到地址0xb800?但是它在初始化函数中似乎失败了?并且PC指针停在0x00000c14,这是从地图doc看到的向量。 SPC5_CLOCK_FAILURE_HOOK(); 我发现很奇怪如果我关闭APP中的所有内容,只剩下跳跃功能,它可以成功跳转。跳转功能所在的PC指针地址和我需要跳转到的目标引导程序功能地址之间是否有任何联系?我是否清楚地描述了?我需要你的帮助吗?再次感谢你? 链接器文件 目的地 跳转码 以上来自于谷歌翻译 以下为原文 Hello Procolo? Thank you for your reply?I have jumped successfully from bootloader to application program?and it was run well?but I have problems jumping form APP to bootloader which has a function located at 0xb800?I used the same jumping function. and I could find it already jumped to the address 0xb800 through the PC pointer?however it seems failed at the initialization func ?and the PC pointer stop at 0x00000c14 which was put the vectors seen from the map doc. SPC5_CLOCK_FAILURE_HOOK(); and I found it was really curious that if I close everything in APP ,only the jump func left , it could jump successfully. Is there any connections between the PC pointer address which the jump func located and the aim bootloader func address which I need to jump to?Do I describe clearly?I need your help?thank you so much again? linker file destination the jump code |
|
|
|
你好,
在跳转之前,你能否在停止外围设备后尝试禁用中断? 实际上,一些停止功能在退出时重新启用,因此如果在停止外围设备之前禁用中断,则可以在跳转时重新启用它们。 Redards, Procolo 以上来自于谷歌翻译 以下为原文 Hello, before jumping, could you please try to disable interrupts after stopping the peripherals? actually , some stop functions re enable when exit , so if you disable interrupt before stopping peripherals they may be re enabled when jumping. Redards, Procolo |
|
|
|
你好
Procolo: 当我跳起来时,我复制了你的代码但是它确实有效 - 我禁用了所有的外围设备并发现如果它已经被禁用了那么它已经工作了,但是如果我累了更多,我发现它每次都没有成功运行我跟踪了PC CPU窗口发现PC有时处于IVOR6或有时处于IVOR1,我应该怎样做才能找到问题。感谢你的回答 以上来自于谷歌翻译 以下为原文 Hello Procolo: I have copied your code when I jump,but it did‘t work, I disabled all the peripheral and find that the if the was disabled ,then it worked。But if I tired more ,I found it did not run successfully everytime, I traced the PC in CPU window ,found that the PC was sometimes in IVOR6 or sometimes in IVOR1,what should I do to find the problem?many thanksï¼� |
|
|
|
你好
Procolo? 我想我之后禁用了中断 停止外围设备?但它仍然进入IVOR6,我找不到问题所在?这是我的应用程序代码和引导加载程序代码?我从你的答案中复制了代码吗?我不是初学者 外设 在应用程序?它能成功跳?真是太奇怪了。只有罐头和计时器的外围设备。 以上来自于谷歌翻译 以下为原文 Hello Procolo? I think I have disabled the interrupts after stopping peripherals?but it still entered the IVOR6, I can?t find where the problem is?here are my application code and the bootloader code? I copy the code from your answers?and is I don't init any peripherals in app? it can jump successfully? it is so weird. There are only peripherals of can and timer. |
|
|
|
你好,
我的想法是有一些外围设备没有正确停止并在跳跃时导致错误。 我们应该明白哪一个是。你可以尝试一次启用一个外围设备并检查它何时不起作用? 另外,请在跳转前尝试将DRUN模式设置为上次操作: 停止peripheralsirq disableDRUNRegards, 以上来自于谷歌翻译 以下为原文 Hello, my idea is that there is some peripheral which is not correctly stopping and lead to an error when jumping. we should understand which one is. could you try to enable one peripheral at a time and check when it does not work? also, please try to set DRUN mode as last operation before jumping:
|
|
|
|
你好,
我们来调查吧。我需要以下信息,您能否提供给他们?: SPC5studio的版本使用(帮助 - >关于SPC5studio)指令导致ivor6异常(我认为跳转后但不确切知道在哪里)跳转前后的CAN配置(如果使用)。你可以发送给我两个程序的can_lld_cfg.c文件如果你没有停止可以外围,你有同样的问题吗?谢谢和最好的问候, Procolo 以上来自于谷歌翻译 以下为原文 Hello, let's investigate. I need the following infomation, could you please provide them?:
Procolo |
|
|
|
你好procolo:
谢谢你的提示。我已经改变了我的代码作为你的提议了,然后我逐个初始化了我的外围设备,并发现它可能会产生效果,如果只有初始化和TX消息,可以跳转,但是如果有rxï¼的消息则程序进入IVOR6即使我已经停止了CAN模块。你有什么意见可以解决这个问题 以上来自于谷歌翻译 以下为原文 Hello procolo: Thank you for your tips. I have changed my code as your proposal,Then I initialized my peripheral one by one , and found it maybe the CAN does the effect, if there is only initialization and TX message, it is OK to jump, but if there are message for rx, the program enters IVOR6 even if I have stopped the CAN module.Do you have any opinion to solve this? |
|
|
|
你好,
你能尝试将spc5studio更新到5.8吗?在替代方案中,您可以使用附加的can_lld.c更改can_lld.c(can_lld_stop中有一条新指令)。 此外,当IVOR发生时(视图 - >调用堆栈窗口)和flexcan MCR寄存器值(views-> sfr view-> right click-> browse),你能在UDE中发送callstack窗口吗? 谢谢, Procolo 以上来自于谷歌翻译 以下为原文 Hello, could you try to update spc5studio to 5.8? in alternative you can change can_lld.c with the one attached (there is a new instruction in can_lld_stop). Moreover, can you send the callstack window in UDE when IVOR occurs (views-->call stack window) and flexcan MCR register value (views->sfr view-> right click->browse)? Thanks, Procolo |
|
|
|
你好procolo?
这是照片 1. SPC5studio的版本 2. ivor6但有时它似乎在跳跃后进入ivor1 3. can_lld_cfg.c文件位于附件中。 是的,我认为它的结果相同。 以上来自于谷歌翻译 以下为原文 Hello procolo? Here are the pictures 1. Version of SPC5studio 2. ivor6 but sometimes it seems to enter ivor1 after jump 3. can_lld_cfg.c files is in the attachment. 4. yes, I think its the same result. |
|
|
|
你好,
理解该问题的唯一方法是调试代码。 你能把你的应用程序和说明发给我吗?我会调试我的 以上来自于谷歌翻译 以下为原文 Hello, the only way to understand the issue is to debug your code. Could you please send me your apps and instructions? I will debug on my side |
|
|
|
你好procolo?
我将尝试第二种方案?这是我的callstack和flexcan MCR寄存器。 谢谢! MMWang 以上来自于谷歌翻译 以下为原文 Hello procolo? I will try the second scheme?here is my callstack and flexcan MCR register. Thanks! MMWang |
|
|
|
你好procolo:
我已经尝试过你的附件中的can_lld_stop函数,但它没有效果 以上来自于谷歌翻译 以下为原文 Hello procolo: I have tried the can_lld_stop func from your attachment,but it has no effectï¼� |
|
|
|
你好procolo:
非常感谢你的帮助,我的问题已经解决了 - 在跳转到引导程序后,IVORS没有正确初始化。 最好的祝福! MM.WANG 以上来自于谷歌翻译 以下为原文 Hello procolo: so much thanks for your kindly help,my problem has been solved ,it was the IVORS didn't been initialized correctly after jump to the bootloader. Best regards! MM.WANG |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2725 浏览 1 评论
3237 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1807 浏览 1 评论
3646 浏览 6 评论
6034 浏览 21 评论
1336浏览 4评论
197浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
350浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
442浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
268浏览 2评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 13:51 , Processed in 1.414626 second(s), Total 101, Slave 85 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号