UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
9,365 Views
Registered: ‎02-27-2014

Printing messages from fsbl

How do I print log messages from FSBL? 

I have seen ps7_init.c and pc7_init.h files(generated when I create fsbl) having xil_printf statements. But these statements  are commented. When I uncommented it , the fsbl.elf wont form.

 

I even tried including xil_printf.h, but even now fsbl is not generated.  fsbl is generated only when xil_printf(,...)  are commented in the file ps7_init.c. 

 

Why it is happening ? How to correctly print messages from fsbl? 

0 Kudos
17 Replies
Xilinx Employee
Xilinx Employee
9,364 Views
Registered: ‎08-02-2007

Re: Printing messages from fsbl

Hi,

 

FSBL having debug prints enabled. #define FSBL_DEBUG_INFO in fsbl_debug.h

 

--Hem

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
9,348 Views
Registered: ‎02-27-2014

Re: Printing messages from fsbl

Thanks for your reply . I have tried editing fsbl_debug.h file but this file is generated after fsbl.elf file.

I have generated fsbl.elf using SDK and i found that fsbl_debug.h is generated along with fsbl.elf.

Where can i find fsbl_debug.h other than the folders containing fsbl.elf so that i can edit it and then generate fsbl.elf.

0 Kudos
Xilinx Employee
Xilinx Employee
9,337 Views
Registered: ‎08-02-2007

Re: Printing messages from fsbl

Hi,

 

The FSBL application is available at $SDK_2013.3_Install\sw\lib\sw_apps\fsbl\src

 

For 2014.1 then you need to go to SDK_2014.1/data/embeddedsw/lib/sw_apps/zynq_fsbl

 

--Hem

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
9,315 Views
Registered: ‎02-27-2014

Re: Printing messages from fsbl

I have made changes in fsbl_debug.h file as per guided by you. I have introduced some xil_printf() statements in the ps7_init.c file and i am able to built .elf file , BOOT.BIN file using .elf file.

 

Now , when i am booting it in flash , some unrecognised characters are appearing on the terminal and it is also not booting upto the end.

I want to printout my own statements using xil_printf by introducing these statements in ps7_init.c file so that i can see them on terminal. I have also used printf() in place of xil_print() but still i am not able to print any message on terminal .

 

Please suggest

0 Kudos
Xilinx Employee
Xilinx Employee
9,309 Views
Registered: ‎08-02-2007

Re: Printing messages from fsbl

Hi,

 

What are the messages seen on the console? Are you sure that the baud rate of the console is set properly?

 

Would that be possible to generate the BOOT.bin using some another ELF?

 

--Hem

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
9,306 Views
Registered: ‎02-27-2014

Re: Printing messages from fsbl

The following screenshot shows the weared characters I am getting:

 

 

 

 

.1.JPG

 

 

I just put one xil_printf here:

 

