如何在CW11启用PE后,在ProcessorExpert.prm中填加自已的内存段代码,每次产生MCU配置代码后不被清掉

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

如何在CW11启用PE后,在ProcessorExpert.prm中填加自已的内存段代码,每次产生MCU配置代码后不被清掉

1,128 Views
czhlcai
Contributor I

大家好,请教一个问题。我现在用的是CodeWarrior11,我在RAM中设置几个变量,在MCU复位后,变量值不会改变。

本来是在Project.prm中设置的,但因为我启用了PE,所以必须在ProcessorExpert.prm中设置,因为此时Project.prm不起作用了。

但这个ProcessorExpert.prm是自动生成的,你在里面写完自已的代码后,每次Hardware界面中Processor配置栏生成MCU配置代码后,都会清掉,非常麻烦。

01.png

我在上面图中可以设置非清0内存段,然后在ProcessorExpert.prm会体现出来如下

02.png

但我还需在PLACEMENT下填加MY_RAMKEEP   INTO   RAM_KEEP;  //RESET不清0,如下图所示

03.png

如果我直接写代码进去,那每次生成PE中MCU配置代码,都会自动清除。请问正确的做法是,我在哪里写这段代码呢?百思不得其解,希望高手给指条明路,谢谢哈!

0 Kudos
Reply
5 Replies

1,040 Views
czhlcai
Contributor I

自已顶一下

0 Kudos
Reply

1,115 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

HI @czhlcai 

Please go to project processor expert setting "Build Option", set "generate prm file" as "no" 

ZhangJennie_0-1701853642733.png

Have a nice day,

Jun Zhang

0 Kudos
Reply

1,095 Views
czhlcai
Contributor I

首先感谢您的回复,谢谢!!

02.png

 

哎,真是郁闷了,按您说的我已经关闭了Generate PRM file,然后重新生成代码。如上图

可是我在Project.prm中填加了相关内容如下图所示,程序中也有

#pragma DATA_SEG MY_RAMKEEP 
volatile word Now3HallChangeCount; //重启保存变量
#pragma DATA_SEG DEFAULT //MY_RAMKEEP结束

Build ALL 后 相关变量并没有在0x90位置,而是在0x92。我试着又重新在ProcessorExpert.prm中填加MY_RAMKEEP INTO RAM_KEEP;后,重新Build就正常了,在0x90位置。也就是说关闭了Generate PRM file没作用。我直接把ProcessorExpert.prm文件删除,结果就报错了。。。

Description Resource Path Location Type
mingw32-make: *** No rule to make target `../Project_Settings/Linker_Files/ProcessorExpert.prm', needed by `BLA24S-1000_A01.abs'. Stop. LABLxxx-1000_A01 C/C++ Problem

感觉关闭了Generate PRM file,实际并不起作用,Build时还是需要ProcessorExpert.prm这个文件,而忽视原本的Project.prm

01.png

搞不懂了,是哪里还需要设置吗?麻烦再指点一二哈,谢谢

0 Kudos
Reply

872 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi @czhlcai 

Go to project properties setting. linker setting, input...

Make sure the prm file using in this project is the one you revised.

Hope this helps,

Jun Zhang

0 Kudos
Reply

873 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi @czhlcai 

Go to project properties setting. linker setting, input...

Make sure the prm file using in this project is the one you revised.

Hope this helps,

Jun Zhang

0 Kudos
Reply