Unable to use EWL Extras-library even after enabling it.

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

Unable to use EWL Extras-library even after enabling it.

1,126 Views
cbhavi
Contributor III

Hello,

 

I am using a Coldfire V2 controller with Codewarrior v10.5(eclipse IDE).

I have enabled the extras-library of EWL and rebuilt the C-library. I am able to access some of the functions, ex. 'itoa', from the extras library after this.

However, if i try to access string related functions, i receive the following errors,

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

>Undefined : "stricmp"

>Referenced from "function1" in

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

>Undefined : "strupr"

>Referenced from "function2" in

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

>Link failed.

Errors caused tool to abort.

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


Any ideas what could be causing this?

 

I explicitly included extras_string.h header into the file, and it still doesnt work.

Appreciate some help.

 

Thanks.

 

Regards,

Bhavya.

Labels (1)
0 Kudos
6 Replies

758 Views
trytohelp
NXP Employee
NXP Employee

Hi Bhavya,

With MCU V10.5, I've created a short example using the itoa function.

To execute and test the project I'm using the TWR-MCF5225x (based on MCF52259).

According to the EWL C Reference.pdf manual, page 348:

+++++++++++++++++

27.3.2 itoa()

This function converts an int value to a null-terminated character array.

#include <extras/extras_stdlib.h>

char * itoa(int val, char *str, int radix);

+++++++++++++++++

In my application I added:

      #include <extras/extras_stdlib.h>

No other action was done.

pastedImage_1.png

Attached you will find the example I've used.

Regards

Pascal

0 Kudos

758 Views
cbhavi
Contributor III

Hi Pascal,

Thanks for your reply.

I have had no trouble using/accessing the 'itoa' function or any of the extras_stdlib functions at all.

My trouble has been only with the functions defined in the extras_string.h header.

I imported the project you provided and added

     #include <extras/extras_string.h>

and tried to use the 'stricmp' function.

I get the same error as in my project.

Further the EWL C Reference.pdf mentions the following about the 'stricmp' function...

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

27.5.4 stricmp()

String comparison that ignores letter case.

#include <extras/extras_string.h>

int stricmp(const char *s1,const char *s2);

Parameter s1 A pointer to a null-terminated character string.

                s2 A pointer to a null-terminated character string.

Remarks

This function returns one of these values:

• zero if all characters in s1 are identical to and appear in the same order as the characters in s2

• a negative value if the numeric value of first non-matching character in s1 is less than its counterpart in s2

• a positive value if the numeric value of first non-matching character in s1 is greater than its counterpart in s2. This facility may not be available on some configurations of the EWL.

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

Do you have any idea what configuration of the EWL they are talking about? May be that's the reason i am unable to get it to work.

For reference, I am using the libc.a and librt.a libraries for Coldfire v2 MCU with the macro _EWL_NEEDS_EXTRAS defined for the C-library.

Thanks and Regards,

Bhavya.

0 Kudos

758 Views
trytohelp
NXP Employee
NXP Employee

Hi Bhavya,

I've found interesting info provided to another customer by a colleague.

Instead of to rebuild the EWL lib, the other solution is to add the source file directly in your project.

      \ColdFire_Support\ewl\EWL_C\src\extras\extras.c

      \ColdFire_Support\ewl\EWL_C\include\extras\extras_string.h

extras.c file which is located in C:\Freescale\CW MCU v10.5\MCU\ColdFire_Support\ewl\EWL_C\src\extras

You can copy this file directly under your project Source Folder.

Then the file will be automatically updated in the project source.

Attached you will find the project I used for example.

After to have added the extras.c file, I can build the application.

Hope this will help.

pastedImage_15.png

Regards

Pascal

0 Kudos

758 Views
cbhavi
Contributor III

Hi Pascal,

This, of course, works like a charm! Thank you! :smileyhappy:

But, isn't this more like a workaround than a solution?

I would expect an IDE/compiler like Codewarrior to provide a way to access all of its extras function through the library files instead of having to copy every file/function that it doesnt link to.

There had been absolutely no trouble with this in the previous versions (during the age of the Classic IDE). I wonder why its cropping up now in this version(the Eclipse IDEs).

Regards,

Bhavya.

0 Kudos

758 Views
trytohelp
NXP Employee
NXP Employee

Hi Bhavya,

I've checked with the compiler team.

+++++++++++++++++++++++++

The ‘extras’ library (official name ‘EWL Extras Library’ as described in the EWL reference manual in CW layout) are not delivered built as default in CW for MCU.

There are two options to use them:

  • use the source file directly in the project (as you tried)
  • rebuild the library with the ‘extras’ support

The library rebuild with ‘extras’ requires using “_EWL_NEEDS_EXTRAS“ defined to 1 (as specified in the EWL reference manual), but it also requires few changes in the

‘EWL_C.CF.mak’ in ‘MCU\ColdFire_Support\ewl\EWL_C’ (basically uncomment the lines where ‘extras’ is found).

+++++++++++++++++++++++++

The old versions (based on Classic IDE) used MSL libraries.

The more recent versions (last versions based on Classic IDE and all Eclipse versions) are using EWL libraries

Regards

Pascal

0 Kudos

758 Views
cbhavi
Contributor III

Hi Pascal,

That is exactly what I did.

From my original post "I have enabled the extras-library of EWL and rebuilt the C-library".

I am able to use all other extras functions except for the ones related to string operations.

The things I did to enable the extras library are as follows,

1. define _EWL_NEEDS_EXTRAS to 1 in lib_ewl.prefix file.

2. add the path to the extras.h file to the project.

3. Uncomment the line including extras path in the EWL_C.CF.mak file.

4. Build target 'CF_EWL_C'

The project built without any errors.

Am I missing something here?

Thanks and Regards,

Bhavya

0 Kudos