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.

J784S4XEVM: CCS Script console: FAILED To Toggle GPIO for testing.

Part Number: J784S4XEVM

I use the launch.js after it's initialized, I set PINMAX and toggle the GPIO, but it's failed to set.

My new script is attached.config_mux - Copy.txt

script in:

ti-processor-sdk-rtos -j784s4-evm-11_02_00_06/pdk_j784s4_11_02_00_15/packages/ti/drv/sciclient/tools/ccsLoadDmsc/j784s4/

launch.js is running successfully:

DMSC Firmware run starting now...
J784S4 Running the DDR configuration... Wait till it completes!
Connecting to MCU Cortex_R5_0!
 WKUP Boot Mode is 56
 Main Boot Mode is 17
Connecting to MCU R5 1 0
Reset MCU R5 10, to ensure TCMs configurations take effect
Running the board configuration initialization from R5!
Running DDR Memory Checks....
Clearing CLEC Secure Claim...
######################################################################################
Loading Sciserver Application on MCU1_0. This will service RM/PM messages
If you do not want this to be loaded update the launch script to make loadSciserverFlag = 0
If you want to load and run other cores, please run the MCU1_0 core after Sciserver is loaded. 
######################################################################################
Happy Debugging!!

config_mux.js is failed to run:

js:> loadJSFile("/home/hro3hc/ti/ti-processor-sdk-rtos-j784s4-evm-11_02_00_06/pdk_j784s4_11_02_00_15/packages/ti/drv/sciclient/tools/ccsLoadDmsc/j784s4/config_mux.js");
Error reading memory: Errors during memory.readData(): Address: 0x10002c Error: 0x1 (/home/hro3hc/ti/ti-processor-sdk-rtos-j784s4-evm-11_02_00_06/pdk_j784s4_11_02_00_15/packages/ti/drv/sciclient/tools/ccsLoadDmsc/j784s4/config_mux.js#68)

js:> 

Brs,

Trung

  • Hi Trung,

    Could you please clarify why PINMUX configuration is being done via CCS scripting instead of through firmware?

    As per TI’s official documentation, PINMUX and GPIO configuration are expected to be handled within the application using Board_init() and the GPIO driver. We were not able to find any TI documentation recommending CCS-based PINMUX configuration for validation.

    If you are following a specific TI reference for this approach, could you please share it?

    We suggest using the standard firmware-based method for GPIO toggling. Please refer to the following TI documentation: 
    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-j784s4/11_01_01_01/exports/docs/pdk_j784s4_11_01_00_17/docs/userguide/j784s4/modules/gpio.html 

    Regards,

    Karthik

  • Dear Karthik,

    We are preparing the bring up process for TDA5 project which is starting from scratch. We are assuming nothing is working other than the JTAG interface to test.

    Sorry, I'm new to TI ENV(SDK/PDK). I could start by using firmware to configuration the GPIO as this point. Your provided link is not found(404).

    Could you help to share the full workflow to me to modify/compile/flash to config the PINMUX from the firmware?

    I have SDK & PDK ready

    ~/ti/ti-processor-sdk-rtos-j784s4-evm-11_02_00_06

    pdk_j784s4_11_02_00_15

    Brs,

    Trung

  • Hi Trung,

    Since you are starting the bring-up from scratch and currently have only JTAG access, it is recommended to first validate GPIO using a simple firmware-based example from the PDK.

    In the PDK, a GPIO toggle example is available at: <pdk>/packages/ti/drv/gpio/test/led_blink

    This example already includes the required PINMUX configuration through Board_init(), so you do not need to configure PINMUX separately via CCS scripting.

    Please refer to the updated GPIO documentation: 
    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-j784s4/11_02_00_06/exports/docs/pdk_j784s4_11_02_00_15/docs/userguide/j784s4/modules/gpio.html 

    Build Steps:
    Refer to the getting started guide:
    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-j784s4/11_02_00_06/exports/docs/pdk_j784s4_11_02_00_15/docs/userguide/j784s4/getting_started.html 

    Example build command:
    make -s GPIO_Baremetal_LedBlink_TestApp BOARD=j784s4_evm CORE=mcu1_0

    Test using CCS (JTAG):
    You can load and run the generated binary using CCS by following:
    https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-j784s4/11_02_00_06/exports/docs/psdk_rtos/docs/user_guide/ccs_setup_j784s4.html 

    Suggested Workflow:
    1. Build the GPIO LED blink example
    2. Load the binary via CCS (after running launch.js)
    3. Run the application on MCU1_0
    4. Observe GPIO toggle on the board

    Regards,

    Karthik

  • Hi Karthik,

    I follow your guidelines, but when it goes to main, it hangs at below.

    Break at address "0x3140" with no debug information available, or outside of program code.

    I double checked and confirmed below:

    it's running into the main_led_blink.c, main.

    I try to re-run many time with power on/off.

    I run the code for MCU1_0: MAIN_Cortex_R5_1_0.

    I try to modify the main_led_blink.c and confirm it's compiled. I use the original file to test.

    Brs,

    Trung

  • Hi Trung,

    Can we a have a short call regarding this issue. Could you please let me know your availability today at the earliest? 

    Regards,

    Karthik

  • Hi,

    I'm not able to join the call this time. I will arrange next week. But in the meantime, could you help to check if any guidelines to follow. Our team will investigate to prepare.

  • Hi,

    Have you made any modifications to the main_led_blink.c file? If yes, could you please share the changes? Additionally, have you tried running the default example for this test, and does it execute successfully?

    Regards,

    Karthik

  • Hi  ,

    I use the code with pdk without any modification. Code is attached.

    It's stepping into the main funciton, could call board_config, ...but after that it crashed.

    Break at address "0x898" with no debug information available, or outside of program code.

    /**
     *  \file   main_led_blink.c
     *
     *  \brief  Example application main file. This application will toggle the led.
     *          The led toggling will be done inside an callback function, which
     *          will be called by Interrupt Service Routine. Interrupts are
     *          triggered manually and no external source is used to trigger
     *          interrupts.
     *
     */
    
    /*
     * Copyright (C) 2014 - 2023 Texas Instruments Incorporated - http://www.ti.com/
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * Redistributions of source code must retain the above copyright
     * notice, this list of conditions and the following disclaimer.
     *
     * Redistributions in binary form must reproduce the above copyright
     * notice, this list of conditions and the following disclaimer in the
     * documentation and/or other materials provided with the
     * distribution.
     *
     * Neither the name of Texas Instruments Incorporated nor the names of
     * its contributors may be used to endorse or promote products derived
     * from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     */
    
    #include <ti/csl/arch/csl_arch.h>
    
    #include <ti/osal/osal.h>
    #include <ti/osal/TaskP.h>
    
    #include <stdio.h>
    #include <string.h>
    
    #include <ti/drv/gpio/GPIO.h>
    #include <ti/drv/gpio/soc/GPIO_soc.h>
    
    #include "GPIO_log.h"
    #include "GPIO_board.h"
    
    #include <ti/board/board.h>
    #include <ti/csl/soc.h>
    #include <ti/drv/sciclient/sciclient.h>
    
    #if defined (BUILD_C7X)
    #include <ti/csl/arch/csl_arch.h>
    #endif
    
    /**********************************************************************
     ************************** Macros ************************************
     **********************************************************************/
    
    #if defined (SIM_BUILD)
    #define DELAY_VALUE                     (1)
    #else
    #define DELAY_VALUE                     (500U)   /* 500 msec */
    #endif
    
    #define APP_TSK_STACK_MAIN              (0x8000U)
    
    #if defined (SOC_J7200)
    #define PADCONFIG                       (0x0011C000)    /* PADCONFIG_0 */
    #elif defined (SOC_J721S2) || defined (SOC_J784S4) || defined (SOC_J742S2)
    #define PADCONFIG                       (0x0011C0C8)    /* PADCONFIG_11*/
    #endif
    
    /**********************************************************************
     ************************** Global Variables **************************
     **********************************************************************/
    volatile uint32_t wkup_gpio_intr_triggered = 0;
    volatile uint32_t main_gpio_intr_triggered = 0;
    uint32_t gpioBaseAddr[MAX_GPIOS_USED_IN_APP] =
    {
        CSL_WKUP_GPIO0_BASE,
    #if defined(SOC_J721E)
        CSL_GPIO1_BASE,
    #elif defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4) || defined (SOC_J742S2)
        /* J7200, J721S2 has no MAIN_GPIO_1 */
        CSL_GPIO0_BASE
    #endif
    };
    uint32_t gpioPinNums[MAX_GPIOS_USED_IN_APP] =
    {
        WKUP_GPIO_PIN_NUM,
        MAIN_GPIO_PIN_NUM
    };
    
    #if defined (FREERTOS)
    static uint8_t  gAppTskStackMain[APP_TSK_STACK_MAIN] __attribute__((aligned(32)));
    #endif
    
    
    /**********************************************************************
     ************************** Internal functions ************************
     **********************************************************************/
    
    /* Delay function */
    void AppDelay(unsigned int delayVal);
    
    /* Callback function */
    void AppMainGpioCallbackFxn(void);
    void AppWkupGpioCallbackFxn(void);
    
    
    /*
     *  ======== Board_initI2C ========
     */
    static void Board_initGPIO(void)
    {
        Board_initCfg boardCfg;
        GPIO_v0_HwAttrs gpio_cfg;
        uint32_t looper;
    
        boardCfg = BOARD_INIT_PINMUX_CONFIG |
            BOARD_INIT_MODULE_CLOCK |
            BOARD_INIT_UART_STDIO;
        Board_init(boardCfg);
    
        for (looper = 0; looper < MAX_GPIOS_USED_IN_APP; looper++)
        {
            GPIO_socGetInitCfg(looper, &gpio_cfg);
            gpio_cfg.baseAddr = gpioBaseAddr[looper];
            (gpio_cfg.intCfg[gpioPinNums[looper]]).intcMuxNum = INVALID_INTC_MUX_NUM;
            (gpio_cfg.intCfg[gpioPinNums[looper]]).intcMuxInEvent = 0;
            (gpio_cfg.intCfg[gpioPinNums[looper]]).intcMuxOutEvent = 0;
            GPIO_socSetInitCfg(looper, &gpio_cfg);
        }
    }
    
    
    /*
     *  ======== AppDelay ========
     */
    void AppDelay(unsigned int delayVal)
    {
        Osal_delay(delayVal);
    }
    
    /*
     *  ======== AppLoopDelay ========
     */
    void AppLoopDelay(uint32_t delayVal)
    {
        volatile uint32_t i;
    
        for (i = 0; i < (delayVal * 1000); i++);
    }
    
    /*
     *  ======== Callback function ========
     */
    void AppWkupGpioCallbackFxn(void)
    {
        wkup_gpio_intr_triggered = 1;
    }
    
    void AppMainGpioCallbackFxn(void)
    {
        main_gpio_intr_triggered = 1;
    }
    
    #if defined(BUILD_MPU) || defined (BUILD_C7X)
    extern void Osal_initMmuDefault(void);
    void InitMmu(void)
    {
        Osal_initMmuDefault();
    }
    #endif
    
    void AppGPIOPadConfig()
    {
    #if defined (SOC_J7200) || defined (SOC_J721S2) || defined (SOC_J784S4) || defined (SOC_J742S2)
        Board_init(BOARD_INIT_UNLOCK_MMR);
        /* Set Ball number U6 to RX_ACTIVE on PADCONFIG0 in J7200 */
        /* Set Ball number AG24 to RX_ACTIVE on PADCONFIG0 in J721S2 */
        /* RX_ACTIVE=1, MUX_MODE=7 for GPIO */
        *((uint32_t *)(PADCONFIG)) = 0x00040007;
    #endif
    }
    
    #if defined (RTOS_ENV)
    void gpio_test(void* arg0, void* arg1)
    {
    #else
    int main()
    {
    #endif
    
        /* Call board init functions */
        Board_initGPIO();
    
        /* GPIO initialization */
        GPIO_init();
    
        /* Set the callback function */
        GPIO_setCallback(WKUP_GPIO, AppWkupGpioCallbackFxn);
        GPIO_setCallback(MAIN_GPIO, AppMainGpioCallbackFxn);
    
        /* Enable GPIO interrupt on the specific gpio pin */
        GPIO_enableInt(WKUP_GPIO);
        GPIO_enableInt(MAIN_GPIO);
    
        AppGPIOPadConfig();
      
        GPIO_log("\n -------------GPIO Led Blink Application------------- \n");
        UART_printStatus("\n Awaiting interrupt occurrence ...\n");
    
    
        GPIO_toggle(WKUP_GPIO);
        GPIO_toggle(MAIN_GPIO);
    
        AppDelay(DELAY_VALUE);
        while (wkup_gpio_intr_triggered == 0U)
        {
            
        }
        UART_printStatus("\n WKUP GPIO toggled!! \n");
        while (main_gpio_intr_triggered == 0U)
        {
            
        }
        UART_printStatus("\n MAIN GPIO toggled!! \n");
        if(0U != wkup_gpio_intr_triggered && 0U != main_gpio_intr_triggered)
        {
            UART_printStatus("\n All tests have passed!! \n");
        }
    
    }
    
    #if defined (RTOS_ENV)
    /*
     *  ======== main ========
     */
    int main(void)
    {
    
        TaskP_Params taskParams;
        
        /*  This should be called before any other OS calls (like Task creation, OS_start, etc..) */
        OS_init();
    
        TaskP_Params_init(&taskParams);
        taskParams.priority     = 2;
        taskParams.stack        = gAppTskStackMain;
        taskParams.stacksize    = sizeof (gAppTskStackMain);
    
        TaskP_create(&gpio_test, &taskParams);
    
        OS_start();
    
        return (0);
    }
    #endif
    
    
    

  • Hi  ,

    I also tested with. GPIO_LedBlink_TestApp_freertos.

    It's stop at this while loop.


    /* Data Abort handler starts execution in HwiP_data_abort_handler, defined in portASM.S
    * After some initial assembly logic it then branches to this function.
    * After exiting this function it does some more assembly to return to the next instruction
    * following the one which caused the exception.
    */
    void __attribute__((section(".text.hwi"))) HwiP_data_abort_handler_c(void)
    {
    /* Call registered call back */
    gCurrentProcessorState = CSL_ARM_R5_ABORT_MODE;
    vPortDumpExceptionState();
    if ((exptnHandlerPtr)NULL != gExptnHandlers.dabtExptnHandler)
    {
    gExptnHandlers.dabtExptnHandler(gExptnHandlers.dabtExptnHandlerArgs);
    }
    else
    {
    /* Go into an infinite loop.*/
    volatile bool loop = BTRUE;
    while(loop)
    {
    }
    }
    }

  • Hi Trung,

    Could you please tell me which binary file is being used in  CCS for this test?

    Regards,

    Karthik

  • Hi  ,

    I'm testing with this one:

    GPIO_LedBlink_TestApp_freertos/bin/j784s4_evm/GPIO_LedBlink_TestApp_freertos_mcu1_0_release.xer5f

  • Hi Trung,

    Could you please build the application in debug mode, set a breakpoint at the entry of main(), step through the execution flow, and identify the specific API call causing the issue.

    Build Command: 

    make -s GPIO_LedBlink_TestApp_freertos BOARD=j784s4_evm CORE=mcu1_0 BUILD_PROFILE=debug

    Regards,

    Karthik