Linker file

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

Linker file

445 Views
Aswin_5232
Contributor II

I am trying to port code from cosmic to CodeWarrior 5.2 for HCS12 controller, when I am trying to use #pragma CODE_SEG PAGE_32 to make a function under section PAGE 32 ,only the section is getting updated in map file, starting address remains unchanged.

Tags (1)
0 Kudos
Reply
1 Reply

425 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @Aswin_5232,

You did not specify the part number of the MCU.

Use something like this instead:

Linker:

SEGMENTS
    PAGE_32 = READ_ONLY 0x8000 TO 0xBFFF PAGE 32;
END

PLACEMENT
    MyPage32Funcs INTO PAGE_32;
END
 
Main

#pragma CODE_SEG MyPage32Funcs
void MyFunc(void) { ... }
#pragma CODE_SEG DEFAULT

 

 

Regards,

Daniel

Any support, information, and technology (“Materials”) provided by NXP are provided AS IS, without any warranty express or implied, and NXP disclaims all direct and indirect liability and damages in connection with the Material to the maximum extent permitted by the applicable law. 
NXP accepts no liability for any assistance with applications or product design. Materials may only be used in connection with NXP products. Any feedback provided to NXP regarding the Materials may be used by NXP without restriction.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2315165%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELinker%20file%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2315165%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20trying%20to%20port%20code%20from%20cosmic%20to%20CodeWarrior%205.2%20for%20HCS12%20controller%2C%20when%20I%20am%20trying%20to%20use%26nbsp%3B%23pragma%20CODE_SEG%20PAGE_32%20to%20make%20a%20function%20under%20section%20PAGE%2032%20%2Conly%20the%20section%20is%20getting%20updated%20in%20map%20file%2C%20starting%20address%20remains%20unchanged.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2315707%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Linker%20file%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2315707%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F259706%22%20target%3D%22_blank%22%3E%40Aswin_5232%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EYou%20did%20not%20specify%20the%20part%20number%20of%20the%20MCU.%3C%2FP%3E%0A%3CP%3EUse%20something%20like%20this%20instead%3A%3C%2FP%3E%0A%3CP%3ELinker%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3C!--ScriptorStartFragment--%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3ESEGMENTS%0A%20%20%20%20PAGE_32%20%3D%20READ_ONLY%200x8000%20TO%200xBFFF%20PAGE%2032%3B%0AEND%0A%0APLACEMENT%0A%20%20%20%20MyPage32Funcs%20INTO%20PAGE_32%3B%0AEND%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CSPAN%3EMain%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%0A%3CP%3E%3CSPAN%3E%3C!--ScriptorStartFragment--%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%0A%3CDIV%20class%3D%22scriptor-paragraph%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23pragma%20CODE_SEG%20MyPage32Funcs%0Avoid%20MyFunc(void)%20%7B%20...%20%7D%0A%23pragma%20CODE_SEG%20DEFAULT%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3EDaniel%3C%2FP%3E%0A%3CPRE%3EAny%20support%2C%20information%2C%20and%20technology%20(%E2%80%9CMaterials%E2%80%9D)%20provided%20by%20NXP%20are%20provided%20AS%20IS%2C%20without%20any%20warranty%20express%20or%20implied%2C%20and%20NXP%20disclaims%20all%20direct%20and%20indirect%20liability%20and%20damages%20in%20connection%20with%20the%20Material%20to%20the%20maximum%20extent%20permitted%20by%20the%20applicable%20law.%20%3CBR%20%2F%3ENXP%20accepts%20no%20liability%20for%20any%20assistance%20with%20applications%20or%20product%20design.%20Materials%20may%20only%20be%20used%20in%20connection%20with%20NXP%20products.%20Any%20feedback%20provided%20to%20NXP%20regarding%20the%20Materials%20may%20be%20used%20by%20NXP%20without%20restriction.%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E