完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
大家好。我试着用SD-Car配置一个和声Bootloader程序。在生成代码后,我得到了很多“链接错误:不能分配部分”。我使用PIC32 MX470F512H和和声1.09。在PDF“MPLAB®和声帮助-引导加载程序库”中找不到任何信息。我猜我是HAV。最初的Bootloader回调寄存器?有什么想法吗?
以上来自于百度翻译 以下为原文 Hi everybody. I tried to configure a HARMony bootloader program with a SD-card. After generate the code, I get a lot of "Link Error: Could not allocate section". I use a PIC32MX470F512H and Harmony 1.09. I couldn't find any information in the pdf "MPLAB® Harmony Help -Bootloader Library". I guess I have to initial first the bootloader callback register ? Any ideaa ? |
|
相关推荐
16个回答
|
|
|
Bootloader调用寄存器的初始值是什么意思?听起来你好像失去了记忆。你是自由模式吗?这种类型的引导加载程序可能不适合您的芯片。
以上来自于百度翻译 以下为原文 What does initial first the bootloader call register mean? It sounds like you are out of memory. Are you in free mode? That type of bootloader may not fit in your chip. |
|
|
|
|
|
谢谢你的快速响应。直到知道,只有引导加载程序!这是一个新的和谐项目从头开始没有任何程序。
以上来自于百度翻译 以下为原文 Thk you for your quick response. Until know, there is only the bootloader! It's a new Harmony project from the scratch without any program. |
|
|
|
|
|
引导加载程序应该将它与引导块相匹配。但事实并非如此。如果你有MZ的话如果你得到了付费编译器,它可能会。允许Bootloader从BootBoad中退出,但不能启用保护。在这个星期内,有可能是来自老家团队的人对此发表评论。
以上来自于百度翻译 以下为原文 The bootloader should fit it the boot block. This does not. If you had an MZ it might. If you got the paid compiler it might. You can allow the bootloader out of the bootblock, but then you can not enable protection. It is possible that someone from the homily team may comment on this during the week. |
|
|
|
|
|
我发现了故障。在Linkerfile“BTLYMX.LD”中,我必须为Studio Sk00Sudio Mym(Rx):Orth= 0x9D00,长度=0x200,扩展空间,然后才是长度=0x3000,所以现在我可以编译所有的东西而没有任何失败。但是我知道下一个问题。BooLoad Service BooBooLoopRealScript(AppHyBooBooLoad Server检查);AppHyBooBooLoad检查返回A(1),没有发生任何更新。BooLoad Service BooBooLoad注册表退出-正常程序将执行。
以上来自于百度翻译 以下为原文 I have found the failure. In the Linkerfile "Btl_mx.ld" I had to extend the space for the program kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x20000 before it was just :LENGTH = 0x3000 So now I'm able to compile everything without any failure. But know I have the next problem. When I call the BOOTLOADER_ForceBootloadRegister(APP_ForceBootloaderCheck); and the APP_ForceBootloaderCheck returns a (1), nothing happens - no update. The BOOTLOADER_ForceBootloadRegister quits - and the normal program will be executed. a little disapointing .... |
|
|
|
|
|
什么叫BooLoad Service BooBooLoad?它只是注册回调函数。你的AppHyBooBooLoad检查()的定义是什么?如何进入Bootloader模式?在电源复位时按下按钮?++你可以查看StysCyFig .h,有一些BooTouleRoXXX值,你可能需要改变它。
以上来自于百度翻译 以下为原文 What do you mean you call the BOOTLOADER_ForceBootloadRegister? It's just registering the callback function. What's the definition of your APP_ForceBootloaderCheck()? How do you enter bootloader mode? by pressing a button while at power on reset? ++ You can take a look at the system_config.h, there are some BOOTLOADER_XX values, you might have to change it. |
|
|
|
|
|
也许这是我的一个错误理解。我已经检查了“基本”的示例,它是和谐的。App.c中的唯一代码是BooLoad Server BooBooLoad RealScript(AppHythBooBooLoad检查)的函数调用。如果一个开关被按下,AppHyBooBooLooSerkChead返回一个1。我的目标是启动一个更新,如果一个特殊的十六进制文件在SD卡上。“固件.HEX”。但是现在,如果我只更新一次,我会很高兴,看看它是如何工作的。这是StasySCOFIG.H:2中的内容。基地址和结束地址必须根据Flash页面大小*/y*定义BooLoad Server闪存基地址(0x9dMAM+0x3000)IN BooToLoWiFrasyEnthAdvor(0x9dMAM+0x8000 - 1)/*地址,从应用程序开始执行*//*规则:将BooLoad Server闪存基地址设置为应用程序链接器脚本*/y*定义的BooLoad SerieTyx地址(BooBooLoulsFlash基BaseAdvor)定义开机Load SeriaIMAGE文件名“固件.HEX”
以上来自于百度翻译 以下为原文 May be it's a missunderstanding on my side. I've checked the "basic" sample, which comes with harmony. The only code in app.c is the function call of BOOTLOADER_ForceBootloadRegister(APP_ForceBootloaderCheck). The APP_ForceBootloaderCheck returns a 1, if a switch is pressed. My goal is to start an update, if a special hex file is on the sd-card eg. "firmware.hex". But right now, I would be happy if I could update just once, to see how it works. This is what is in the system_config.h: 2)The base address and end address must align on boundaries according to the flash page size */ #define BOOTLOADER_FLASH_BASE_ADDRESS (0x9D000000 + 0x3000) #define BOOTLOADER_FLASH_END_ADDRESS (0x9D000000 + 0x80000 - 1) /* Address of the Flash from where the application starts executing */ /* Rule: Set BOOTLOADER_FLASH_BASE_ADDRESS to _RESET_ADDR value of application linker script*/ #define BOOTLOADER_RESET_ADDRESS (BOOTLOADER_FLASH_BASE_ADDRESS) #define BOOTLOADER_IMAGE_FILE_NAME "firmware.hex" |
|
|
|
|
|
我认为你必须将BooLoad Server闪存基地址改为(0x9dMAM+0x02)或其他东西。当你编译你的固件(应用程序)时,你需要根据Bootloader、Flash、BaseBaseAddies的值准备应用程序的链接器文件。因此,在引导加载程序后,它将跳转到地址、BootloadReSeReTyLoad、相同的AbototLoloader闪存基地址(定义)。Bootloader还将检查BootloadReReSeTip地址中的数据,如果它是0xffff.fff(意味着擦除),那么它将进入引导加载模式。+ +我们假设引导加载程序占用的空间可达(0x9dMAM+0x1FFFF)。
以上来自于百度翻译 以下为原文 I think you have to change BOOTLOADER_FLASH_BASE_ADDRESS to (0x9D000000 + 0x20000) or something after. And when you compile your firmware (the APP), you need to prepare the APP's linker file according to the value of BOOTLOADER_FLASH_BASE_ADDRESS. So after the bootloader load the APP, it will jump to the address, BOOTLOADER_RESET_ADDRESS, the same as BOOTLOADER_FLASH_BASE_ADDRESS(defined). Actually the bootloader will also check the data at BOOTLOADER_RESET_ADDRESS, if it's 0xFFFF.FFFF (means erased), it will then go into the bootload mode. ++ we assume the bootloader will occupy the space up to (0x9D000000 + 0x1FFFF). |
|
|
|
|
|
我有点困惑。BooLoad Server闪存基地址是为用户应用程序预留的程序Flash的基地址。那么“正常”应用的地址开始了吗?那不应该是0x900亿吗?在我的OpimIon中,BooLoad的ReSeTyx地址也应该是0x9d00,以便启动用户程序。因此,标准生成代码应该是OK的:{定义BooTouleReSeTyx地址(BooBooLoul-Flash,BaseBaseAdvor)另一个奇怪的事情:当我构建项目并在PIC32内存使用报告中查看时,我找到了地址为0x9D900ECA8的BooLoad Services任务。就在我的申请中吗?我认为它应该在KSG00BooTyMeMm内存中吗?它起始于Orth= 0x9FC000。
以上来自于百度翻译 以下为原文 I am a little confused. The BOOTLOADER_FLASH_BASE_ADDRESS is the Base address of the program Flash reserved for the user application. So the address where the "normal" aplication starts? Shouldn't that be 0x9D000000 ? And in my opimion the BOOTLOADER_RESET_ADDRESS should also 0x9D000000, in order to start the user program. Therefore the standard generate code should be ok: #define BOOTLOADER_RESET_ADDRESS (BOOTLOADER_FLASH_BASE_ADDRESS) Another strange thing: When I build the project and take a look in the PIC32 Memory-Usage Report, I find the for eg. the Bootloader_Tasks at address 0x9d00eca8. Right in the middle of my application ? I thougt it should be in the kseg0_boot_mem memory? Which starts at ORIGIN = 0x9FC00000. |
|
|
|
|
|
对于每一个程序,都有一个启动代码,它在重置后立即执行。源是ATXC32/V1.XX/PIC32-LIbs/LIbPIC32/Stutup/CRT0.SSOO复位,在复位段中为0xBFC0.000,由KSEG1Y-BOOTHOMEM定义。由您编写的“程序”将被放置在KSG00SuffyMIm定义的空间中,因为SD引导加载程序过大,不能在引导闪存中安装它,因此它必须使用程序Flash上的内存。这样就可以移动BooLoad SeriReTyx地址。因此,如果我们想删除应用程序,我们不能只是擦除整个程序Flash一次,我们必须做一页一页。
以上来自于百度翻译 以下为原文 For each program, there is a startup code, which is executed right after the reset. The source is at xc32/v1.xx/pic32-libs/libpic32/startup/crt0.S So _reset is at 0xBFC0.0000 in the .reset section which is defined by kseg1_boot_mem. The "program" written by you will be placed in the space defined by kseg0_program_mem. Because the SD bootloader is oversized, you cannot fit it in the boot flash, so it has to use the memory on the program flash. Such that the BOOTLOADER_RESET_ADDRESS is moved. So if we want to erase the APP, we cannot just erase the whole program flash all at once, we have to do it page by page. |
|
|
|
|
|
但是我如何将引导程序从我的应用程序中分离出来。我试过:KSG00SUPPLAYMEM(RX):Orthase= 0x9D010000,长度=0x02/0**应该是我的APP*/KSG00BootmieMe:Ont= 0x9D900M,长度=0x10000 /*这里应该是我的Bootloader */但是编译器仍然会产生一个代码从0x9D010000开始?
以上来自于百度翻译 以下为原文 But how can I separate the bootloader program from my app. I tried : kseg0_program_mem (rx) : ORIGIN = 0x9D010000, LENGTH = 0x20000 /* here should be my app */ kseg0_boot_mem : ORIGIN = 0x9D000000, LENGTH = 0x10000 /* here should be my bootloader*/ but still the compiler produce a code where everything starts from 0x9d010000 ? |
|
|
|
|
|
KSKXXBootmiMm或KSKXXPythyMeM并不真正指Bootloader或App。这只是编译器用来为程序分配内存的命名约定。您可以查看链接器文件,看看在内存块中分配了哪些节。这就是为什么你会有两个链接器文件,一个是引导程序,一个是应用程序。一般来说,你的Bootloader KSGE1BUOTHYMEM//用于重置和启动KSt00SudioMy/M/ /大多数是由你编写的Bootloader程序,ExpEpExcTyMe//用于异常/中断向量Debug GeXixMeM//用于调试你的应用程序KSK1Y-BOOTTYMEM//用于由BO调用的应用程序重置OTloader和App的启动KSt00SuffyTyMe//大部分是由Apple的程序编写的,ExpEpExtTyMe//App的异常/中断向量Debug gExpExtMe///将与引导加载程序相同。
以上来自于百度翻译 以下为原文 the ksegx_boot_mem or ksegx_program_mem do not really mean bootloader or app. It's just the naming convention the compiler uses to allocate the memory for the program. You can take a look the linker file to see what sections are allocated in the memory blocks. That's why you will have two linker files, one for the bootloader, one for the app. Generally speaking it's like: your bootloader kseg1_boot_mem //for reset and startup kseg0_program_mem //mostly for the bootloader program written by you exeception_mem //for the exceptions/interrupt vectors debug_exec_mem //for debugging your app kseg1_boot_mem //for the app's reset called by the bootloader and app's startup kseg0_program_mem //mostly for the app's program written by you exeception_mem //for app's exceptions/interrupt vectors debug_exec_mem //would be the same as the bootloader |
|
|
|
|
|
哦,现在我只有一个链接文件。不是两个。只是“BTLYMX.LD”,它是由和谐产生的。可能是我完全错了,引导引导器应该是一个自己的项目吗?在这一刻,我试着把它融入我的“正常”代码中。
以上来自于百度翻译 以下为原文 Oh, in the moment I just have one Linker File. Not two. Just the "btl_mx.ld", which is generated by Harmony. May be I am totaly wrong, should the bootloader be an own project ? In the moment I try to integreat it in my "normal" code in one project. |
|
|
|
|
|
通常是两个项目。一个用于引导加载程序,一个用于应用程序。你可以看一下AN1388,http://www. McCyp.com….ASPX?AppNeNo.En583636
以上来自于百度翻译 以下为原文 Usually it's two projects. One for the bootloader, one for the app. You can take a look at AN1388, http://www.microchip.com/....aspx?appnote=en554836 |
|
|
|
|
|
谢谢你的帮助!Bootloader的大小是0x10898字节,所以我选择BxTyxMx.ByTyxMx.LD为:X-ReStEdAdDr=0xBFC0000;KeS00S91FC01000;KSG00SUpjyMeX(RX):Orth= 0x9D900M,长度=0x12000 KSG00BootmiMe:Orth= 0X9FC0490,长度=0x0例外的MEM:原点=0x9FC01000,长度=0x1000 APP:μeBaseAdvices=0x9D000 e000;γReSeTydAdDr=(0x9D90000);KSt00Sudio Mym(Rx):Orth=(0x9D900M+0x12000),长度=(0x8000—0x12000)KSG00BooToMeM:原点=0x9dMAM+0x12000,长度=0x0组态3:Orth= 0xBFC02FF0,长度=0x4谢谢您的耐心!我希望上面的配置是好的。我已经检查了“基本”的示例,它与和谐一致,我找不到任何BootloadError初始化的调用或BootloadSeriTaskSer()——那么我是如何使用引导加载程序的呢?你知道一个例子吗?我想我只需要SD卡上的“开机,十六进制”和启动加载程序。
以上来自于百度翻译 以下为原文 Thank you for your helpgrin: No I have separat projects one for the bootloader , one for the app. The size of the bootloader is 0x10898 bytes, so I choose 0x12000 bytes The btl_mx.ld is: _RESET_ADDR = 0xBFC00000; _ebase_address = 0x9FC01000; kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x12000 kseg0_boot_mem : ORIGIN = 0x9FC00490, LENGTH = 0x0 exception_mem : ORIGIN = 0x9FC01000, LENGTH = 0x1000 The app : _ebase_address = 0x9D00E000; _RESET_ADDR = (0x9D000000); kseg0_program_mem (rx) : ORIGIN = (0x9D000000 + 0x12000), LENGTH = (0x80000 - 0x12000) kseg0_boot_mem : ORIGIN = 0x9D000000 + 0x12000, LENGTH = 0x0 config3 : ORIGIN = 0xBFC02FF0, LENGTH = 0x4 Thank you for your patience ! I hope the above configuration is ok. I have checked the "basic" sample which comes with Harmony, I couldn't find any Bootloader_Initialize call or Bootloader_Tasks() - so how I use the bootloader ?! Do you know an example ? I thought I just need a " "boot.hex" on the SD-card and the bootloader starts automatically. |
|
|
|
|
|
链接文件可能工作,结构类似于引导闪存=引导闪存=-bxl -0xbfc0000~0xbfc048 f:kSeG1BoToMe0xBFC0490~0xBFC0FFF:0x9FC01000~0x9FC01FFF:ExpExtIOM0x9FC02000~0x9FC02FEF:Debug GeXeXeXMFM。这里是应用程序的一部分KSG00A程序MME-APP--- 0x9D012000~0x9D0128F: KSGE1BoToMeM0x9D012490~0X9D07EFF:KSG00A程序MME0X9D07F0~0X9D07FFFF:例外
以上来自于百度翻译 以下为原文 Here is part of the APP's linker file that might work, _ebase_address = 0x9D07F000; // <----- move to the end of the program flash ... _RESET_ADDR = (0x9D012000); // <----- the entry point of the APP _BEV_EXCPT_ADDR = ((0x9D012000) + 0x380); _DBG_EXCPT_ADDR = ((0x9D012000) + 0x480); _DBG_CODE_ADDR = 0xBFC02000; _DBG_CODE_SIZE = 0xFF0 ; _GEN_EXCPT_ADDR = _ebase_address + 0x180; /************************************************************************* * Memory Regions * * Memory regions without attributes cannot be used for orphaned sections. * Only sections specifically assigned to these regions can be allocated * into these regions. *************************************************************************/ MEMORY { kseg0_program_mem (rx) : ORIGIN = (0x9D012000 + 0x490), LENGTH = 0x80000 - (0x12000 + 0x490) /* All C Files will be located here */ kseg0_boot_mem : ORIGIN = 0x9D012000, LENGTH = 0x0 /* This memory region is dummy */ exception_mem : ORIGIN = 0x9D07F000, LENGTH = 0x1000 /* Interrupt vector table */ kseg1_boot_mem : ORIGIN = (0x9D012000), LENGTH = 0x490 /* C Startup code */ debug_exec_mem : ORIGIN = 0xBFC02000, LENGTH = 0xFF0 config3 : ORIGIN = 0xBFC02FF0, LENGTH = 0x4 config2 : ORIGIN = 0xBFC02FF4, LENGTH = 0x4 config1 : ORIGIN = 0xBFC02FF8, LENGTH = 0x4 config0 : ORIGIN = 0xBFC02FFC, LENGTH = 0x4 kseg1_data_mem (w!x) : ORIGIN = 0xA0000000, LENGTH = 0x8000 sfrs : ORIGIN = 0xBF800000, LENGTH = 0x100000 configsfrs : ORIGIN = 0xBFC02FF0, LENGTH = 0x10 } The structure is like ===== boot flash ====== --- BTL --- 0xBFC00000~0xBFC0048F: kseg1_boot_mem 0xBFC00490~0xBFC00FFF: 0x9FC01000~0x9FC01FFF: exception_mem 0x9FC02000~0x9FC02FEF: debug_exec_mem ===== program flash ===== --- BTL --- 0x9D000000~0x9D011FFF: kseg0_program_mem --- APP --- 0x9D012000~0x9D01248F: kseg1_boot_mem 0x9D012490~0x9D07EFFF: kseg0_program_mem 0x9D07F000~0x9D07FFFF: exception_mem |
|
|
|
|
|
它在SytSysIn.c SysIsPrimalIZE()和SysStaseTeals.C SysStasks中被调用。我没有一个例子,但是您可以创建一个简单的应用程序链接器来闪烁LED。文件名必须是BooLoopeRyIMAGE.FILIENEND定义的文件。我认为第一次,如果数据是0xFFFFFFF ATBoToLoopeSeriTeX地址,那么默认情况下它将进入引导加载模式。您可以尝试在引导加载模式下闪烁LED,如基本演示中所示。
以上来自于百度翻译 以下为原文 It gets called in system_init.c SYS_Initialize() and system_tasks.c SYS_Tasks. I don't have an example, but you can create a simple one to blink the LED with the APP linker. The filename has to be the one defined by BOOTLOADER_IMAGE_FILE_NAME. I think the first time, if the data is 0xFFFFFFFF at BOOTLOADER_RESET_ADDRESS, it will go into the boot load mode by default. You can try to blink an LED in the boot load mode as shown in the basic demo. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1123浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 01:45 , Processed in 1.017207 second(s), Total 104, Slave 87 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2199