S12Z - Where can I find information on the linker parameter file (*.prm)?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S12Z - Where can I find information on the linker parameter file (*.prm)?

跳至解决方案
4,217 次查看
Sep95
Contributor I

Hello,
I'm developing firmware for MM9Z1x638 MCU using CodeWarrior. One part of the project is placing data at a specific address in EEPROM (integrated in MCU). Using "#pragma DATA_SEG EEPROM_DATA" I'm able to place a global data structure in EEPROM. But this way, linker decides about the start address and I cannot pretend it.

If I would use GNU C toolchain I would define a label in the linker script for placement at a specific address. Using CodeWarrior I could only find a *.prm command file for linker. Where can I find information on its syntax (e.g. defining labels)? In the compiler manual the document "CodeWarrior Development Studio for Microcontrollers V10.x Targeting Manual" is referenced for this purpose. But I cannot find this document.

Thanks in advance.

0 项奖励
回复
1 解答
4,180 次查看
stanish
NXP Employee
NXP Employee

Hello,

#pragma DATA_SEG EEPROM_DATA is recommended approach.

You can define multiple segments for each object to be placed at specific address.

There is an alternative way using @ operator - this bypasses the .prm file and alocate an absolute address section at defined address.

#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */

#define EEPROM_TEST 0x10008
unsigned int EE_Test  @EEprom_TEST;

In Map file you should see this:

stanish_0-1720611177057.png

 

hope it helps.

Stan

在原帖中查看解决方案

2 回复数
4,181 次查看
stanish
NXP Employee
NXP Employee

Hello,

#pragma DATA_SEG EEPROM_DATA is recommended approach.

You can define multiple segments for each object to be placed at specific address.

There is an alternative way using @ operator - this bypasses the .prm file and alocate an absolute address section at defined address.

#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */

#define EEPROM_TEST 0x10008
unsigned int EE_Test  @EEprom_TEST;

In Map file you should see this:

stanish_0-1720611177057.png

 

hope it helps.

Stan

4,188 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

There are compiler and target manual in the installation directory.

c:\......\CW MCU v11.1\MCU\Help\PDF\

I have also asked our CW expert for additional info.

Best regards,

Ladislav

%3CLINGO-SUB%20id%3D%22lingo-sub-1904487%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES12Z%E2%80%94%E2%80%94%E5%9C%A8%E5%93%AA%E9%87%8C%E5%8F%AF%E4%BB%A5%E6%89%BE%E5%88%B0%E6%9C%89%E5%85%B3%E9%93%BE%E6%8E%A5%E5%99%A8%E5%8F%82%E6%95%B0%E6%96%87%E4%BB%B6%EF%BC%88*.prm%EF%BC%89%E7%9A%84%E4%BF%A1%E6%81%AF%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1904487%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3CBR%20%2F%3E%E6%88%91%E6%AD%A3%E5%9C%A8%E4%BD%BF%E7%94%A8%20CodeWarrior%20%E4%B8%BA%20MM9Z1x638%20MCU%20%E5%BC%80%E5%8F%91%E5%9B%BA%E4%BB%B6%E3%80%82%E8%AF%A5%E9%A1%B9%E7%9B%AE%E7%9A%84%E4%B8%80%E9%83%A8%E5%88%86%E6%98%AF%E5%B0%86%E6%95%B0%E6%8D%AE%E6%94%BE%E7%BD%AE%E5%9C%A8%20EEPROM%EF%BC%88%E9%9B%86%E6%88%90%E5%9C%A8%20MCU%20%E4%B8%AD%EF%BC%89%E4%B8%AD%E7%9A%84%E7%89%B9%E5%AE%9A%E5%9C%B0%E5%9D%80%E3%80%82%E4%BD%BF%E7%94%A8%E2%80%9C%23pragma%20DATA_SEG%20EEPROM_DATA%E2%80%9D%E6%88%91%E8%83%BD%E5%A4%9F%E5%9C%A8%20EEPROM%20%E4%B8%AD%E6%94%BE%E7%BD%AE%E4%B8%80%E4%B8%AA%E5%85%A8%E5%B1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E3%80%82%E4%BD%86%E6%98%AF%E8%BF%99%E6%A0%B7%EF%BC%8C%E9%93%BE%E6%8E%A5%E5%99%A8%E5%B0%B1%E5%86%B3%E5%AE%9A%E4%BA%86%E8%B5%B7%E5%A7%8B%E5%9C%B0%E5%9D%80%EF%BC%8C%E8%80%8C%E6%88%91%E6%97%A0%E6%B3%95%E5%81%87%E8%A3%85%E5%AE%83%E3%80%82%3C%2FP%3E%3CP%3E%E5%A6%82%E6%9E%9C%E6%88%91%E4%BD%BF%E7%94%A8%20GNU%20C%20%E5%B7%A5%E5%85%B7%E9%93%BE%EF%BC%8C%E6%88%91%E4%BC%9A%E5%9C%A8%E9%93%BE%E6%8E%A5%E5%99%A8%E8%84%9A%E6%9C%AC%E4%B8%AD%E5%AE%9A%E4%B9%89%E4%B8%80%E4%B8%AA%E6%A0%87%E7%AD%BE%EF%BC%8C%E4%BB%A5%E4%BE%BF%E6%94%BE%E7%BD%AE%E5%9C%A8%E7%89%B9%E5%AE%9A%E5%9C%B0%E5%9D%80%E3%80%82%E4%BD%BF%E7%94%A8%20CodeWarrior%20%E6%88%91%E5%8F%AA%E8%83%BD%E6%89%BE%E5%88%B0%E9%93%BE%E6%8E%A5%E5%99%A8%E7%9A%84%20*.prm%20%E5%91%BD%E4%BB%A4%E6%96%87%E4%BB%B6%E3%80%82%E5%9C%A8%E5%93%AA%E9%87%8C%E5%8F%AF%E4%BB%A5%E6%89%BE%E5%88%B0%E6%9C%89%E5%85%B3%E5%85%B6%E8%AF%AD%E6%B3%95%E7%9A%84%E4%BF%A1%E6%81%AF%EF%BC%88%E4%BE%8B%E5%A6%82%E5%AE%9A%E4%B9%89%E6%A0%87%E7%AD%BE%EF%BC%9F%E5%9C%A8%E7%BC%96%E8%AF%91%E5%99%A8%E6%89%8B%E5%86%8C%E4%B8%AD%EF%BC%8C%E6%96%87%E6%A1%A3%E2%80%9CCodeWarrior%20Development%20Studio%20for%20Microcontrollers%20V10.x%20Targeting%20Manual%E2%80%9D%E8%A2%AB%E5%BC%95%E7%94%A8%E7%94%A8%E4%BA%8E%E6%AD%A4%E7%9B%AE%E7%9A%84%E3%80%82%E4%BD%86%E6%88%91%E6%89%BE%E4%B8%8D%E5%88%B0%E8%BF%99%E4%B8%AA%E6%96%87%E6%A1%A3%E3%80%82%3C%2FP%3E%3CP%3E%E5%85%88%E8%A1%8C%E8%87%B4%E8%B0%A2%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E