完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我正在使用PIC32 MZ2048 EFH064,我有一个Bootloader位于BFM中。以及PFM中的应用固件。-第一次上电设备将处于主引导加载模式,并将下载应用固件。在应用程序中,我集成了二次Bootloader,以便我的应用固件可以作为辅助引导加载程序来更新主引导加载程序,或者它可以运行正常的应用程序任务。-我强制应用到二次引导加载模式来下载主引导加载程序。从主引导加载程序复制到我的应用程序的完全相同的源文件,只有我做的更改是使用NVBWP相关函数来禁用BFM WP的附加函数,将区域的地址更改为擦除/编程。主引导加载程序链接器:-KSK1Y-BootmiMe:Ont= 0xBFC000,长度=0x480/*C启动代码*/-KSG00SudioMym(Rx):Orthase= 0x9FC01000,长度=0xFF00 -0x1000 - KSG00BooToMeM:原点=0x9FC04B0,长度=0x00兆-kSe1BoObMyMy4B0:Orth= 0xBFC000 4B0,长度=0x1000~0x4B0-组态BFC0FF40:Orth= 0xBFC0FF40,长度=0x4-……(所有配置)我的应用程序链接器:-KSGE1XBoToMeMe:Orth= 0x9D900M,长度=0x480/*C启动代码*/-KSG00SudithMeX(Rx):Orthase= 0x9D900M+0x480,长度=0x20000 -0x480/*所有C文件将位于这里*/-KSG00BooToMeMe:Orth= 0x9D900M,长度=0x0i被混淆消除擦除启动闪存在地址0x1fc01000或0x1fc000?我需要擦除C启动代码,配置位吗?如果我擦除配置比特,时钟将如何执行?
以上来自于百度翻译 以下为原文 Hi, - I am using PIC32MZ2048EFH064, I am having Primary bootloader located in BFM. And application firmware in PFM. - On first power ON device will be in Primary bootloader mode, and it will download application firmware. - In application, I integrated Secondary bootloader so that my application firmware can either run as Secondary bootloader to update primary bootloader, or it can run normal application tasks. - I force application to secondary bootloader mode to download primary bootloader. - Here comes problem : I copied exact same source files from Primary bootloader to my application,Only changes I made are - Added function to disable BFM WP using NVMBWP related functions, changed addresses of area to erase/program. Primary Bootloader linker : - kseg1_boot_mem : ORIGIN = 0xBFC00000, LENGTH = 0x480 /*C Startup code */ - kseg0_program_mem (rx) : ORIGIN = 0x9fc01000, LENGTH = 0xFF00 - 0x1000 - kseg0_boot_mem : ORIGIN = 0x9fc004b0, LENGTH = 0x00000000 - kseg1_boot_mem_4B0 : ORIGIN = 0xBFC004B0, LENGTH = 0x1000 - 0x4B0 - config_BFC0FF40 : ORIGIN = 0xBFC0FF40, LENGTH = 0x4 - ....... (all configs) My application linker : - kseg1_boot_mem : ORIGIN = 0x9D000000, LENGTH = 0x480 /*C Startup code */ - kseg0_program_mem (rx) : ORIGIN = 0x9D000000 + 0x480, LENGTH = 0x200000 - 0x480 /* All C files will be located here */ - kseg0_boot_mem : ORIGIN = 0x9D000000, LENGTH = 0x0 I am confused whether to erase Boot flash starting at address 0x1FC01000 or 0x1FC00000 ? Do I need to erase C startup code, config bits? If I erase config bits how the clock will execute? |
|
相关推荐
8个回答
|
|
我已经提到了这些论坛链接,但我仍然不满意:1)在PIC32 MZ设备上分段引导闪存?2)PIC32 MZ-如何切换BFM映射3)如何使用TyrPrimaMac配置、配置BF1、CONTIONBF2等?4)PIC32 MZ如何从程序存储器5启动内存编程,当启动闪存写保护(BWP)时,无法写入程序Flash!6)放置在引导闪存存储器中的程序代码)PIC32 MZ写入NVBWP8)TSEQ/BSEQ是否实际用于引导库选择?9)如何闪存到启动闪存2(PIC32 MZ)10)通过应用程序代码更新引导加载程序
以上来自于百度翻译 以下为原文 I have referred these forum links but I am still unsatisfied: 1) Segmented Boot Flash on PIC32MZ devices? 2) PIC32MZ - How to switch BFM mapping 3) How to use #pragma config, config_bf1, config_bf2, etc.? 4) PIC32MZ how to program Boot memory from Program memory 5) Can't write to Program Flash when Boot Flash Write Protect (BWP) is enabled!? 6) Program code placed in boot flash memory 7) PIC32MZ writing to NVMBWP 8) Does TSEQ/BSEQ actually work for boot bank selection? 9) How to flash into boot flash 2 (PIC32MZ) 10) Update bootloader through application code |
|
|
|
您不希望触摸配置位,而是确保它们在引导加载程序和应用程序之间是相同的。您是否擦除了BootFlash取决于链接器和您。链接器告诉PIC,在重置后,如果在正确的情况下跳转到0xBFC10000,它会转到哪里。除了BFC地址是被执行的第一个地址之外,它实际上是BooFlash实际上是无关紧要的。
以上来自于百度翻译 以下为原文 You don't want to touch the config bits, rather make sure they are the same across the bootloader and the application. Whether or not you erase your bootflash is up to your linker and you. The linker tells the pic where it goes to after reset by putting a jump at 0xBFC000000 if I have it right. The fact that it is bootflash really is irrelevant other than that the BFC address is the first address that gets executed. |
|
|
|
更新BootLooloader 5月1日的整个原因是由于配置位不正确。将配置比特限制到我们认为在发射日是正确的是有点限制性的……似乎有很多关于引导装载机和一些人在经历了让他们工作的折磨中幸存下来的困惑……有没有人愿意加入一个开源项目来解决这个问题?
以上来自于百度翻译 以下为原文 The whole reason for updating bootloader #1 may be due to config bits being incorrect. Limiting the config bits to what we think is proper on launch day is a bit restrictive... It seems like there's a lot of confusion about bootloaders and a few people who have survived the ordeal of getting them to work... Is anyone up for joining an open source project to get a robust solution to this problem? |
|
|
|
在我阅读手册时,PIC32 MZ有一个“Live Update”功能,可以让你改变配置比特。在我的系统中,在和谐包“D:Microchip HyralV2Y02Y0.0BAppBootloader Live Update”中有一个示例应用程序。这可以让你了解所涉及的内容。在我的PIC32 MX中,我只做过。能够用外部程序员改变配置位,否则它会跳过配置位失配异常,需要一个电源周期来恢复。
以上来自于百度翻译 以下为原文 As I read the manual the PIC32MZ has a "Live Update" feature will enable you to change the config bits. There is an example app in the Harmony package "D:microchipharmonyv2_02_00bappsbootloaderLiveUpdate" on my system. This may give you an idea of what is involved. In my PIC32MX I have only been able to change the config bits with an external programmer otherwise it trips the config bits mismatch exception requiring a power cycle to recover. |
|
|
|
我不知道MZ可以更新配置比特。这看起来还是有点冒险的。
以上来自于百度翻译 以下为原文 I didn't know the mz could live update the config bits. It still seems a bit risky. |
|
|
|
有一个相当于“实时更新”的程序。
以上来自于百度翻译 以下为原文 there is quite a procedure involved with the "live update" |
|
|
|
我想我需要这样做:擦除引导闪存2(在地址0x9FC6000开始),程序主引导加载程序,以及配置位和SEQ号在那里,在写改变的SEQ3为BF2 & GT;BF1,从而引导闪存2将被混叠到更低的启动别名。对吗?
以上来自于百度翻译 以下为原文 I think I need to do like: - Erase the Boot flash 2 (starting at address 0x9fc60000), program primary bootloader as well as config bits and SEQ number there, before writing change the SEQ3 for BF2 > BF1 so that Boot flash 2 will be aliased to lower boot alias. Is it right? |
|
|
|
我已经做了几个BooLoad,但仍然认为自己是一个新手级别时,涉及到先进的东西,你可以用它做。我的理解是配置比特在复位时被读取,这就是处理器的配置。如果您的应用程序使用不同于配置在引导加载程序中的配置位,则会得到未定义的行为。我想如果你想要一个可以改变配置比特的引导加载程序,你就必须做这样的序列:应用程序A和Bootloader A都使用配置位A,应用程序和引导加载程序B使用配置比特B。A是这个单元装运的内容,我们要升级到B.1)上传应用程序。在外部闪存位置,存储Bootloader B,验证完整性,并更新Bootloader Mexy3)重新启动PIC4)你的引导加载程序需要知道用外部闪存中存储的新应用程序来更新应用程序内存。一旦引导加载程序升级为B,它就不能再回到应用程序A了,因为它具有不同的配置位。如果您使用的是另一个Bootloader页面,而原始Bootloader仍在另一个页面上,您可能会在失败的应用程序加载中切换回它,但是您也必须在外部Flash内存中有一个原始应用程序的拷贝,引导加载程序A可以在Fulu上重新加载。在BooLoad中有很多失败的情况需要考虑,你必须确定你有办法去处理它们。John Vickers
以上来自于百度翻译 以下为原文 I have done a couple of bootloaders, but still consider myself to be a novice level when it comes to advanced things you can do with it. My understanding is that the config bits are read on reset and that is what configures the processor. If your application uses different config bits than were set in the bootloader, you would get undefined behavior. I would think if you wanted a bootloader that could change the config bits, you would have to do something like this sequence: Application A and bootloader A both use config bits A, application and bootloader B use config bits B. A is what the unit shipped with, we want to upgrade to B. 1) Upload application B and store in external flash location 2) upload bootloader B, verify integrity, and update the bootloader memory 3) reboot the PIC 4) your bootloader would need to know to update the application memory with the new application stored in external flash. The problem with this type of setup, is once the bootloader is upgraded to B, it would no longer be able to fall back to application A, because it has different config bits. If you are using the other bootloader page, and the original bootloader is still on the other page, you could potentially switch back to it on failed application load, but you would also have to have a copy of the original application in external flash memory that bootloader A could reload on failure. There are lots of failure scenarios to consider with bootloaders, and you have to make sure you have ways to deal with them all. John Vickers |
|
|
|
只有小组成员才能发言,加入小组>>
5341 浏览 9 评论
2084 浏览 8 评论
1988 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3265 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2301 浏览 5 评论
847浏览 1评论
741浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
683浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
739浏览 0评论
631浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-2-12 23:03 , Processed in 1.146147 second(s), Total 59, Slave 53 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191