64-bit Math MCF5441x and CW 10.3 -- _EWL_LONGLONG

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

64-bit Math MCF5441x and CW 10.3 -- _EWL_LONGLONG

跳至解决方案
3,424 次查看
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?

 

标签 (1)
0 项奖励
回复
1 解答
3,065 次查看
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 项奖励
回复
5 回复数
3,065 次查看
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

3,065 次查看
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 项奖励
回复
3,065 次查看
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 项奖励
回复
3,065 次查看
dmarks_ls
Senior Contributor II

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 项奖励
回复
3,066 次查看
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 项奖励
回复