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: Issue when recompiling kernel with trace option

Part Number: AM5728

Tool/software: Linux

Hi everyone,

I recently had issue regarding touch screen event, TI suggested me to use ftrace to look into this issue. By default, trace is not set in kernel, so I have to recompile the kernel with Kernel hacking ---> [*] Tracers ---> [*] Interrupts-off Latency Tracer [*] Preemption-off Latency Tracer. However, after enable these(and only enable these, nothing else), the following failed occurred. 

[  OK  ] Mounted Temporary Directory.                                                                                          
[    6.207053] systemd[1]: Started Journal Service.                                                                            
[  OK  ] Started Journal Service.                                                                                              
[FAILED] Failed to start Load Kernel Modules.                                                                                  
See 'systemctl status systemd-modules-load.service' for details.                                                               
[  OK  ] Started Setup Virtual Console.                                                                                        
[  OK  ] Started Create list of required sta...ce nodes for the current kernel.                                                
[  OK  ] Started Remount Root and Kernel File Systems.  

However, I am able to login through minicom from my host, while the board stuck at "Please wait".

Here is what I did: (I load the sdk path of course)

1) Clean.  

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean

2) Load default config 

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am57xx-evm_defconfig

3) Config in Menuconfig

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig 

Only enable above items.

4) Compile zImage. (with 8 cores)

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage -j8

5) Compile dtb file

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am57xx-evm.dtb

6) Compile modules

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules -j8

7) install kernel

cd /ti-processor-sdk-linux-am57xx-evm-03.02.00.05/board-support/linux-4.4.32+gitAUTOINC+db0b54cdad-gdb0b54cdad

sudo cp arch/arm/boot/zImage /media/<username>/rootfs/boot
sudo cp arch/arm/boot/dts/am57xx-evm.dtb /media/<username>/rootfs/boot/

8) install modules

sudo make ARCH=arm INSTALL_MOD_PATH=/media/<username>/rootfs modules_install

9) insert the SD back to the board. boot.

Any suggestion is appreciated.

