AnsweredAssumed Answered

MQX 4.1 using EWL (Embedded Warrior Libraries)

Question asked by Jason Smathers on Feb 9, 2015
Latest reply on Feb 18, 2015 by Carlos_Musich

I am porting an MQX 3.7 ColdFire application to MQX 4.1 and I am having issues building with the EWL libraries, which we are using with the MQX 3.7 application. 

 

Currently I am simply trying to create a new basic MQX 4.1 project using the project wizard (in CodeWarrior 10.6) with the Librarian model set to “ewl” (int_FP, int_FP, buffered) and I am still getting build errors.  I can change the Librarian model back to “c9x” and all builds fine, however for my application I need the smaller memory footprint advantage of the ewl libraries so I don’t believe c9x will work.  FYI, I found the following thread on the Freescale community forums, however I don’t need to use C++ and the issues described are different than what I am experiencing so they don’t help.

https://community.freescale.com/thread/305191

 

Here are the steps I follow to reproduce the build error:

  1. In CodeWarrior click File->New->MQX 4.1 Project
  2. Enter a name and select “TWRMCF52259 Board”.
  3. Select application type: “New application”
  4. Do not select any of the additional MQX libraries.
  5. Select application type: “Empty application”
  6. Don’t add any more files to the project and click Finish.
  7. Set “twrmcf52259_Int_Flash_Release” as the active Build Configuration (Note: I have already successfully built release builds of the BSP, PSP, etc)
  8. Clean/Build the project. The project builds successfully.
  9. Under project properties, change the Librarian model from “c9x” to “ewl” (int_FP, int_FP, buffered).
  10. Clean/Build the project.  The build fails with the following error:

 

---------------------------------------------------------------------------------------------------------------------------------

**** Build of configuration twrmcf52259_Int_Flash_Release for project appl ****

 

"C:\\Freescale\\CW MCU v10.6\\gnu\\bin\\mingw32-make" -j16 all

'Building file: ../Sources/main.c'

'Executing target #1 ../Sources/main.c'

'Invoking: ColdFire Compiler'

"C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwccmcf" @@"Sources/main.args" -o "Sources/main_c.obj" "../Sources/main.c" -MD -gccdep

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwccmcf|Compiler|Error

(C:\Sandbox\New_HIC_MQX_4_1_1\appl\twrmcf52259_Int_Flash_Release\(command-line defines)|1|8|8|8|8)

=#define _EWL_C99 1

>macro '_EWL_C99' redefined

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwccmcf|Compiler|Note

(C:\Freescale\CW MCU v10.6\MCU\ColdFire_Support\ewl\EWL_C\include\lib_ewl.prefix|19|9|8|496|8)

= #define _EWL_C99    0 /* EWL is not C99 compliant  */ 

>    (location of previous definition)

 

Errors caused tool to abort.

mingw32-make: *** [Sources/main_c.obj] Error 1

---------------------------------------------------------------------------------------------------------------------------------

 

11. It seems that the lib_ewl.prefix file is not aware that “_EWL_C99” is defined in my project.  I can manually edit the prefix file to add “#define _EWL_C99  1” and I am able to build successfully.  However, this only works with this very basic MQX 4.1 project that I have created.  If I follow the same steps above, but also select “Add Shell support” and “Add RTCS support” … and also select “Basic Application” in the new MQX 4.1 Project wizard, I get the following build errors (assuming I have again edited the lib_ewl.prefix to define _EWL_C99 as 1):

 

---------------------------------------------------------------------------------------------------------------------------------

'Building target: appl.elf'

'Executing target #4 appl.elf'

'Invoking: ColdFire Linker'

"C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf" -o "appl.elf" @@"appl.args" 

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "__ctype_mapC"

>Referenced from "isdigit" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "__ctype_mapC"

>Referenced from "isupper" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "__ctype_mapC"

>Referenced from "isxdigit" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Undefined : "__lower_mapC"

>Referenced from "tolower" in

C:/Freescale/CW MCU v10.6/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf|Linker|Error

>Link failed.

 

Errors caused tool to abort.

mingw32-make: *** [appl.elf] Error 1

---------------------------------------------------------------------------------------------------------------------------------

 

 

I have not been able to get past these build errors. I have even tried unchecking the “Enable automatic library configurations” under the Librarian options and manually adding the libc.a and librt.a from the “C:\Freescale\CW MCU v10.6\MCU\ColdFire_Support\ewl\lib\v2” directory and I get basically the same build errors.  FYI, here are the Compiler Preprocessor defines that I am using (which are the defaults when creating a new MQX 4.1 project):

_EWL_C99=1

_EMBEDDED_WARRIOR_CTYPE=0

_EWL_FLOATING_POINT=1

__CODEWARRIOR__=1

Outcomes