大家好!我正在编程一个PIC32 MK0512GPE064,我已经有两个工作项目:BooLoad应用程序在MPLAB X i中创建了两个项目,作为“32位MPLAB和谐项目”。有了和谐,我没有选择“Bootloader库”选项。我只是把这两个项目编程为普通项目。在Bootloader中,我已经包含了一个跳转到应用程序,它应该被放置在一个定义的地址。现在,我想修改默认链接器脚本,以便将源代码分开,并将应用程序代码放置在一个定义的地址。这个想法如下:自己定义的内存区域大小应用休眠的可用内存储备0x1000数据区域3 0x1000数据区域2 0x1000 DAT区域1 0x1000引导加载程序0x400 0i将引导引导程序代码放在引导闪存区域,以避免引导程序可以被应用程序覆盖,但这不是必须的。两个项目的T和我保存在扩展名为“.LD”的文件中。我已经将文件添加到相应的项目中,并且我修改了以下内容来尝试执行上述任务(同时尝试在Bootloader和应用程序中设置程序Flash KSGE0)。在Bootloader内存中修改的行{/*******************,将KSG00SuffyTyMem的长度设置为0x4000,因为*是引导加载程序的保留长度。如果引导加载程序的大小超过这个长度,它将引发一个错误。***************************************************************************************************************************************************************************************************************************************************************************************************************:Orth= 0x9D90000,长度=0x8000×*/KSt00SudioMym(Rx):Orth= 0x9D00亿,长度=0x4000在应用程序/*中提供的修改行。000000);*/Provices(*eBaseAdvase= 0x9D000 A000);/*KSG00ProjyMeX(RX):Orth= 0x9D90000,长度=0x8000×*/KSe00ProjyMeX(Rx):Orth= 0x9D000 A000,长度=0x7600i,未提及两个项目的配置位相同。折叠工程作为可装载工程。如果我执行调试会话,引导加载程序工作,即使在引导程序跳转之后,我也可以在应用程序中进行调试。但是,在某一行上,它会再次意外地跳转到引导加载程序,并在某个函数上永远等待。如果我尝试编程PIC,我会得到以下错误:“创建统一的HEX文件”(944)地址XXXXXX之间的数据冲突在…/Appultual.HEX和…/BooLoad .HiXi怀疑另一个内存区域应该在闪存上移动,但是我已经尝试过没有成功地完成它。非常感谢您的帮助,谢谢您。
以上来自于百度翻译
以下为原文
Hello everyone!
I am programming a PIC32MK0512GPE064 and I have already two working projects:
In MPLAB X I created both projects as "32-bit MPLAB H
ARMony Project". With Harmony, I did not choose the option "Bootloader Library". I just programmed both projects as normal ones. At the bootloader, I have already included a jump to the application, which should be placed at a defined address.
Now, I would like to modify the default linker script in order to separate both source codes and to place the application code at a defined address. The idea is the following:
OWN DEFINED MEMORY REGION SIZE
application rest of the available memory
reserve 0x1000
data region 3 0x1000
data region 2 0x1000
data region 1 0x1000
bootloader 0x4000
I would like to place the bootloader code at the Boot Flash Area, in order to avoid that the bootloader can be overwritten by the application, but
this is not a must.
I used -
verbose to see the default linker script of both projects and I saved it at files with extension ".ld". I have added the files to the corresponding projects and I have modified the following to try to do the mentioned task (while trying to place bootloader and application at
programm flash kseg0).
Modified lines at the bootloader
MEMORY
{
/***************************************************************
* The length of kseg0_program_mem will be set to 0x4000, because
* that is reserved length for the bootloader. It will throw
* an error if the bootloader size exceedes this length.
****************************************************************/
/*kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x80000*/
kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x4000
Modified lines at the application
/*PROVIDE(_ebase_address = 0x9D000000);*/
PROVIDE(_ebase_address = 0x9D00A000);
/*kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x80000*/
kseg0_program_mem (rx) : ORIGIN = 0x9D00A000, LENGTH = 0x76000
I have not mentioned that the configuration bits of both projects are identical.
Then I add the bootloader project at the application project as a loadable project. If I execute a debug session, the bootloader works and I can debug even at the application after the jump from the bootloader. However, at a certain line, It makes an unexpected jump to the bootloader again and waits forever at a certain function. If I try to program the PIC, I get the following error:
"Creating unified hex file"
(944) data conflict at address XXXXXX between .../application.hex and .../bootloader.hex
I suspect that another memory regions should be shifted at the flash memory, but I have already tried to do it without success.
I would appreciate your help very much.
Thank you in advance.
0