64-bit Math MCF5441x and CW 10.3 -- _EWL_LONGLONG

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

64-bit Math MCF5441x and CW 10.3 -- _EWL_LONGLONG

Jump to solution
995 Views
stevejanisch
Contributor IV

The MCF54418 I am working on appears to have 64-bit math support in CW 10.3.

 

I've tested a lot of 64-bit math and it all appears to work fine.

 

But I am having trouble with using some of the canned 64-bit library functions, e.g. lldiv and llabs

 

This isn't a major issue, since these functions can be coerced in other ways, but it would just be cleaner if I could use them and I'm not sure exactly how to enable them.

 

For example, I can define these structures

  div_t     dt ;

  ldiv_t    ldt ;

  lldiv_t   lldt ;

  

but the lldiv_t will not compile.

 

When I followed the structure definitions to div_t.h it appeared that _EWL_LONGLONG was not defined.

 

But even when I added

#define _EWL_LONGLONG 1

to my program it wouldn't build.

 

I also added it to MCF54418.h and MCF54418_sysinit.h with no better luck...

 

The only place it IS defined is in ansi_params.h, with this block...

#ifndef _EWL_LONGLONG

  #if defined(__CWCC__)

   #if __option(longlong)

     #define _EWL_LONGLONG    1

   #else

     #define _EWL_LONGLONG    0

   #endif

#else

   #define _EWL_LONGLONG      0

#endif

#endif

 

I didn't want to change this file since it appears to be somewhat a standard code block, rather than a board-specific one.

    

So would anyone know where exactly would be the place to define _EWL_LONGLONG?

 

Labels (1)
0 Kudos
1 Solution
636 Views
Carlos_Musich
NXP Employee
NXP Employee

If you are using MQX you must rebuild the PSP library of MCF54418 with c9x library instead of default C++ library. You can do it by importing the psp project of MCF54418TWR from “\\Freescale MQX 3.8\mqx\build\cw10\psp_twrmcf54418” and checking the option “Enable automatic library configurations” to use “c9x”. Then you can just rebuild it. The new “bsp_twrmcf54418_d.a” will be linked with your project to let you use standard I/O.

View solution in original post

0 Kudos
5 Replies
636 Views
Carlos_Musich
NXP Employee
NXP Employee

Hello Steve,

To have your project working you should first go to menu Project > Properties > C/C++ Build > Settings > Librarian and set the Library Model to c9x. Then include in your file (main.c) the following sequence

#include <ansi_parms.h>

#include <div_t.h>

OR

#include <arith.h>

(<arith.h> includes both <ansi_parms.h> and <div_t.h>).

Hope this helps!

Carlos

636 Views
stevejanisch
Contributor IV

Thanks.  I'm not sure if what you suggest would work.  When I do set library model to c9x I get at least one other link error...

Undefined: "_ctypes_" Referenced from "isdigit" in

Not sure what it is referring to.  I don't recognize an "isdigit" function... must be in some library.

I'll do a bit more research since I'm not really sure what the different library models are doing.

Thanks for the feedback.

0 Kudos
636 Views
gnelly
Contributor I

I've just encountered the same problem you mention in your last post; Undefined : "_ctypes_" Referenced from "isdigit" and "isupper".

These are the last 2 build errors I have after spending a week porting a large M52259 MCU-based application from CodeWarrior 7.1/MQX 3.2 to CodeWarrior 10.4/MQX 4.0.1.

I have the Librarian set to use the "c9x" Model.  I wish there was some more info on how the system automatically selects the correct libraries to use after only specifying the ewl library location in the Library Search Paths.

Perhaps the ewl libraries need to be rebuilt??

0 Kudos
636 Views
dmarks_ls
Senior Contributor I

Bump.  I'm getting the exact same failure on a Kinetis K60 build with CW 10.4 and MQX 4.0.1.  I was trying to use some 64-bit routines (strtoull()) and ran into the ewl/c9x problem.  I just closed a ticket with support regarding the c9x library selection... in fact, it may have been the same Carlos who answered above.

I'm going to open a ticket, I'll report back with what I find.

0 Kudos
637 Views
Carlos_Musich
NXP Employee
NXP Employee

If you are using MQX you must rebuild the PSP library of MCF54418 with c9x library instead of default C++ library. You can do it by importing the psp project of MCF54418TWR from “\\Freescale MQX 3.8\mqx\build\cw10\psp_twrmcf54418” and checking the option “Enable automatic library configurations” to use “c9x”. Then you can just rebuild it. The new “bsp_twrmcf54418_d.a” will be linked with your project to let you use standard I/O.

0 Kudos