EWL for Kinetis Development

EWL introduces a new library set aiming at reducing the memory footprint taken by IO operations and introduces a simpler memory allocator.

The IO operations are divided in 3 categories: printing, scanning and file operations.

The printing and scanning formatters for EWL are grouped in an effort to provide only the support required for the application:

int - integer and string processing

int_FP - integer, string and floating point

int_LL - integer (including long long) and string

int_FP_LL - all but wide chars

c9x - all including wide char

The buffered IO can be replaced by raw IO, this works solely when printf and scanf are used to perform IO, all buffering is bypassed and writing direct to the device is used. EWL libraries contain prebuilt versions for all formatters and IO modes. Selecting a model combination enables correct compiling and linking. The EWL layout for Kinetis is built per core architecture. It is composed of:

libm.a - math support (c9x or not)

libc.a - non c9x std C libs

libc99.a - c9x libs

librt.a - runtime libraries

libc++.a - non-c9x matching c++ libraries

libstdc++.a - c9x/c++ compliant libs

FP_<ieee_conformance_type>_Thumb_<endian>_v7M.a

where <ieee_conformance_type> is fastI | fixedI | flush0 | fullI and <endian> is BE | LE.

Linker picks ' fastI' by default. If you need to use other ieee_conformance_type, you need to include corresponding library with -l option

For example: Add following in Properties > C/C++ > Build/Settings > ARM Linker > Additional Libraries.

"${MCU_TOOLS_HOME}\ARM_EABI_Support\ewl\lib\FP_fullI_Thumb_endian_v7M.a".

Selecting an EWL model for the libraries frees the user from adding libraries to the project, the linker will determine from the settings the correct library set, these settings are : processor, pid/pic, hard/soft FPU. Although the library names are known to the toolset but their location is not. The environment variable MWLibraries can specify the path to the lib hierarchy root, otherwise the -L linker option needs to point to the hierarchy

export MWLibraries=d:\CodeWarrior\MCU\ARM_EABI_Support\ewl\lib 
mwldarm ... -Ld:\CodeWarrior\MCU\ARM_EABI_Support\ewl\lib

Note that when using EWL and not using -nostdlib, MWLibraryFiles must not be defined since it conflicts with the known library names.

Note: For more information on the Embedded Warrior Library (EWL) for C or C++, see the following manuals: CodeWarrior Development Tools EWL C Reference and CodeWarrior Development Tools EWL C++ Reference.

Note that EWL C malloc is configured with _EMBEDDED_WARRIOR_MALLOC by default.

To aid this, linker defines following variables: