我把以下程序的存放位置修改了以下,放到ROM_0C00,修改之前是ROM_C000,结果程序不运行了,这2个块都属于非分页flash,这里是为啥
added translaton by google translator... modified the storage location of the following program and put it in ROM_0C00. Before the modification, it was ROM_C000. As a result, the program does not run. These two blocks belong to non-paged flash. Here is why_
_PRESTART, /* Used in HIWARE format: jump to _Startup at the code start */
STARTUP, /* startup data structures */
ROM_VAR, /* constant variables */
STRINGS, /* string literals */
VIRTUAL_TABLE_SEGMENT, /* C++ virtual table segment */
//.ostext, /* OSEK */
NON_BANKED, /* runtime routines which must not be banked */
COPY /* copy down information: how to initialize variables */
/* in case you want to use ROM_4000 here as well, make sure
that all files (incl. library files) are compiled with the
option: -OnB=b */
INTO ROM_0C00;//*, ROM_0C00, ROM_4000*/(默认是ROM_C000)
/* non-paged FLASHs */
ROM_0C00 = READ_ONLY 0x0C00 TO 0x2FFF;// //
ROM_4000 = READ_ONLY 0x4000 TO 0x7FFF;
ROM_C000 = READ_ONLY 0xC400 TO 0xFEFF;//0xC000 TO 0xFEFF;
FLASH_To_RAM_CODE = READ_ONLY 0xC000 TO 0xC3FF RELOCATE_TO 0x3C00;//手动添加。2022-11-21 14:20:58
Hello tao180539,
I see from the picture that you created the SEGMENT FLASH_To_RAM_CODE starting from 0xC000.
However, from your picture isnt visible the assignment to any user segment in the PLACEMENT section.
There should be something like:
MY_FLASH_ROUTINES INTO FLASH_To_RAM_CODE;
In that case, you will use pragmas to place the code into MY_FLASH_ROUTINES user segment.
Please also check wthether you added the compiler option -OnB=b (for preventing usage too short addresses for jumps/calls) as it is described in prm file (see COPY placemet).
And of course, you may check the placement of all critical components in the map file.
Best Regards
RadekS
我更新截图一下,上个截图漏掉了一部分东西,这次是全图,后面这个图我仿真运行,奇怪的是他跳转地址是0X1002,本来按照我的设置应该跳转到0x0C00才对,他这里奇怪了。