How to refer to external C functions of CW Project A from CW project B

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

How to refer to external C functions of CW Project A from CW project B

1,618 Views
timo_schuering
Contributor II

Hi All, 

I am new to Freescale Codewarrior and so far have been able (after some hassle with asm to c and vice versa compatibility issues) to compile and run dBUG for an SenTec MCF5475 board using version CodeWarriar 5.9.0. What I am wondering is whether CodeWarrior can be configured to use some of the dBUG functions (mainly print functions) using a different CodeWarrior project as an application or external extension to dBUG.

I understand that xMap files are written out. Can you write another export file for the symbols.

Can they be imported or referenced to? So far I did not find any explanation for that. Do I need to define it manually in the linker command  file?

If you write your own HW scheduler, you would have the some problem. You need to have the external references somehow defined.

Thanks and Regards!

Labels (1)
5 Replies

1,467 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

I checked the dBUG firmware development file, which mentioned there provides a dBUG project based on CodeWarrior IDE:

pastedImage_1.png

If customer could find related dBUG project and using that project to do the porting work.

I attached  dBUG firmware development file for your reference.

Thanks for the attention. 


Have a great day,
Mike

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

1,467 Views
timo_schuering
Contributor II

Ni Hao Mike,

thank you. My situation is a bit different: I have a successful working dBUG implemention on my board. dBUG stuff already set-ups everything. So far so good. I can download software. Also good. But I want to use the already loaded dBUG functions like printf and so on. This means I need to now and declare the printf location inside a code-warrior project. Is this possible?

0 Kudos

1,467 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hello Timo,

When customer create a new project with CodeWarrior for MCU V11.1, customer can enable below macro in below files to enable printf() using UART:

<exeptions.c> 

#define NO_PRINTF    0

#define CONSOLE_IO_SUPPORT  1 

<support_common.h>

/* Enable UART Support. */
#define ENABLE_UART_SUPPORT 1

Customer could try if printf() function works with related board.

best regards,

Mike

0 Kudos

1,467 Views
timo_schuering
Contributor II

Hi Mike,

I am able to add an overlay SW using GCC, where I define the external symbols (from a CW project) and compile with bare-metal options. That GCC-SW I can upload and use the functions provided by CW -SW, e.g. printing and use the interrupt handler framework.

So why I can't do this within CW? My imagination would be to add the Map-file from CW project-A and the prototypes as C-Header files to a CW project B and then work with it and generate an overlay binary or S19 of project B.

Best

Timo

0 Kudos

1,467 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Timo,

The CodeWarrior C and C++ compilers use the Embedded Warrior Library (EWL) for C to provide and extend the libraries documented in the ISO/IEC standards for C.

I checked there with below description about reentrant Functions from EWL C Reference Manual:

pastedImage_2.png

Please check if EWL library affected GCC call related functions.

Best regards,

Mike