EWL for Kinetis Development

Codewarrior GCC ARM Build Tools use EWL (Embedded Warrior Library) as a default library. EWL library set aims at reducing the memory footprint taken by IO operations and introduces a simpler memory allocator. To use newlib available with GCC instead of EWL, refer to the topic: Convert Kinetis Project to use newlib instead of EWL.

EWL Librarian I/O model is divided into 6 modes for C language:

Similarly, for C++, 6 sets of Librarian modes are supported.
  • ewl_c++
  • ewl_c++_hosted
  • ewl_c++_noio
  • c9x_c++
  • c9x_c++_hosted
  • c9x_c++_noio
The I/O modes can be selected depending on requirement while creating the project as illustrated below.
Figure 1. Language and Build Tools Options
Language and Build Tools Options
Following library configurations are selected depending on the I/O mode:
  • UART (default) - Librarian Model as ‘ewl’.
  • Debugger Console - Librarian Model as ‘ewl_hosted’ .
  • No I/O- Librarian Model as ‘ewl_noio’.
Similarly when C++ language is selected, c++ versions are picked.
Note: For UART I/O mode, additional configuration is required. For details, refer Set up UART Connections.
Following image shows compiler settings showing Librarian Model and its modes.
Figure 2. Compiler Settings - Librarian Model
Compiler Settings - Librarian Model
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
The above options can be selected at Print Formats and Scan Formats drop down box provided under Librarian panel. This is shown below.
Figure 3. Compiler Settings - Print Formats
Compiler Settings - Print Formats
EWL libraries are prebuilt for several configurations. They are placed at [CW Install Dir]/MCU/ARM_GCC_Support/ewl/lib. Library is built for cortex-m0 and cortex-m4 ARM targets.
  1. armv6-m for cortex-m0 and
  2. armv7e-m for cortex-m4
    1. armv7e-m- Software floating-point
    2. armv7e-m/fpu- Hardware floating-point with hardware FP ABI
    3. armv7e-m/softfp- Hardware floating-point with soft FP ABI
    4. armv7e-m/spfp- Same as softfp but built with –fshort-double enabled, where double has same size as float.
Each target lib has following components:
  • libc.a - c library
  • libc99.a - c library with c99 support
  • libc++.a- c++ library
  • libstdc++.a- c++ with c99 support
  • libhosted.a- library for console i/o(hosted) mode
  • libuart.a- library for UART mode
  • libm.a- math library
  • librt.a- ewl runtime library containing ARM specific runtime support.

EWL sources are present at [CW Install Dir]/MCU/ARM_GCC_Support/ewl. User can rebuild library using existing makefiles. This can be done in two ways.