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: Issues while debugging memcpy_main_baremetal.c with MCU R5F and DSP C7X running

Part Number: TDA4VM


Tool/software:

Hello Ti,

In order to perform memory transfers via DMA with the C7X, I wanted to familiarize myself with this by using the main provided by TI, namely memcpy_main_baremetal.c. However, when I start a debug session, I never exit the Board_init() function. Below is the code of the main:


/**
* \file memcpy_main_baremetal.c
*
* \brief Main file for baremetal build
*/

/* ========================================================================== */
/* Include Files */
/* ========================================================================== */

#include <stdint.h>
#include <ti/board/board.h>
#include <ti/drv/uart/UART.h>
#include <ti/drv/uart/UART_stdio.h>
#include <stdio.h>

/* ========================================================================== */
/* Macros & Typedefs */
/* ========================================================================== */

/* None */

/* ========================================================================== */
/* Structure Declarations */
/* ========================================================================== */

/* None */

/* ========================================================================== */
/* Function Declarations */
/* ========================================================================== */

extern int32_t Udma_memcpyTest(void);

/* ========================================================================== */
/* Global Variables */
/* ========================================================================== */

/* None */

/* ========================================================================== */
/* Function Definitions */
/* ========================================================================== */

int main(void)
{

printf("DEbut de la config de la board");

Board_initCfg boardCfg;

boardCfg = BOARD_INIT_MODULE_CLOCK |
BOARD_INIT_PINMUX_CONFIG |
BOARD_INIT_UART_STDIO;

Board_init(boardCfg);

printf("Fin de la config de la board");

#if defined(BOARD_ENABLE_DDR_REG_VERIFY)
Board_STATUS status;

UART_printf("DDR Register Check In Progress...\n");
status = Board_init(BOARD_INIT_DDR_REG_VERIFY);
if(status != BOARD_SOK)
{
if(status == BOARD_DDR_CTL_REG_CHECK_FAIL)
{
UART_printf("DDR Control Register Check Failed!!\n");
}
else if(status == BOARD_DDR_PHYINDEP_REG_CHECK_FAIL)
{
UART_printf("DDR PHY INDEP Register Check Failed!!\n");
}
else if(status == BOARD_DDR_PHY_REG_CHECK_FAIL)
{
UART_printf("DDR PHY Register Check Failed!!\n");
}

return -1;
}
else
{
UART_printf("DDR Register Check Successful!\n");
}
#endif

Udma_memcpyTest();

return(0);
}  

Note that I added printf statements before and after the function to check if I was entering it. None of these printf statements are visible in the console when I run. To see more details about what was happening, I used step into to understand what wasn't working. Each time, I find myself stuck in the following function:

To address this issue, I proceeded as follows:

  • Launch the script launch.js
  • Click on the R5_0 core, then click the "Run" button at the top
  • Load an application on the C7X core and start it

Despite this, I have the same problem, which I do not understand...

  • hi,

    Is the sciserver running on mcu1_0 core? This call has dependency on the sciserver. When you run the launch.js script, it typically loads sciserver binary on the mcu1_0, then you typically need to click on the run button on mcu1_0 in CCS to let it run.

    Regards,

    Brijesh

  • Hi Brijesh,

    I think so, yes.

    I am using the launch.js script located at this path: Packages\ti-processor-sdk-rtos-j721e-evm-10_01_00_04\pdk_jacinto_10_01_00_25\packages\ti\drv\sciclient\tools\ccsLoadDmsc\j721e\launch.js, and I see code that seems to indicate that sciserver is indeed running on the MCU1_0 core



    function loadSciserver()
    {
    updateScriptVars();
    print("######################################################################################");
    print("Loading Sciserver Application on MCU1_0. This will service RM/PM messages");
    print("If you do not want this to be loaded update the launch script to make loadSciserverFlag = 0");
    print("If you want to load and run other cores, please run the MCU1_0 core after Sciserver is loaded. ");
    print("######################################################################################");
    dsMCU1_0.expression.evaluate('GEL_Load("'+ sciserver_elf_file +'")');
    }

    function doEverything()
    {
    printVars();
    connectTargets();
    disconnectTargets();
    sampleDDRCheck ();
    if (clearCLECSecureClaimFlag == 1)
    {
    print("Clearing CLEC Secure Claim...");
    clearCLECSecureClaim();
    }
    if (loadSciserverFlag == 1)
    {
    loadSciserver();
    }

    dsMCU1_0.target.runAsynch();
    print("Happy Debugging!!");
    }


    Also, as you mentioned, after launching the launch.js script, I do run the MCU1_0 core by clicking the run button. I let it run, and then I connect to the C7X DSP, load my program (memcpy_main_baremetal.c), and then run it. However, it doesn't work and stays forever in a loop.

    Best regards, 

    Mélanie

  • Hi Melanie,

    but why do you want to call Board_init from C7x? Typically it is called only for R5F core.. and where does it loop around? can you please share some more information? 

    Regards,

    Brijesh