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.

TDA4VM: How to change CPSW uart debug printf port?

Part Number: TDA4VM


Dear Experts :

as title.

follow this link:

https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-jacinto7/07_03_00_07/exports/docs/vision_apps/docs/user_guide/ETHFW_DEMOS.html#ETHFW_HOWTO_DISABLE

Open UART client like minicom on /dev/ttyUSB0 (instance 0) where Linux and OpenVx logs usually appear and another on /dev/ttyUSB2 for (instance 2) for NDK and Ethfw logs.

Ethfw use instance 2 for printf debugging (ex:ENETRACE_DBG, ENET_devAssert ...etc), How to change print on instance 0 (same as Linux log)

Mamy Thanks

Gibbs

  • Hi,

    Can you take a look at this FAQ ?

    Regards

    Vineet

  • I don't think two cores sharing the same UART is a great idea. Might result in conflicts. Do you have any other UART outputs ?

    Regards

    Vineet

  • Hi, Vineet :

    Thanks your reply,

    I have followed this thread to make some modify, But it still does not work !

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/993241/tda4vm-psdkra7-2-ethfw-uart-port-change-in-vision_apps-firmware

    I try to let MCU_UART0 as CPSW debug out, my step as below :

    1. enet_appboardutils_j721e_evm.c  -->  EnetBoard_boardInit(void)

        initParams.uartInst      = 0U;
        initParams.uartSocDomain = BOARD_SOC_DOMAIN_MCU;

    2. enet_appboardutils_j721e_evm.c  --> EnetBoard_initEthFw(void)

        uint32_t clkModuleId[] = { TISCI_DEV_DDR0,
                                   TISCI_DEV_TIMER12,
                                   TISCI_DEV_TIMER13,
                                   TISCI_DEV_MCU_UART0, };

    3, enet_board_pinmux_j721e_data.c, change pin mux

    /*static pinmuxPerCfg_t gUart2PinCfg[] =
    {
        //MyUART2 -> UART2_RXD -> Y1
        {
            PIN_SPI1_CLK, PIN_MODE(3) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },
        //MyUART2 -> UART2_TXD -> Y5
        {
            PIN_SPI1_D0, PIN_MODE(3) | \
            ((PIN_PULL_DISABLE) & (~PIN_PULL_DIRECTION & ~PIN_INPUT_ENABLE))
        },
        {PINMUX_END}
    };*/
    
    
    static pinmuxPerCfg_t gMcu_uart0PinCfg[] =
    {
        /* MyMCU_UART1 -> MCU_UART0_RXD -> H28 */
        {
            PIN_WKUP_GPIO0_13, PIN_MODE(0) | \
            ((PIN_PULL_DISABLE | PIN_INPUT_ENABLE) & (~PIN_PULL_DIRECTION))
        },
        /* MyMCU_UART1 -> MCU_UART0_TXD -> G29 */
        {
            PIN_WKUP_GPIO0_12, PIN_MODE(0) | \
            ((PIN_PULL_DISABLE) & (~PIN_PULL_DIRECTION & ~PIN_INPUT_ENABLE))
        },
        {PINMUX_END}
    };
    
    
    static pinmuxModuleCfg_t gUartPinCfg[] =
    {
        {0, TRUE, gMcu_uart0PinCfg},
        /*{2, TRUE, gUart2PinCfg},*/
        {PINMUX_END}
    };
    
    pinmuxBoardCfg_t gEthFwPinmuxData[] =
    {
        {0, gWkup_i2cPinCfg},
        {1, gDebugssPinCfg},
        {2, gGpioPinCfg},
        {3, gI2cPinCfg},
        {4, gSystemPinCfg},
        {5, gUartPinCfg},
        {PINMUX_END}
    };

    4. enet_board_pinmux.c , check reference correct pinmux function

    int32_t EnetBoard_configEthFwPinmux (void)
    {
        int32_t status = BOARD_SOK;
    
    #if defined(BUILD_MCU2_0) && defined(SOC_J721E)
    
        Board_pinmuxUpdate(gEthFwPinmuxData,
                           BOARD_SOC_DOMAIN_MAIN);
        /* Overwrite the ICSSG RGMII muc configurations with CPSW */
        /* Below is CPSW9G QSGMII pinmux configuration,
           RGMII Ports - 1,3,4,8. QSGMII ports - 2,5,6,7 */
    
        //Board_pinmuxUpdate(gJ721E_MainPinmuxDataGesiCpsw9gQsgmii,
        //                   BOARD_SOC_DOMAIN_MAIN);
        
        Board_pinmuxUpdate(gJ721E_MainPinmuxDataGesiCpsw9g,
                           BOARD_SOC_DOMAIN_MAIN);
                           
    #elif defined(BUILD_MCU2_0) && defined(SOC_J7200)
        /* Below is CPSW5G QSGMII pinmux configuration,
           RGMII Ports - 1. QSGMII ports - 2,3,4 */
        Board_pinmuxUpdate(gJ7200_MainPinmuxDataCpsw,
                           BOARD_SOC_DOMAIN_MAIN);
        Board_pinmuxUpdate(gJ7200_WkupPinmuxDataCpsw ,
                           BOARD_SOC_DOMAIN_MAIN);
    #endif
    
        return status;
    }
    

    5. UART_drv.c --> UART_init, disable UART_socInit()

    void UART_init(void)
    {
        if (UART_count == (-((int32_t)1))) {
            /* Call each driver's init function */
            for (UART_count = 0; UART_config[UART_count].fxnTablePtr != NULL; UART_count++) {
                UART_config[UART_count].fxnTablePtr->uartInitFxn((UART_Handle)&(UART_config[UART_count]));
            }
        }
    //Gibbs@0603
    //#if defined (BUILD_MCU)
        //UART_socInit();
    //#endif
    }

    6. Compiler new firmware "j7-main-r5f0_0-fw" and "j7-main-r5f0_1-fw", stuff it to our customer board

    7.  "ln -sf ethfw/app_remoteswitchcfg_server_strip.xer5f j7-main-r5f0_0-fw" in target board

    8. reboot & check, but now message output from MCU_UART0

    Any comment ? 

    How do I make sure correct uart pin setting in Linux Console?

    Many Thanks

    Gibbs

  • Hi,
    Are you trying this on the EVM ?

    Regards

    Vineet

  • No, We use our customized board

  • Hi Gibbs,

    Sorry for the delay.

    Is this issue still open ?

    Regards

    Vineet

  • I do not solve this problems ...

  • Hi Vineet:

    please reply your comments.

    BR Rio

  • Hi,

    While I do not have a solution for your problem yet. You can try this workaround to get output of Ethernet Firmware on Linux console

    cat /sys/kernel/debug/remoteproc/remoteproc*/trace0

    Please try and let me know

    Regards

    Vineet

  • Hi, Vineet 

    traces log is only show on remoteproc3 / remoteproc4, information as below.

    root@j7-evm:/sys/kernel/debug/remoteproc# ls -l
    total 0
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc0
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc1
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc10
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc11
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc12
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc13
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc14
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc15
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc16
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc17
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc18
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc19
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc2
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc3
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc4
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc5
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc6
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc7
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc8
    drwxr-xr-x 2 root root 0 Apr 10 00:05 remoteproc9
    
    
    root@j7-evm:/sys/kernel/debug/remoteproc/remoteproc3# cat trace0
    Starting Sciserver..... PASSED
    IPC_echo_test (core : mcu1_0) .....
    IPC Driver Revision: 01.00.00.01
    
    
    root@j7-evm:/sys/kernel/debug/remoteproc/remoteproc4# cat trace0
    00000.000 TaskGetEnv: FATAL: NDK not initialized
    00000.000 fdOpenSession: OOM
    00000.000 TaskGetEnv: FATAL: NDK not initialized
    00000.000 fdOpenSession: OOM
    00000.000 TaskGetEnv: FATAL: NDK not initialized
    00000.000 fdOpenSession: OOM
    00000.000 TaskGetEnv: FATAL: NDK not initialized
    00000.000 fdOpenSession: OOM
    [NIMU_NDK] Registration of the ENET Successful
    root@j7-evm:/sys/kernel/debug/remoteproc/remoteproc4#
     

  • Hi,

    traces log is only show on remoteproc3 / remoteproc4, information as below.

    Understood. But, can you run the command I provided above and let me know the output, I want to see what happens. EthFW output should be enabled

    cat /sys/kernel/debug/remoteproc/remoteproc*/trace0

    Regards

    Vineet

  • Hi, Vineet

    here you are.

    cat /sys/kernel/debug/remoteproc/remoteproc*/trace0
    Starting Sciserver..... PASSED
    IPC_echo_test (core : mcu1_0) .....
    IPC Driver Revision: 01.00.00.01
    00000.000 TaskGetEnv: FATAL: NDK not initialized
    00000.000 fdOpenSession: OOM
    00000.000 TaskGetEnv: FATAL: NDK not initialized
    00000.000 fdOpenSession: OOM
    00000.000 TaskGetEnv: FATAL: NDK not initialized
    00000.000 fdOpenSession: OOM
    00000.000 TaskGetEnv: FATAL: NDK not initialized
    00000.000 fdOpenSession: OOM
    [NIMU_NDK] Registration of the ENET Successful
    root@j7-evm:~#

    Thanks

    Gibbs

  • Hi Gibbs,

    Thanks. Are you running Vision SDK (within RTOS) or Linux SDK ?

    Regards

    Vineet

  • Hi, Vineet 

    After  executing "init vision sdk "  (/opt/vision_apps# ./vision_apps_init.sh) 

    and then, capture these logs what you wanted

    Gibbs

  • Hi,

    That's probably the reason, if you use Linux setup from TDA4 Linux SDK then you will be able to see it.

    Regards

    Vineet