int
ps7_init() 
{
  // Get the PS_VERSION on run time
  unsigned long si_ver = ps7GetSiliconVersion ();
  int pcw_ver = 0;
  xil_printf ("\n PCW Silicon Version : %d.0", si_ver);

 The file ps7_int.c is attached here with also. 

 

 

I am sure baud rate is correct. Also BOOT.bin is generated with other fsbls where no xil_printf is uncommented.

 

(I observed that xil_print is commented by default) 

 

0 Kudos
Scholar sampatd
Scholar
9,298 Views
Registered: ‎09-05-2011

Re: Printing messages from fsbl

Are you booting from NAND flash?

If so, make sure that the boot image is put to the fist 128MB in NAND, the BootRom only searches a limited address.
0 Kudos
Explorer
Explorer
9,297 Views
Registered: ‎02-27-2014

Re: Printing messages from fsbl

sorry I forgot to attach the ps7_init.c file.

 

here it is:

0 Kudos
Explorer
Explorer
9,297 Views
Registered: ‎02-27-2014

Re: Printing messages from fsbl

The current Screenshot is from SD card. I understand fsbl 's ps7_init is independent of the boot media. Am I right?

I just made BOOT.BIN using the fsbl, download.bit and uboot. and put oit in sd card. The idea is just to see if something gets on console from ps7_init file or not.
0 Kudos
Explorer
Explorer
6,399 Views
Registered: ‎02-27-2014

Re: Printing messages from fsbl

I have attached ps7_init file above
0 Kudos
Explorer
Explorer
6,389 Views
Registered: ‎11-13-2009

Re: Printing messages from fsbl

That character display looks a lot like a baud rate or bit count mismatch.  Are you sure your hardware and your terminal are speaking the same baud, bits, stop and parity?

 

TomT...

0 Kudos
Explorer
Explorer
6,383 Views
Registered: ‎02-27-2014

Re: Printing messages from fsbl

Thanks for your reply. I am sure what I am doing in teraterminal , but could you please guide me how do check these settings in my board ? 

0 Kudos
Scholar sampatd
Scholar
6,379 Views
Registered: ‎09-05-2011

Re: Printing messages from fsbl

There is actually no need to change any of the FSBL source files or header files to include the FSBL compilation flags.

 

Compilation flags can be set using the C/C++ settings in SDK FSBL project, as shown below:

 

fsbl_debug.PNG

Can you try setting these compilation flags and check the prints?

 

 

0 Kudos
Explorer
Explorer
6,365 Views
Registered: ‎02-27-2014

Re: Printing messages from fsbl

@sampatd 

 

When I added FSBL_DEBUG_INFO, 

 

I got following error during compilation:

 

'Invoking: ARM gcc compiler'
arm-xilinx-eabi-gcc -Wall -O0 -g3 FSBL_DEBUG_INFO -c -fmessage-length=0 -I../../fsbl35_bsp/ps7_cortexa9_0/include -MMD -MP -MF"src/ddr_init.d" -MT"src/ddr_init.d" -o "src/ddr_init.o" "../src/ddr_init.c"
arm-xilinx-eabi-gcc: error: FSBL_DEBUG_INFO: No such file or directory
make: *** [src/ddr_init.o] Error 1

 

0 Kudos
Explorer
Explorer
6,350 Views
Registered: ‎02-27-2014

Re: Printing messages from fsbl

@sampatd 

I have put -D in flag as -DFSBL_DEBUG and now it is showing no error.

I am able to run it on board but when i am booting from flash some unreonised messages are coming as:

 

 
[Wed May 14 20:26:13.361 2014]  ð°ÑÜÑÞð@Ñâãì@£ìÁÏÍ@ßßì@ßÁÌÍâ@¢ÍÜÍÁãÍ@al^m_b`ac^aÁñ@al@b`al]b`r`orcp£ÑÜÑÃßÞ@®ÍâãÑßÞ@a^`ßßì@ÝßÌÍ@Ñã@¡£ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^£­££­¿
[Wed May
 14 20:26:14.105 2014] £@£ìÁìíã@}@`ða ¢¬¿¢¬¿
[
Wed May 14 20:26:19.499 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.499 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.499 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.499 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.499 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.499 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.499 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.499 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.499 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.499 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.499 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.551 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.551 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.551 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.551 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.551 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.551 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.551 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.551 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.551 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿

[Wed May 14 20:26:19.551 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.551 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.602 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.602 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.602 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.602 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.602 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.602 2014] ¢@£@£ìÁìíã@@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.602 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.602 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.602 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[
Wed May 14 20:26:19.602 2014] ¢@£@£ìÁìíã@}@`ðc`c ¢¬¿¢¬¿
[

 

 
 
 
 

 

0 Kudos
Explorer
Explorer
6,328 Views
Registered: ‎02-27-2014

Re: Printing messages from fsbl

@sampatd 

 

I am trying this now on another PC and microzed board.

 

Just to clarify: after setting compilation flags for debug,  do I need to uncomment xil_printf statements (that are commented by default) in ps7_init.c files, to see the log messages ? do I need to do this in orher files also?

 

If so then the role of FSBL_DEBUG and FSBL_DEBUG_INFO is governed by me , what I comment of uncomment in ps7_init files. Something is wrong in my understanding.  Please enlighten me. 

0 Kudos
Scholar sampatd
Scholar
6,277 Views
Registered: ‎09-05-2011

Re: Printing messages from fsbl

You do not need additional print statements in the FSBL code (unless you want them for specific reason). Your setting should be as shown:

fsbl.png

 

If you take a look at the FSBL source code, the debug prints are already present:

DEBUG_PRINTS.png

 

 

0 Kudos