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/AM3359: Segmentation fault when running icss_emac loopback test (LPSDK 5.0)

Part Number: AM3359

Tool/software: Linux

Hi, I was able to build AM335x Linux Processor SDK 5.0 (RT and non-RT) following below links:

processor-sdk-linux-building-the-sdk

  • I created the SD card using windows method,
  • I also was able to build ICSS-EMAC loopback demo following this link: Processor_SDK_Linux_ICSS-EMAC_User_Space
  • As mentioned in above link  I replaced am335x-icev2.dtb with am335x-icev2-pru-excl-uio.dtb
  • I copied "icss_emacMainTest_am335x.out" from "packages-split/icss-emac-lld-test/usr/bin" to my /home in the SD card but when running it, I am getting segmentation fault

root@am335x-evm:/home# ./icss_emacMainTest_am335x.out
Segmentation fault (core dumped)

As a test, instead of using prebuild SD card images from ti.com, I copied /boot and rootfs files from PSDK tisdk/build/arago-tmp-external-linaro-toolchain/deploy/images/am335x-evm

  • In boot partition copied MLO and u-boot.img
  • In rootfs partition I untar arago-base-tisdk-imag-am335x-evm.tar.xz
  • Again I replaced am335x-icev2.dtb with am335x-icev2-pru-excl-uio.dtb
  • and run ./icss_emacMainTest_am335x.out
  • Same segmentation fault

Questions:

  • is there any known issue for running UIO demos with LPSDK 5.0?
  • Maybe, I am missing something?

thanks for your help,

Paula

  • Hi Paula,
    I have not used the SD card windows method to build an SD card, only the current Linux SDK. I also I have not tried the demo that you are mentioning.

    In general the seg fault could be coming from a number of things. For example, are the all the libraries that the app was built against present in the root file system? Since you copied the executable out there maybe dependent libraries that need to be copied too. Use this command to find if there are libraries needed:

    libtool -d <path to>icss_emacMainTest_am335x.out

    Best Regards,
    Schuyler
  • Hi Schuyler, thanks for your reply. Howerver "libtool -d" didn't work for me. I tried "ldd" instead.. I don't see anything reported as "no found" so I guess it is OK?

    root@am335x-evm:/home# libtool -d icss_emacMainTest_am335x.out
    Usage: /usr/bin/libtool [OPTION]... [MODE-ARG]...
    Try 'libtool --help' for more information.
    libtool: error: unrecognised option: '-d'

    root@am335x-evm:/home# ldd icss_emacMainTest_am335x.out
    librt.so.1 => /lib/librt.so.1 (0xb6faf000)
    libpthread.so.0 => /lib/libpthread.so.0 (0xb6f8b000)
    libc.so.6 => /lib/libc.so.6 (0xb6e9e000)
    /lib/ld-linux-armhf.so.3 (0xb6fc5000)

    root@am335x-evm:/home# ldd powerlinkcn.out
    librt.so.1 => /lib/librt.so.1 (0xb6f87000)
    libpthread.so.0 => /lib/libpthread.so.0 (0xb6f63000)
    libc.so.6 => /lib/libc.so.6 (0xb6e76000)
    /lib/ld-linux-armhf.so.3 (0xb6f9d000)

    For your information, my final goal is to test powerlinkcn (slave). But after building/running it, I got "segmentation fault". That was the reason I compiled and tested OOB UIO demo (PRU-ICSS EMAC loopback), but, as reported I got the same error.

    Few months ago, I was able to build and run UIO PRU-ICSS EMAC demo with LPSDK 4.0. Do you know if someone else have test UIO loopback demo on PSDK 5.0? I would like to rule out it is a known issue.. Or alternatively, do you see any issue on the steps I followed? anything else I can test?

    Thank you,
    Paula
  • Hi Paula,

    It might possibly be lib issues, do these libraries with these versions exist on the target?

    ibrt.so.1 => /lib/librt.so.1 (0xb6f87000)
    libpthread.so.0 => /lib/libpthread.so.0 (0xb6f63000)
    libc.so.6 => /lib/libc.so.6 (0xb6e76000)
    /lib/ld-linux-armhf.so.3 (0xb6f9d000)

    Regards,
    Schuyler
  • Hi Schuyler, a quick update. I created an SD card with am335x-evm-linux-rt-04.00.00.04.img (from ti.com), rename "am335x-icev2-pru-excl-uio.dtb" as "am335x-icev2.dtb", then copy "icss_emacMainTest_am335x.out" and "powerlinkcn.out" (both *.out were built using PSDK 5.0).

    With an SD card running PSDK4.0 both applications run OK.

    I will open a JIRA.

    thank you,
    Paula"
  • Hi Schuyler, I was notified that starting from 5.0, the default dtb for AM3 PRU has been changed to am335x-icev2-prueth.dtb. This is documented in the migration guide of PLSDK 5.0:


    http://software-dl.ti.com/processor-sdk-linux/esd/docs/05_00_00_15/linux/Release_Specific.html#migration-guide

    After renaming am335x-icev2-pru-excl-uio.dtb as am335x-icev2-prueth.dtb (new default dtb), icss_emacMainTest_am335x.out runs OK.

    thanks for your help,

    Paula