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

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

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

Jump to solution
4,160 Views
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 Kudos
Reply
1 Solution
4,123 Views
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

View solution in original post

2 Replies
4,124 Views
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,131 Views
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%20-%20Where%20can%20I%20find%20information%20on%20the%20linker%20parameter%20file%20(*.prm)%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1904487%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3CBR%20%2F%3EI'm%20developing%20firmware%20for%20MM9Z1x638%20MCU%20using%20CodeWarrior.%20One%20part%20of%20the%20project%20is%20placing%20data%20at%20a%20specific%20address%20in%20EEPROM%20(integrated%20in%20MCU).%20Using%20%22%23pragma%20DATA_SEG%20EEPROM_DATA%22%20I'm%20able%20to%20place%20a%20global%20data%20structure%20in%20EEPROM.%20But%20this%20way%2C%20linker%20decides%20about%20the%20start%20address%20and%20I%20cannot%20pretend%20it.%3C%2FP%3E%3CP%3EIf%20I%20would%20use%20GNU%20C%20toolchain%20I%20would%20define%20a%20label%20in%20the%20linker%20script%20for%20placement%20at%20a%20specific%20address.%20Using%20CodeWarrior%20I%20could%20only%20find%20a%20*.prm%20command%20file%20for%20linker.%20Where%20can%20I%20find%20information%20on%20its%20syntax%20(e.g.%20defining%20labels)%3F%20In%20the%20compiler%20manual%20the%20document%20%22CodeWarrior%20Development%20Studio%20for%20Microcontrollers%20V10.x%20Targeting%20Manual%22%20is%20referenced%20for%20this%20purpose.%20But%20I%20cannot%20find%20this%20document.%3C%2FP%3E%3CP%3EThanks%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1905268%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S12Z%20-%20Where%20can%20I%20find%20information%20on%20the%20linker%20parameter%20file%20(*.prm)%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1905268%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%23pragma%20DATA_SEG%20EEPROM_DATA%20is%20recommended%20approach.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EYou%20can%20define%20multiple%20segments%20for%20each%20object%20to%20be%20placed%20at%20specific%20address.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThere%20is%20an%20alternative%20way%20using%26nbsp%3B%40%20operator%20-%20this%20bypasses%20the%20.prm%20file%20and%20alocate%20an%20absolute%20address%20section%20at%20defined%20address.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23include%20%3CHIDEF.H%3E%20%2F*%20for%20EnableInterrupts%20macro%20*%2F%0A%23include%20%22derivative.h%22%20%2F*%20include%20peripheral%20declarations%20*%2F%0A%0A%23define%20EEPROM_TEST%200x10008%0Aunsigned%20int%20EE_Test%20%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F23898%22%20target%3D%22_blank%22%3E%40EEprom%3C%2FA%3E_TEST%3B%3C%2FHIDEF.H%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EIn%20Map%20file%20you%20should%20see%20this%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22stanish_0-1720611177057.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22stanish_0-1720611177057.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F287941i7BF45A894944EF10%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22stanish_0-1720611177057.png%22%20alt%3D%22stanish_0-1720611177057.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3Ehope%20it%20helps.%3C%2FP%3E%0A%3CP%3EStan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1905136%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S12Z%20-%20Where%20can%20I%20find%20information%20on%20the%20linker%20parameter%20file%20(*.prm)%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1905136%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EThere%20are%20compiler%20and%20target%20manual%20in%20the%20installation%20directory.%3C%2FP%3E%0A%3CP%3Ec%3A%5C......%5CCW%20MCU%20v11.1%5CMCU%5CHelp%5CPDF%5C%3C%2FP%3E%0A%3CP%3EI%20have%20also%20asked%20our%20CW%20expert%20for%20additional%20info.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3ELadislav%3C%2FP%3E%3C%2FLINGO-BODY%3E