error reported while compiling a s912zvmc25 project with CW 11.1

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

error reported while compiling a s912zvmc25 project with CW 11.1

323 Views
steven_zhang
Contributor V

I tried to campile a EPS project witch is base on the ZVMC25,getting the following error.

Fixup overflow in main, to a type 1, at offset 0x3

the the attachment is a simplified project which has the similar problem。

0 Kudos
1 Reply

265 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

The issue is based on variable allocation out of selected memory model range (address 0x4000 and above).

Your project uses a small memory model, where the compiler is optimized for faster execution with limited 14-bit RAM memory addressing range (0x0000~0x3FFF only).  ( check where stack is placed and its size)

If you would like to use RAM memory above 0x4000, you should select a medium memory model.

Menu-Project-Properties-C/C++ Build-Settings-S12Z Compiler-Code Generation-Memory Model …

 

If you modify this memory model, you should also include correct libraries which are compiled for the same memory model as ANSI lib or AMMCLib (modify library paths).

For example, the ANSI library for the medium model will be at:

"c:\Freescale\CW MCU v11.0\MCU\S12lisa_Support\s12lisac\lib_medium\ansii.lib"

Optionally, you may create a new project and select the medium memory model in the project wizard.

 

Unfortunately, the current version of AMMCLib(1.1.15) supports only small memory model, however, the new version 1.1.17 (which supports medium memory model) should be released during this week.

Please download the new version when it will be released:

https://www.nxp.com/support/developer-resources/run-time-software/automotive-software-and-tools/auto...

 

new path to the AMMCLib will be:

c:\NXP\AMMCLIB\MC9S12ZVM_AMMCLIB_v1.1.17\lib\cw10x\MC9S12ZVM_AMMCLIB.MEDIUM.UC.a

 

The paths to the AMMClib are defined by default at three places in project settings:

Menu-Project-Properties-C/C++ Build-Settings-S12Z Linker-Input-Libraries

Menu-Project-Properties-C/C++ Build-Settings-S12Z Compiler-Access Paths-Search User Paths

Menu-Project-Properties-C/C++ Build-Settings-S12Z Assembler-Input-Include File Search Path

 

 Best regards,

Ladislav

Note: The execution time for some functions are longer when we use medium memory model instead of the small memory model. However, other more complex functions are executed faster. According to our testing at motor control application, the differences between the small and medium model in execution time are negligible.

0 Kudos