Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).
|
Hi all, Does any of you know how to create a kind of "reference only" sections with MOT V1.2 Metrowerks Compiler & Linker. With "reference only" I mean sections were the linker calculates the object addresses but does not generate any code. For example, for objects placed in an external I2C eeprom, I need to know the object addresses but I don't need any space allocation, I use to do this in the 2500AD assembler using "reference only" sections. I know about the Metrowerks "NO_INIT" sections and I use them to define internal EEPROM, but these kind of sections can't overlap. Maybe there is a very simple way to do this in C, but I don't imagine it. Any suggestion will be appreciated. Thanks in advance, Regards, Guillermo Molina. Buenos Aires. ARGENTINA [Non-text portions of this message have been removed] |
|
|
|
Here is how you can call a function and accessing an object without allocating it: #define erase ((void(*)(void))(0xfc06)) #define MyAbsVar (*(char*)(0x1344)) void main(void) { erase(); /* call function at address 0xfc06 */ MyAbsVar = 5; /* store at address 0x1344 */ } Erich > -----Original Message----- > From: Guillermo F. Molina [mailto:] > Sent: Samstag, 1. Marz 2003 17:02 > To: > Subject: [68HC12] "Reference Only" sections in Metrowerks MOT V1.2 > Hi all, > > Does any of you know how to create a kind of "reference only" > sections with MOT V1.2 Metrowerks Compiler & Linker. > With "reference only" I mean sections were the linker calculates > the object addresses but does not generate any code. For example, > for objects placed in an external I2C eeprom, I need to know the > object addresses but I don't need any space allocation, I use to > do this in the 2500AD assembler using "reference only" sections. > I know about the Metrowerks "NO_INIT" sections and I use them to > define internal EEPROM, but these kind of sections can't overlap. > Maybe there is a very simple way to do this in C, but I don't imagine it. > Any suggestion will be appreciated. > Thanks in advance, > > Regards, > > Guillermo Molina. > Buenos Aires. > ARGENTINA > > > [Non-text portions of this message have been removed] > > -------------------------------------------------------- > To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit > http://www.motorola.com/mcu |
|
|
|
- PAGED sections are NO_INIT sections which are allowed to overlap. Use it instead of
the NO_INIT. - I think you can also change the linker messages to link anyway, even if NO_INIT's do overlap. Bye Daniel > -----Original Message----- > From: Erich Styger [mailto:] > Sent: Thursday, March 06, 2003 9:06 > To: > Subject: RE: [68HC12] "Reference Only" sections in Metrowerks MOT V1.2 > Here is how you can call a function and accessing an object > without allocating it: > > #define erase ((void(*)(void))(0xfc06)) > #define MyAbsVar (*(char*)(0x1344)) > > void main(void) { > erase(); /* call function at address 0xfc06 */ > MyAbsVar = 5; /* store at address 0x1344 */ > } > > Erich > > > -----Original Message----- > > From: Guillermo F. Molina [mailto:] > > Sent: Samstag, 1. Marz 2003 17:02 > > To: > > Subject: [68HC12] "Reference Only" sections in Metrowerks MOT V1.2 > > > > > > Hi all, > > > > Does any of you know how to create a kind of "reference only" > > sections with MOT V1.2 Metrowerks Compiler & Linker. > > With "reference only" I mean sections were the linker calculates > > the object addresses but does not generate any code. For example, > > for objects placed in an external I2C eeprom, I need to know the > > object addresses but I don't need any space allocation, I use to > > do this in the 2500AD assembler using "reference only" sections. > > I know about the Metrowerks "NO_INIT" sections and I use them to > > define internal EEPROM, but these kind of sections can't overlap. > > Maybe there is a very simple way to do this in C, but I don't imagine it. > > Any suggestion will be appreciated. > > Thanks in advance, > > > > Regards, > > > > Guillermo Molina. > > Buenos Aires. > > ARGENTINA > > > > > > > > > > [Non-text portions of this message have been removed] > > > > > > > > -------------------------------------------------------- > > To unsubscribe from this group, send an email to: > > > > > > To learn more about Motorola Microcontrollers, please visit > > http://www.motorola.com/mcu > > > > > > > > > > > > > > -------------------------------------------------------- > To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit > http://www.motorola.com/mcu > |
|
|
|
Dear Daniel and Erich, Thank you very much for your help. I will try to setup the linker to use overlaping NO_INIT sections and see what happens. Regards, Guillermo. On 6 Mar 2003 at 12:45, Daniel Friederich wrote: > - PAGED sections are NO_INIT sections which are allowed to overlap. Use it instead of the NO_INIT. > - I think you can also change the linker messages to link anyway, even if NO_INIT's do overlap. > > Bye > > Daniel > > -----Original Message----- > > From: Erich Styger [mailto:] > > Sent: Thursday, March 06, 2003 9:06 > > To: > > Subject: RE: [68HC12] "Reference Only" sections in Metrowerks MOT V1.2 > > > > > > Here is how you can call a function and accessing an object > > without allocating it: > > > > #define erase ((void(*)(void))(0xfc06)) > > #define MyAbsVar (*(char*)(0x1344)) > > > > void main(void) { > > erase(); /* call function at address 0xfc06 */ > > MyAbsVar = 5; /* store at address 0x1344 */ > > } > > > > Erich > > > > > -----Original Message----- > > > From: Guillermo F. Molina [mailto:] > > > Sent: Samstag, 1. Marz 2003 17:02 > > > To: > > > Subject: [68HC12] "Reference Only" sections in Metrowerks MOT V1.2 > > > > > > > > > Hi all, > > > > > > Does any of you know how to create a kind of "reference only" > > > sections with MOT V1.2 Metrowerks Compiler & Linker. > > > With "reference only" I mean sections were the linker calculates > > > the object addresses but does not generate any code. For example, > > > for objects placed in an external I2C eeprom, I need to know the > > > object addresses but I don't need any space allocation, I use to > > > do this in the 2500AD assembler using "reference only" sections. > > > I know about the Metrowerks "NO_INIT" sections and I use them to > > > define internal EEPROM, but these kind of sections can't overlap. > > > Maybe there is a very simple way to do this in C, but I don't imagine it. > > > Any suggestion will be appreciated. > > > Thanks in advance, > > > > > > Regards, > > > > > > Guillermo Molina. > > > Buenos Aires. > > > ARGENTINA > > > > > > > > > > > > > > > [Non-text portions of this message have been removed] > > > > > > > > > > > > -------------------------------------------------------- > > > To unsubscribe from this group, send an email to: > > > > > > > > > To learn more about Motorola Microcontrollers, please visit > > > http://www.motorola.com/mcu > > > > > > > > > > > > > > > > > > > > > > > > > > > > -------------------------------------------------------- > > To unsubscribe from this group, send an email to: > > > > > > To learn more about Motorola Microcontrollers, please visit > > http://www.motorola.com/mcu > > > > > > > > > > -------------------------------------------------------- > To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit > http://www.motorola.com/mcu > |