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: 
Adventurer
Adventurer
12,250 Views
Registered: ‎09-19-2014

Intermittent freezing on U-Boot/kernel booting

Jump to solution

I am using OpenEmbedded/Yocto to build Linux for my custom Zynq system.

https://github.com/Xilinx/meta-xilinx

Which uses sources for u-boot and Linux:

https://github.com/Xilinx/u-boot-xlnx

https://github.com/Xilinx/linux-xlnx

 

I was previously using meta-xilinx build recipes from Dec 2014 and Xilinx 2014.3 before, and everything was booting fine.

Then came time to update my software, and I updated all the scripts to the Poky Jethro 2.0 release (from Nov 2015 - https://github.com/Xilinx/meta-xilinx/tree/jethro).


Now sometimes it boots fine. But about 3 in 8 times it fails to boot, and freezes when starting to loading the kernel:

 

U-Boot 2015.04 (Jan 08 2016 - 14:27:23)

Board:  Xilinx Zynq
I2C:   ready
DRAM:  ECC disabled 1 GiB
MMC:   zynq_sdhci: 0
SF: Detected S25FL128S_64K with page size 512 Bytes, erase size 128 KiB, total 32 MiB
In:    serial
Out:   serial
Err:   serial
Board:  Xilinx Zynq
Net:   Gem.e000b000
Hit any key to stop autoboot:  0
Copying Linux from QSPI flash to RAM...
SF: Detected S25FL128S_64K with page size 512 Bytes, erase size 128 KiB, total 32 MiB
SF: 4063232 bytes @ 0xa00000 Read: OK
SF: 131072 bytes @ 0xde0000 Read: OK
Copying ramdisk...
SF: 7077888 bytes @ 0xe00000 Read: OK
## Booting kernel from Legacy Image at 02080000 ...
   Image Name:   Linux-4.0.0-xilinx
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3686040 Bytes = 3.5 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 04000000 ...
   Image Name:   uramdisk
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    6552459 Bytes = 6.2 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 02000000
   Booting using the fdt blob at 0x2000000
   Loading Kernel Image ... OK
   Loading Ramdisk to 1f9c0000, end 1ffffb8b ... OK
   Loading Device Tree to 1f9b6000, end 1f9bf741 ... OK

Starting kernel ...

<freezes>

The same intermittent boot occurs whether it boots from SD card or QSPI flash memory.

 

Is a bug in U-Boot?

Is it a faulty kernel?

Is it a race condition somewhere in the hardware design?

 

Is there a verbose boot mode for U-Boot or Linux kernel? I might try investigating that.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
22,465 Views
Registered: ‎09-19-2014

Re: Intermittent freezing on U-Boot/kernel booting

Jump to solution

I played around again with enabling the kernel debugging, and got it working.

But turning on the debugging makes it boot every time and fixes the intermittent issue!

 

CONFIG_DEBUG_LL wasn't working before, because I needed to select which UART to output to, independently of the console line in the kernel bootargs.

 

I enabled these:

CONFIG_DEBUG_LL=y
CONFIG_DEBUG_ZYNQ_UART1=y
CONFIG_DEBUG_LL_INCLUDE="debug/zynq.S"
CONFIG_DEBUG_UNCOMPRESS=y
CONFIG_EARLY_PRINTK=y

Surprisingly, the only extra things it prints are:

Uncompressing Linux... done, booting the kernel.
...
[    0.000000] bootconsole [earlycon0] enabled
...
...
à[    1.373182] console [ttyPS0] enabled
[    1.380249] bootconsole [earlycon0] disabled
[    1.380249] bootconsole [earlycon0] disabled

Surprisingly, it seems to be booting 250ms faster with debugging on!

 

Surprisingly, it fixes the issue!

 

I can't understand why that is, but there don't seem to be any downsides to it, so I'll keep it as it is.

0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
12,033 Views
Registered: ‎07-01-2010

Re: Intermittent freezing on U-Boot/kernel booting

Jump to solution

@sam_jaeschke

 

The behaviour looks strange.

 

When you say you have upgraded to latest kernel - did you upgrade the HW (block design etc) using Xilinx latest tools?

 

This link  has some details of kernel hang at starting kernel.

 

Did you enable printk?

 

See some tips from the AR#60666.

 

Regards,

Achutha

---------------------------------------------------------------------------------------------
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
Adventurer
Adventurer
11,998 Views
Registered: ‎09-19-2014

Re: Intermittent freezing on U-Boot/kernel booting

Jump to solution

Yes, I upgraded the hardware design to use Vivado 2015.4. It is indeed strange.

 

I determine it has successfully booted by listening to a motor move, or a light flash, or the ethernet interface be pingable (all which happen if it does boot successfully). I was playing around by testing different combinations of old and new boot image components, and not all of them set up the stdout UART, so that is not a reliable way of telling if it has booted properly.

 

Yes, I have earlyprintk in my kernel bootargs in the devicetree.

 

The ttc timer wouldn't cause intermittent issues... I did have that issue in the early days, and it failed to boot at all.

 

Does CONFIG_OMAP_LL_DEBUG_UART# need to be set independently of setting the console stdout to the correct UART in the bootargs? I haven't tried setting that. I did try CONFIG_DEBUG_LL before, but that didn't work, and I think even U-Boot failed to do anything when I tried that for some reason. I'll try it again though.

0 Kudos
Highlighted
Adventurer
Adventurer
22,466 Views
Registered: ‎09-19-2014

Re: Intermittent freezing on U-Boot/kernel booting

Jump to solution

I played around again with enabling the kernel debugging, and got it working.

But turning on the debugging makes it boot every time and fixes the intermittent issue!

 

CONFIG_DEBUG_LL wasn't working before, because I needed to select which UART to output to, independently of the console line in the kernel bootargs.

 

I enabled these:

CONFIG_DEBUG_LL=y
CONFIG_DEBUG_ZYNQ_UART1=y
CONFIG_DEBUG_LL_INCLUDE="debug/zynq.S"
CONFIG_DEBUG_UNCOMPRESS=y
CONFIG_EARLY_PRINTK=y

Surprisingly, the only extra things it prints are:

Uncompressing Linux... done, booting the kernel.
...
[    0.000000] bootconsole [earlycon0] enabled
...
...
à[    1.373182] console [ttyPS0] enabled
[    1.380249] bootconsole [earlycon0] disabled
[    1.380249] bootconsole [earlycon0] disabled

Surprisingly, it seems to be booting 250ms faster with debugging on!

 

Surprisingly, it fixes the issue!

 

I can't understand why that is, but there don't seem to be any downsides to it, so I'll keep it as it is.

0 Kudos