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/AM5728: How to build kernel source

Part Number: AM5728
Other Parts Discussed in Thread: PMP

Tool/software: Linux

Hi

I am using AM572x evaluation board and have a trouble when I run the board with compiled kernel source.

Even I just clone the kernel source from git repository and compile it, terminal shows some errors.
(I refered http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components_Kernel_Users_Guide.html)

Instructions I executed and errors terminal showed are as follows.

- Instruction

git clone git://git.ti.com/processor-sdk/processor-sdk-linux.git
git checkout processor-sdk-linux-4.19.y

ti_config_fragments/defconfig_builder.sh -t ti_sdk_dra7x_release
export ARCH=arm
make ti_sdk_dra7x_release_defconfig
mv .config arch/arm/configs/ti_sdk_dra7x_release_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- ti_sdk_dra7x_release_defconfig
make menuconfig

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage
cp am572x-idk.dts am572x-idk.dtb
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am572x-idk.dtb

sz zImage-4.4.19-rt25-gf572d285f0
sz vmlinux-4.4.19-rt25-gf572d285f0
sz am572x-idk.dtb

- Error

** Unable to read "uboot.env" from mmc0:1 **
** Unable to read file boot.scr **
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
** First descriptor is NOT a primary desc on 1:1 **

Is there problem in my instructions?

Regards

  • Hello Jeehwan,

    Jeehwan Kim said:
    Is there problem in my instructions?

    Yes. Skip this step cp am572x-idk.dts am572x-idk.dtb and take the compiled device tree from <processor-sdk-linux>/arch/arm/boot/dts/am572x-idk.dtb.

    Best regards,
    Kemal

  • Hello Kemal.

    In <processor-sdk-linux>/arch/arm/boot/dts, there is no .dtb file but only .dts file.
    So I copied it as .dtb file and compiled it.

    Compiling the Device Tree Binaries section in http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components_Kernel_Users_Guide.html also says,

    To build an individual device tree file find the name of the dts file for the board you are using and replace the .dts extension with .dtb. Then run the following command:

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- <dt filename>.dtb

    So I think problem is in other part.

    Best regards,
    Jeehwan

  • Jeehwan Kim said:
    In <processor-sdk-linux>/arch/arm/boot/dts, there is no .dtb file but only .dts file.


    Run the make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am572x-idk.dtb command and there will be one.

    Replacing the .dts extension with .dtb doesn't mean to copy the dts as dtb. They mean to look at the dts and just change the extension of the name in the command line to dtb.

  • Ah, I misunderstood about that command.

    So I skipped copy and just ran make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am572x-idk.dtb in <processor-sdk-linux>/
    then I found dtb file was generated in <processor-sdk-linux>/arch/arm/boot/dts/.

    However, when I installed vmlinux, zImage, dtb files and ran the board, terminal showed the same errors.

    Below are error sentences and full terminal scripts.

    - error

    ** Unable to read "uboot.env" from mmc0:1 **
    ** Unable to read file boot.scr **
    ** File not found /boot/am572x-idk.dtb **
    ERROR: Did not find a cmdline Flattened Device Tree
    ** First descriptor is NOT a primary desc on 1:1 **
    ** First descriptor is NOT a primary desc on 1:1 **
    ** No partition table - mmc 1 **

    - terminal

    U-Boot 2016.05-g2f757e5b2c (Oct 03 2016 - 19:16:30 -0400)

    CPU : DRA752-GP ES2.0
    Model: TI AM5728 IDK
    Board: AM572x IDK REV 1.3B
    DRAM: 2 GiB
    MMC: no pinctrl for sdr104
    no pinctrl for ddr50
    no pinctrl for sdr50
    no pinctrl for sdr25
    no pinctrl for sdr12
    OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env

    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment

    SCSI: SATA link 0 timeout.
    AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
    flags: 64bit ncq stag pm led clo only pmp pio slum part ccc apst
    scanning bus for devices...
    Found 0 device(s).
    Net:
    Warning: ethernet@48484000 using MAC address from ROM
    eth0: ethernet@48484000
    Hit any key to stop autoboot: 0
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading boot.scr
    ** Unable to read file boot.scr **
    reading uEnv.txt
    574 bytes read in 3 ms (186.5 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc0 ...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    4227584 bytes read in 209 ms (19.3 MiB/s)
    ext4fs_devread read outside partition 2736466872
    ** File not found /boot/am572x-idk.dtb **
    Booting from mmc0 ...
    Kernel image @ 0x82000000 [ 0x000000 - 0x408200 ]
    ERROR: Did not find a cmdline Flattened Device Tree
    Could not find a valid device tree
    ** First descriptor is NOT a primary desc on 1:1 **
    switch to partitions #0, OK
    mmc1(part 0) is current device
    ** First descriptor is NOT a primary desc on 1:1 **
    SD/MMC found on device 1
    ** No partition table - mmc 1 **

  • You need to installed the am572x-idk.dtb device tree blob file to the SD card's second partition under /boot/ directory. You probably installed it to the SD card's first boot partition.

  • SD card's second partition which you mean is rootfs, isn't it?

    I installed it rootfs/boot/ directory but board cannot find dtb file.

    I don't know what is the matter..

  • Can you stop the booting in U-Boot console and post the output of this command?

    => ext4ls mmc 0:2 boot

  • I stopped booting and the output of that command was as follows.

    => ext4ls mmc 0:2 boot
    <DIR> 4096 .
    <DIR> 4096 ..
    <SYM> 48 am572x-idk-lcd-osd101t2587.dtb
    99621 devicetree-zImage-am571x-idk-lcd-osd.dtb
    96794 devicetree-zImage-am57xx-beagle-x15.dtb
    <SYM> 48 am571x-idk-lcd-osd101t2587.dtb
    <SYM> 39 am57xx-beagle-x15.dtb
    4227584 zImage-4.4.19-rt25-gf572d285f0
    101618 devicetree-zImage-am572x-idk-lcd-osd.dtb
    <SYM> 45 am572x-idk-pru-excl-uio.dtb
    <SYM> 40 am572x-idk-lcd-osd.dtb
    103521 devicetree-zImage-am572x-idk-pru-excl-uio.dtb
    <SYM> 32 am571x-idk.dtb
    100523 devicetree-zImage-am572x-idk.dtb
    98686 devicetree-zImage-am571x-idk.dtb
    <SYM> 38 am57xx-evm-reva3.dtb
    ext4fs_devread read outside partition 2736466872

  • I do not see the am572x-idk.dtb there. Please, make sure that the am572x-idk.dtb is successfully copied under /boot/ directory in the SD card's second partition.

  • Finally I resolved the issue by using other SD card.

    I think SD card was broken so it caused this happening.
    It didn't recognize the dtb file but I put it in right place definitely.

    Thanks for your help, Kemal.

    Best regards,
    Jeehwan