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: Application start issue

Part Number: AM5728

Tool/software: Linux

Hi.

I'm using AM572x custom board. I registered to start the application on the system service. There is a problem when launching the application.

1.  Some threads will not work, but ....Application has no problem when it start manually from the console.

2.  When I set "StandardOutput = journal + console" with service, the following output appears indefinitely. I need to see the log output from the application. but i can't see cuz that indefinitely messages.

This is console output:

-------------------------------------------------------------------------------------------------

sootoo23-InitScript.sh[839]:

sootoo23-InitScript.sh[839]: 

sootoo23-InitScript.sh[839]:

sootoo23-InitScript.sh[839]:

....

best regards,

John Kim

  • Hello John,

    If the application has no problem when it start manually from the console, that means you do not have the same environments exported in your system service. Please, export them in this way.

    Best regards,
    Kemal

  • Hi Kemal,

    As you taught, after setting the environment variable for the first time, I tried running my application.
    However, the problem was not solved.

    Best regards,
    John Kim
  • Debug your sootoo23-InitScript.sh service, it it the main culprit for these indefinitely messages.

  • Hi Kemal,

    Why do you think there is a problem with the sootoo23-InitScript.sh script?

    This script works fine with no problem when run manually from the console.

    This is the script content.
    ---------------------------------------------------------------

    #!/bin/sh
    fbset -g 800 480 800 480 32;
    export QT_QPA_PLATFORM = linuxfb;
    export LD_LIBRARY_PATH = "/ lib";

    ./MYAPP
    ---------------------------------------------------------------

    Best regards,
    John Kim

  • Please add this to your script:

    # Important System Environment Variables
    SCRIPTS=/etc/profile.d/*.sh
    for f in $SCRIPTS
    do
    source $f
    done

    I took it from here.

  • Mar 8,2018 8: 28 PM day Same as the posted content.

    I tried that content already,
    The problem is not solved.

  • Can you attach the sootoo23-InitScript.sh and post the exact step how you enable that service? I will try it on my end.

  • Thank you for your reply



    "/etc/init.d/sootoo23-InitScript.sh"
    --------------------------------------------------------------------------------------
    #!/bin/sh

    fbset -g 800 480 800 480 32;

    # pru core & eth module insert
    insmod /lib/modules/prueth/pruss.ko;
    insmod /lib/modules/prueth/pruss_intc.ko;
    insmod /lib/modules/prueth/rpmsg_pru.ko;
    insmod /lib/modules/prueth/pru_rproc.ko;
    insmod /lib/modules/prueth/prueth.ko;

    # DIO CAN Link Up
    ip link set can0 type can bitrate 1000000 triple-sampling on;
    ip link set can0 up;
    ip link set can1 type can bitrate 1000000 triple-sampling on;
    ip link set can1 up;

    # Export
    export QT_QPA_PLATFORM=linuxfb;
    export LD_LIBRARY_PATH="/lib";

    # EXEC Process & APP
    /apps/MPU_APP
    --------------------------------------------------------------------------------------



    "/lib/systemd/system/sootoo23.service"
    --------------------------------------------------------------------------------------
    [Unit]
    Description=sootoo23 scripts
    After=systemd-remount-fs.service systemd-tmpfiles-setup.service auditd.service syslog.target

    [Service]
    Environment="LD_LIBRARY_PATH=/lib"
    ExecStart=/etc/init.d/sootoo23-InitScript.sh
    StandardOutput=journal+console
    #StandardOutput=console

    [Install]
    WantedBy=multi-user.target
    --------------------------------------------------------------------------------------

  • Your application prints that gibberish output. See the output of mine. It is all clear.

    [   15.895457] sootoo23-InitScript.sh[257]: qtApp Starting

  • Please explain in more detail.
    Which part is the problem and how to fix it.

    Also, I also want to know why there is no problem manually when running the application from the console.

    The following is the log that I ran manually from the console.

    -----------------------------------------------------------------------------------------------------------

    Main Start Mar 12 2018 15:47:32
    SQLITE Library Version:3.5.9
    [DBOpen] DB Open Name: /.db/DB.sqlite
    [DBOpen] DB Open Name: /.db/LDB.sqlite
    [DBOpen] DB Open Name: /.db/EDB.sqlite
    [DBM_Init] Done.
    net eth0: initializing cpsw version 1.15 (0)
    net eth0: phy found : id is : 0x221622
    8021q: adding VLAN 0 to HW filter on device eth0
    CMD = ifconfig eth0 0xc0a80032 up;
    IP: 0xc0a80032
    CMD = route add default gw 0xc0a80001;
    GW: 0xc0a80001
    [TimeSync] Time sync from RTC
    [PCProcessMain] start!!
    [IOM_Init]CAN Time out!
    [HMIProcess] Process Start.
    [ConsoleProcessMain] Start

    ************************************************************
    **              Copyright(C) ********Co., Ltd.                  **
    **                -------------------------------------                  **
    **                  Product ******-IED V: 1.00                   **
    ************************************************************

    PROMPT>

  • It is an interesting question you are asking me here. How can I know, what your own 3-rd party application does? Please suggest?
  • I think that this problem is not a problem of "Application".

    becouse..,
    Remove"StandardOutput" config in Service, the application works well.

  • Are you using the latest Processor SDK?

  • I use this SDK Ver.

    Host PC OS: Ubuntu 16...04 linux 64bit
    AM5728 BSP: u-boot-2016.05 / linux-rt-4.4.19
    AM5728 SDK Ver: ti-processor-sdk-linux-rt-am57xx-evm-03.01.00.06
  • It is again your "Application". I checked on ti-processor-sdk-linux-rt-am57xx-evm-03.01.00.06, there is no such issue. Please, create a simple demo application based on your application with one print, then test it on your board, if the print is not readable gibberish attach that demo application to test it on my side.

  • Thank you for your reply

    I have one question.

    Is it possible to remove script name output?
    I want to output only the output of Application.

        >> sootoo23-InitScript.sh[257]: QT App start 

        >>  QT App start

  • Nothing is impossible, in the context of Linux.

    The script name is printed by the identifier here in <tisdk>/build/arago-tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/systemd/<version>/git/src/journal/journald-console.c, comment out the IOVEC_SET_STRING for the messages you do not want to see.

            /* First: timestamp */
            if (prefix_timestamp()) {
                    assert_se(clock_gettime(CLOCK_MONOTONIC, &ts) == 0);
                    xsprintf(tbuf, "[%5"PRI_TIME".%06ld] ",
                             ts.tv_sec,
                             ts.tv_nsec / 1000);
                    IOVEC_SET_STRING(iovec[n++], tbuf);
            }
    
            /* Second: identifier and PID */
            if (ucred) {
                    if (!identifier) {
                            get_process_comm(ucred->pid, &ident_buf);
                            identifier = ident_buf;
                    }
    
                    xsprintf(header_pid, "["PID_FMT"]: ", ucred->pid);
    
                    if (identifier)
                            IOVEC_SET_STRING(iovec[n++], identifier);
    
                    IOVEC_SET_STRING(iovec[n++], header_pid);
            } else if (identifier) {
                    IOVEC_SET_STRING(iovec[n++], identifier);
                    IOVEC_SET_STRING(iovec[n++], ": ");
            }

    You can find the Processor SDK 03.01.00.06 build steps here.

  • Thank you Kemal.

    I solved the problem by modifying the journald-console part.