cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
11,640 Views
Registered: ‎05-12-2012

xil_printf

Hello. It seems that in new release of software several functions have been removed from library such as xil_printf(), putnum() and print(). Can anyone answer me why?

0 Kudos
13 Replies
Highlighted
Explorer
Explorer
11,616 Views
Registered: ‎08-13-2010

Re: xil_printf

which version???

0 Kudos
Highlighted
Adventurer
Adventurer
11,612 Views
Registered: ‎05-12-2012

Re: xil_printf

14.1

0 Kudos
Highlighted
Explorer
Explorer
11,588 Views
Registered: ‎08-13-2010

Re: xil_printf

have you executed these functions in your code?is there any error?
If you did not get any error msg then there must be some other problems. you can try sendbyte function
0 Kudos
Highlighted
Visitor
Visitor
11,585 Views
Registered: ‎05-22-2012

Re: xil_printf

Hy!

 

 

I just (today) updated from 13.4 to 14.1 and I can confirm the same "dissapear" of these functions. Same program yesterday was compiled succesfully today results in

 

error: ‘xil_printf’ was not declared in this scope

 

0 Kudos
Highlighted
Adventurer
Adventurer
11,571 Views
Registered: ‎05-12-2012

Re: xil_printf

I had to manually edit stdio.h to obtain this functions, i.e. in object file this function exist, but do not declared in header.

0 Kudos
Highlighted
Visitor
Visitor
11,567 Views
Registered: ‎05-22-2012

Re: xil_printf

Could you please paste here "your" declaration of xil_printf into stdio.h (and also that where did you put it)?

0 Kudos
Highlighted
Adventurer
Adventurer
11,564 Views
Registered: ‎05-12-2012

Re: xil_printf

void _EXFUN(xil_printf, (const char*, ...));
void _EXFUN(putnum, (unsigned int ));
void _EXFUN(print, (char* ));

0 Kudos
Highlighted
Visitor
Visitor
11,563 Views
Registered: ‎05-22-2012

Re: xil_printf

Ok, so I can confirm that it's "only" the stdio.h" which lacks of the declaration of the xil_printf function

 

A possible workaround for this is to paste the line 

 

void    _EXFUN(xil_printf, (const char*, ...));

 

into the stdio.h file.

0 Kudos
Highlighted
Moderator
Moderator
11,504 Views
Registered: ‎06-29-2011

Re: xil_printf

Hi guys,

 

As you have noticed the xil_printf(), putnum() and print() have been removed from the stdio.h header file and this is why you are getting the error. Howver they have been added to another header file and if you created a new simple project in v14.1 of the tools you can verify this with a simple helloworld example using xil_printf(), putnum() and print().

 

I am currently looking for the header file that store these declarations in v14.1 of the tools and I will update this post when I have found it.

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

Kind regards,
Gareth
0 Kudos
Highlighted
Adventurer
Adventurer
7,014 Views
Registered: ‎08-16-2007

Re: xil_printf

I did a search on all *.h files in EDK 14.1. Those definitions are now in the powerpc stio.h files only. I wonder what good reason could have been to remove them from microblaze and arm stdio.h.

A hello world app for arm inserts a print definition above the main.

 

0 Kudos
Highlighted
Moderator
Moderator
6,946 Views
Registered: ‎06-29-2011

Re: xil_printf

 

UI can see the xil_printf getting built in the BSP:

C:\Xilinx\14.1\ISE_DS\EDK\sw\lib\bsp\standalone_v3_05_a\src\cortexa9

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

Kind regards,
Gareth
0 Kudos
Highlighted
Moderator
Moderator
6,902 Views
Registered: ‎06-29-2011

Re: xil_printf

There is a bug n the 14.1 stdio.h file, where the xil_printf declaration is missing.

 

To workaround this issue; either use the print function, Or manually copy the xil_printf declaration

into the GNU folder.

 

For example for on a  win7 install, firstly, open the Microblaze include folder and open the stdio.h file:

C:\Xilinx\14.1\ISE_DS\EDK\gnu\microblaze\nt64\microblaze-xilinx-elf\include

 

Then add the line below into line 230, in the stdio.h file.

void    _EXFUN(xil_printf, (const char*, ...));

 

Once this is done, clean all applications, and BSP's in SDK.

 

This issue is resolved in 14.2

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

Kind regards,
Gareth
0 Kudos
Highlighted
Adventurer
Adventurer
6,584 Views
Registered: ‎05-11-2010

Re: xil_printf

Another way to get xil_printf is to declare it manually in your C source instead of including the header.  This is, instead of using

#include <stdio.h>

the function can be directly declared by using

void xil_printf(const char *, ...) __attribute__ ((format (printf, 1, 2)));

As a side effect, this provides an easy way to suppress all output (which I've found useful in some programs that don't run if xil_printf is used and the JTAG cable is not plugged) without deleting/commenting all lines with xil_printf (which are useful to keep for debugging purposes), just replacing that line with

#define xil_printf(...)

Right now this is the way I'm using on my C files.

 

P.S.:  Where is the xil_printf() declaration supposed to be now (14.2 and newer)?  Still in stdio.h, or has it moved somewhere else?

0 Kudos