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.
解決済! 解決策の投稿を見る。
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:
hope it helps.
Stan
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:
hope it helps.
Stan