This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

  • Resolved

how to debug non-booting linux kernel on custom am57xx board

Intellectual 370 points

Replies: 3

Views: 2571

I have a custom am572x board which is similar but not identical to the am57xx_evm.  I am using sdk version: sdk-linux-am57xx-evm-02.00.02.11

I have modified the u-boot image and am booting to the u-boot prompt.

 I have modified the device tree to reduce the memory size down to the 256Mbyte of memory we have on our board.   I have disabled many sections in the device tree that do not apply:  video, sound, GPIO we don't use, and all of the other onboard processors except for 1 dsp.  I have successfully compiled the .dts file to a .dtb file and have it in the /tftpboot/ dir, along with the TI prebuilt Zimae-am57xx-evm.bin

I try to boot linux using: run netboot   ,  but it always fails after loading and jumping to the kernel.

my uboot code successfully loads the kernel to 0x82000000  and the device tree to 0x88000000 it then prints the following:

## Transferring control to Linux (at address 82000000)...

Starting kernel ...

## Done with 'announce_and_cleanup)  (I added this debug message)
## jumping to 'kernel_entry'                     (I added this debug message just prior to the jump to the kernel)

The problem is, it hangs after jumping to the kernel and I need to figure out  how to debug it.   I was trying to use some bootargs to enable debug printing in the kernel, including earlyprintk, but so far nothing has printed out on the serial port after it hangs as shown above.

The way I tried to enable earlyprintk was through the 'optargs' provided by env var: netargs

 netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp

so I created the following env variable: 

tftpargs=setenv optargs debug earlyprintk=ttyO2,115200n8,keep loglevel=7 log_buf_len=16000 initcall_debug time

then I executed:  run tftpargs

prior to executing: run netboot.

Questions:

1) did I correctly initialize 'earlyprintk'?  if so, why didn't I get any debug output?  Do I need to do something else?

2) Notice I also changed the debug loglevel to 7.   Is this correct too?

3) Is there something I am missing that I need to do to see debug printouts as the kernel tries to boot?

4) is there a better way to debug this?  as I am at a standstill now. 

  • Hi,

    I will ask the software team to look at this. They will respond directly here.

     

    Best Regards
    Biser
  • Hi Tom,

    1) did I correctly initialize 'earlyprintk'? if so, why didn't I get any debug output? Do I need to do something else?

    You also need to enable CONFIG_OMAP_LL_DEBUG_UARTx=y (x is the number of your debug uart) in your defconfig file.

    2) Notice I also changed the debug loglevel to 7. Is this correct too?

    Yes, this should increase the verbosity of your kernel.

    3) Is there something I am missing that I need to do to see debug printouts as the kernel tries to boot?

    If you define DEBUG in the kernel, you should enable all the pr_debug() messages, if any, see: elinux.org/Kernel_Debugging_Tips & elinux.org/Debugging_by_printing

    4) is there a better way to debug this? as I am at a standstill now.


    Note that Starting Kernel is the last u-boot message. It usually indicates that you're using a wrong dtb, or there is something fundamentally wrong in the dtb you use. You say that you reduce the DDR size defined in your device tree.. can you share that part of the dts?

    Can you stop at u-boot execute pringenv & share the results?

    Best Regards,
    Yordan

     


     Please make sure you read the forum guidelines first.

  • In reply to Yordan Kovachev:

    I found this worked to get serial port output early in the kernel boot process before it hung:

    1) find the line in the .config file:
    #CONFIG_DEBUG_LL is not set
    modify it to:
    CONFIG_DEBUG_LL=y

    2) run: U-Boot# make ARCH=arm oldconfig
    during this make, 2 dialogues came up.

    2a) dialogue 1 asked to select a UART port for debug output, I selected the one for OMAP5 and UART3 to match our board

    2b) asked to turn EARLY PRINTK on, I said yes

    3) rebuild the kernel a place zImage in the tftpboot directory

    4) boot the new kernel file with the same additive steps I had above:
    4a) U-Boot# run find fdt

    4b) create the additional 'optargs' used to turn on earlyprintk debugging:

    U-Boot# setenv optargs debug earlyprintk=${console},keep loglevel=7 log_buf_len=16000 initcall_debug time

    4c) U-Boot# run netboot

    This allowed early printing as linux kernel booted and before it hung.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.