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.

Linux/AM4378: Linux Kernel boot hangs

Part Number: AM4378
Other Parts Discussed in Thread: TPS65218, TPS74801

Tool/software: Linux

Hey Kemal,

Based on the previous thread, I am getting to the point in the boot process where the kernel tries to start, but it just hangs. I can see in U-boot code it just to the line:

kernel_entry(0, machid, r2);

and then it fails. I was trying to follow the training series at https://training.ti.com/linux-board-porting-series-module-10-debugging-linux-kernel-jtag-ccs?cu=399066 to debug the kernel code, but it is out of date and doesn't line up the current SDK. If you could give me any pointers on how to debug this I would appreciate it!

Thanks,

Tanner

  • Hello Tanner,

    You can debug this issue by referring to the listed links in this post.

    Please, also do not forget to mark the post helped you to solve the issue in your previous thread and close it by clicking on "This resolved my issue" button.

    Best regards,
    Kemal

  • I'm not sure if these posts you have pointed me to relate to my issue or not. Is there a way to debug the kernel code in CCS so that I can figure out where the error is occurring?
  • I also did notice in the boot log:

    U-Boot SPL 2018.01-00558-g8617e02-dirty (Mar 28 2019 - 14:42:06)
    Trying to boot from MMC1
    SPL: Please implement spl_start_uboot() for your board
    SPL: Direct Linux boot not active!


    U-Boot 2018.01-00558-g8617e02-dirty (Mar 28 2019 - 14:42:06 -0500)

    CPU : AM437X-GP rev 1.2
    Model: TI AM437x UTI BOARD
    DRAM: 512 MiB
    PMIC: TPS65218
    NAND: 0 MiB
    MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Net: <ethaddr> not set. Validating first E-fuse MAC
    Could not get PHY for cpsw: addr 0
    cpsw, usb_ether
    Hit any key to stop autobo 0
    =>setenv ip_method none
    =>setenv bootfile zImage
    =>setenv devtype mmc
    =>setenv getuenv 'setenv devnum ${mmcdev}; if mmc rescan; then if run loadbootenv; then run importbo'
    =>setenv bootcmd 'mmc rescan; run findfdt; run getuenv; setenv devtype mmc; run loadimage; run loadf'
    =>saveenv
    Saving Environment to FAT...
    writing uboot.env
    FAT: Misaligned buffer address (9def79e0)
    done
    =>boot
    syntax error
    709 bytes read in 3 ms (230.5 KiB/s)
    Importing environment from mmc0 ...
    3639496 bytes read in 181 ms (19.2 MiB/s)
    53555 bytes read in 29 ms (1.8 MiB/s)
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8ffef000, end 8ffff132 ... OK

    Starting kernel ...


    it seems like there is some sort of error when it tries to save the U-Boot parameters, and then there is a syntax error when it tries to run the boot command. Could that be what is causing the kernel hang?
  • Please, see this post. Unfortunately you cannot debug the device tree loading with CCS since in this stage nor U-Boot neither Kernel is responding. You will need to strip down the device tree to bare minimum (e.g. pretty much just the UART, I2C, MMC, and PMIC) then add the other peripherals one by one and find out which one makes the kernel hang. You can refer to this, this and this thread to gain more info about device trees.


    Tanner Hunsucker73 said:
    FAT: Misaligned buffer address (9def79e0)

    To fix this issue please refer to the note in this post.


    Tanner Hunsucker73 said:
    there is a syntax error when it tries to run the boot command

    importbo must be importbootenv and loadf must be loadfdt. Are you using minicom? Please use picocom.


    Tanner Hunsucker73 said:
    Could that be what is causing the kernel hang?

    Yes, this is possible.

  • I figured out the syntax error, that was an error on my end. The patch you pointed me to, fixed the misaligned buffer address error. So I guess now it comes down to stripping down the device tree and figuring out what is causing the hang.

  • So I tried stripping down the device tree to just i2c0, uart0, and mmc0, but it still hangs at Starting Kernel...
  • In my device tree under I2C0, I currently have the tps65218 node, just like the EVM device tree has. But my board is not using the PMIC chip to power up currently, it is using TPS74801 LDO regulators to power up. Do I need to have nodes for those regulators instead of the PMIC chip in my device tree? And if so, how do I represent them in the device tree? I can see that there is a tps65218.txt file in the devicetree/bindings section of the kernel, but there is no file for the TPS74801.
  • So to update further, I was able to get into the kernel code in CCS and I can see where the execution fails. It looks like it fails when it tries to call the function "calibrate_delay". Any ideas about what could be causing this?
  • Actually, that is not true sorry. The function it is failing at is "rest_init"
  • Hello Tanner,

    Sorry for my late reply, I was out of office last week.

    Was you able to load the kernel on your board?

    Best regards,
    Kemal
  • Yes, I got it figured out.