Peter

  • The software team have been notified. They will respond here.
  • Hello Peter,

    Every step you have done is correct. Please, also copy the zImage and am57xx-evm.dtb to first boot partition,

    sudo cp arch/arm/boot/zImage /media/<username>/boot/
    sudo cp arch/arm/boot/dts/am57xx-evm.dtb /media/<username>/boot/

    and check if root@am57xx-evm:~# sync && ldconfig && depmod -a commands will have an effect.

    Best regards,
    Kemal

  • copied the zImage and am57xx-evm.dtb to first boot partition, 

    problem remains.

    ran 

    sync && ldconfig && depmod -a     through minicom, 

    return

    ldconfig: /lib/libstdc++.so.6.0.21-gdb.py is not an ELF file - it has the wrong magic bytes at the start. 

    Meanwhile I am able to ctrl+alt+F1 and login, but when I

    unset WAYLAND_DISPLAY

    weston --tty=1 --connector=32

    returns

    Date: 2017-02-15 UTC
    [17:15:10.348] weston 1.9.0
    http://wayland.freedesktop.org
    Bug reports to: bugs.freedesktop.org/enter_bug.cgi
    Build: 1.8.93-2-gb05cdb8 configure.ac: bump to version 1.9.0 for the official release (2015-09-21 18:11:26 -070)
    [17:15:10.348] OS: Linux, 4.4.32-gadde2ca9f8, #2 SMP PREEMPT Tue Feb 14 12:05:11 PST 2017, armv7l
    [17:15:10.349] Using config file '/etc//weston.ini'
    [17:15:10.349] Loading module '/usr/lib/weston/drm-backend.so'
    [17:15:10.353] Output repaint window is 7 ms maximum.
    [17:15:10.353] initializing drm backend
    [17:15:10.356] using /dev/dri/card0
    [17:15:10.356] Loading module '/usr/lib/weston/gl-renderer.so'
    failed to load module: /usr/lib/gbm/gbm_dri.so: cannot open shared object file: No such file or directory
    failed to load module: /usr/lib/gbm/gbm_gallium_drm.so: cannot open shared object file: No such file or directory
    loaded module : gbm_pvr.so
    found valid GBM backend : gbm_pvr.so
    [17:15:10.364] warning: either no EGL_EXT_platform_base support or specific platform support; falling back to eglGetDisplay.
    PVR:(Error): OpenServices: PVRDRMOpenRender failed [0, ]
    PVR:(Error): PVRSRVConnect: Unable to open connection. [0, ]
    PVR:(Error): Couldn't connect to services [0, ]
    [17:15:10.366] failed to initialize display
    [17:15:10.366] EGL error state: EGL_BAD_ALLOC (0x3003)
    [17:15:10.366] failed to initialize egl
    [17:15:10.375] fatal: failed to create compositor backend

    similar return when I ran KMSCube example:

    trying to load module omapdrm...success.
    ### Display [0]: CRTC = 34, Connector = 32
    Mode chosen [800x480] : Clock => 33000, Vertical refresh => 60, Type => 72
    Horizontal => 800, 1010, 1040, 1056, 0
    Vertical => 480, 502, 515, 525, 0
    ### Display [1]: CRTC = 38, Connector = 36
    Mode chosen [1920x1080] : Clock => 148500, Vertical refresh => 60, Type => 72
    Horizontal => 1920, 2008, 2052, 2200, 0
    Vertical => 1080, 1084, 1089, 1125, 0
    ### Primary display => ConnectorId = 32, Resolution = 800x480
    failed to load module: /usr/lib/gbm/gbm_dri.so: cannot open shared object file: No such file or directory
    failed to load module: /usr/lib/gbm/gbm_gallium_drm.so: cannot open shared object file: No such file or directory
    loaded module : gbm_pvr.so
    found valid GBM backend : gbm_pvr.so
    PVR:(Error): OpenServices: PVRDRMOpenRender failed [0, ]
    PVR:(Error): PVRSRVConnect: Unable to open connection. [0, ]
    PVR:(Error): Couldn't connect to services [0, ]
    failed to initialize
    failed to initialize EGL

  • Seems you don't have the ddk kernel modules loaded. Can you check that by lsmod command?

  • Since I still see [FAILED] Failed to start Load Kernel Modules when booting, I guess for some reason modules are not compiled/installed correctly.

    ran lsmod,
    return:

    Module Size Used by
    usbhid 19545 0
    rpmsg_proto 7533 0
    rpmsg_rpc 19476 0
    rpmsg_pru 5026 0
    xhci_plat_hcd 5183 0
    xhci_hcd 120526 1 xhci_plat_hcd
    usbcore 193640 3 xhci_plat_hcd,usbhid,xhci_hcd
    sd_mod 28395 2
    dwc3 83024 0
    udc_core 12127 1 dwc3
    virtio_rpmsg_bus 12760 3 rpmsg_pru,rpmsg_rpc,rpmsg_proto
    bluetooth 325038 2
    xfrm_user 23036 2
    xfrm4_tunnel 2104 0
    ipcomp 2537 0
    xfrm_ipcomp 4695 1 ipcomp
    esp4 6529 0
    ah4 5729 0
    af_key 27371 0
    xfrm_algo 7034 5 ah4,esp4,af_key,xfrm_user,xfrm_ipcomp
    ti_vip 35430 0
    pru_rproc 11796 4
    pruss_intc 7291 5 pru_rproc
    ecb 1973 0
    sha512_generic 9967 0
    sha256_generic 9567 0
    hmac 2799 0
    md5 1961 0
    sha1_generic 2685 0
    sha1_arm_neon 6325 0
    sha1_arm 3926 1 sha1_arm_neon
    ahci_platform 3282 1
    libahci_platform 8885 1 ahci_platform
    libahci 27763 2 libahci_platform,ahci_platform
    omap_aes_driver 19294 0
    pruss 11250 1 pru_rproc
    ti_vpe 19036 0
    ti_sc 24778 2 ti_vip,ti_vpe
    omap_wdt 4634 0
    libata 216698 3 libahci,libahci_platform,ahci_platform
    omap_sham 21153 0
    scsi_mod 157959 2 libata,sd_mod
    ti_csc 2377 2 ti_vip,ti_vpe
    ti_vpdma 15102 2 ti_vip,ti_vpe
    rtc_ds1307 11342 0
    dwc3_omap 4990 0
    omap_des 11510 0
    pixcir_i2c_ts 6634 0
    rtc_omap 8400 0
    rtc_palmas 5251 0
    mt9t11x 14833 0
    omap_rng 4899 0
    rng_core 7819 1 omap_rng
    extcon_palmas 6325 0
    extcon 13879 3 dwc3,extcon_palmas,dwc3_omap
    omap_remoteproc 12325 4
    remoteproc 27121 5 omap_remoteproc,pruss,pru_rproc,rpmsg_rpc,rpmsg_proto
    virtio 7516 2 remoteproc,virtio_rpmsg_bus
    virtio_ring 12355 2 remoteproc,virtio_rpmsg_bus
    sch_fq_codel 8123 3
    uio 9393 0
  • All right, now I get it. You don't have the graphics modules installed, since they are on separate directory. Check the top make file to see how the ti-sgx-ddk-km is compiled or build and install through instructions at <Processor SDK>/board-support/extra-drivers/ti-sgx-ddk-km-1.14.3699939/eurasia_km/README file.

  • Things are getting problematic.

    According to INSTALL and READMO in ti-sgx-ddk-km-1.14.3699939/eurasiacon, I will have to choose a platform under /eurasiacon/build/linux2/ (I only see linux2, not linux).

    The available platforms are jz4780_linux, nohw_linux, omap_android, omap_linux, pc_i686_cedarview_linux, pc_poulsbo_d0_linux, pc_i686_tc_linux, and sunxi_android.

    While no "am57xx_linux" is found here, I did try to make all of them follow their instruction, however, none of them can compile (directory issue, library missing issue, etc)

    To this point, it is getting to deep into just try to fix the touch screen delay problem that I posted here.

    I will stop here and go back to the touch screen thread. 

     

  • No, it is not that problematic as you think. Just type make ti-sgx-ddk-km from the top Processor SDK installed directory or follow these steps:

    cd <Processor SDK install dir>/board-support/extra-drivers/ti-sgx-ddk-km-1.14.369993/
    export CROSS_COMPILE=<Processor SDK install dir>/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-
    LINUXKERNEL_INSTALL_DIR=<Processor SDK install dir>/board-support/linux-4.4.32+gitAUTOINC+adde2ca9f8-gadde2ca9f8
    CFLAGS= -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard
    make -C ./eurasia_km/eurasiacon/build/linux2/omap_linux ARCH=arm TARGET_PRODUCT=jacinto6evm KERNELDIR=$LINUXKERNEL_INSTALL_DIR

  • make ti-sgx-ddk-km seems to work, now I think I have compiled the sgx ddk. How to install it then?
  • Try:
    make ti-sgx-ddk-km_install then copy the /lib/modules/<kermel-version>/* to your SD card, along with the kernel.

  • make ti-sgx-ddk-km_install works. However, when I look into what exactly make ti-sgx-ddk-km does, I found that it actually rewrite the config and build zImage, meaning that my previous setting (I enable tracer) is gone.

    Also I found that, if I dont change anything in step 3) from top of this thread, then build and install, everything runs well.

    The module fail error only occurs when I build zImage with tracer enabled in config. The module fail error only occurs when I build zImage with tracer -> Interrupts-off Latency Tracer or/and Preemption-off Latency Tracer and is enabled (tracer itself is fine)


    This leads me to think that SGX DDK may have conflict with these two tracer items. Enabling them fails SGX DDK build.

    Could you please try building it yourself? I simply just need a tracer enabled kernel to debug my touch screen issue as you recommended.

    Thank you.

  • Xiang Gao said:

    make ti-sgx-ddk-km_install works. However, when I look into what exactly make ti-sgx-ddk-km does, I found that it actually rewrite the config and build zImage, meaning that my previous setting (I enable tracer) is gone.


    That is right, the make ti-sgx-ddk-km command recompiles the kernel with boards defconfig. To fix this make a defconfig file with the trace options enabled.

    1) Clean.
    make linux_clean

    2) Backup your defconfig file
    cp board-support/linux-4.4.32+gitAUTOINC+adde2ca9f8-gadde2ca9f8/arch/arm/configs/tisdk_am57xx-evm_defconfig board-support/linux-4.4.32+gitAUTOINC+adde2ca9f8-gadde2ca9f8/arch/arm/configs/tisdk_am57xx-evm_defconfig.bak

    3) Load default config.
    cd board-support/linux-4.4.32+gitAUTOINC+adde2ca9f8-gadde2ca9f8/
    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- tisdk_am57xx-evm_defconfig

    4) Config in Menuconfig and enable tracers.

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig

    Kernel hacking ---> [*] Tracers ---> [*] Interrupts-off Latency Tracer
                                                                       [*] Preemption-off Latency Tracer
    You can also enable the Kernel Function Tracer to get a much larger output.
    Kernel hacking ---> [*] Tracers ---> [*] Kernel Function Tracer

    5) Replace the old defconfig file with the new one which includes tracers.
    cd ../../
    cp board-support/linux-4.4.32+gitAUTOINC+adde2ca9f8-gadde2ca9f8/.config board-support/linux-4.4.32+gitAUTOINC+adde2ca9f8-gadde2ca9f8/arch/arm/configs/tisdk_am57xx-evm_defconfig

    6) Compile and install the dtb, linux and modules.
    make linux
    make linux_install

    7) Compile and install the ti-sgx-ddk-km modules.
    make ti-sgx-ddk-km
    make ti-sgx-ddk-km_install

    8) Copy the needed dtb, kernel and modules in a proper places at your SD card.

    Xiang Gao said:

    The module fail error only occurs when I build zImage with tracer enabled in config. The module fail error only occurs when I build zImage with tracer -> Interrupts-off Latency Tracer or/and Preemption-off Latency Tracer and is enabled (tracer itself is fine)


    Interrupts-off Latency Tracer and Preemption-off latency Tracer should not break the SGX.

  • Kernel compilation issue is resolved following your instructions.
    In 8) I "sudo scp -r targetNFS/lib/modules/4.4.32-gadde2ca9f8 /media/<username>/rootfs/lib/modules/"

    Now I finally start working on tracer the touch screen events.