Cosmic UK Cosmic US Cosmic Germany Cosmic Italia Cosmic France


Cosmic Software Frequently Asked Questions


HC12: no default placement for .ftext


Q. I recently upgraded my HC12 compiler and I rebuilt my application and I am receiving a linker error “no default placement for .ftext”

A. There are a few compiler changes starting with V4.6A that require some changes to link files and compiler options for applications created with prior compiler versions.
  • Compilers versions starting with V4.6a now compile for the HCS12 family by default so the +mcs option is no longer needed. If you are using an HC12 part then you need to use the +std option to compile for the older HC12 family.
  • In order to allow paged constants and improve cross bank checking we’ve added a new section to the compiler named .ftext for far text. This differentiates paged code from nonpaged code in the linker. Typically, the easiest thing to do when porting an older application to V4.6+ is to simply change the section name .text in all paged code segments to .ftext and leave the fixed page section names as .text. Alternatively, you could add the +nofts compiler option to use .text for paged code similar to the previous behavior. However you won’t be able to take advantage of far constants or enhanced cross bank checking when using the +nofts option.
  • If you are using the eeprom programming feature then you will need to link the appropriate library before the ANSI libraries. E.g. for most HCS12 processors the lib order should be:
\lib\libe.h12    # HCS12 EEPROM write Libraries (libb.h12 is for most HC12 processors liba.h12 is for HC12DG128A)
\lib\libd.h12    # This library is only needed if double float ANSI C library functions are used.  Remove when Libf is used  
\lib\libf.h12    # This library is only needed if Single float ANSI C library functions are used AND +sprec option is used  
\lib\libi.h12    # Integer only ANSI C library  
\lib\libm.h12