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.

AM5728: Inconsistent debugging without gel file initialization

Part Number: AM5728


Hi,

I'm converting the gel files that initialize the am5728 to c code so that we can initialize the chip using other methods.

I've been experiencing problems with debug using my own initialization code. For instance, when I step over an instruction I get

Break at address "0x80000010" with no debug information available, or outside of program code, or when I try to run to a breakpoint, the code will go to an exception handler or the _exit() function. I was just informed that I cannot set up the debugger memory map without using gel files. Could this be the reason why I'm seeing these errors?

I'm using the GPEVM_AM572X_SiRevA kit and Blackhawk USB100v2 (although Code Composer Studio identifies this as Texas Instruments XDS100v2 Debug Probe).

Code Composer Studio Version: 8.1.0.00011

Jason

  • Jason,

    The GEL code to setup the clocks, DDR for the board is already provided in the Board library for evmAM572x. It is recommended that you link to the board library and use the API Board_init in your application to setup the clocks, PLL and DDR.

    Board library code that implements GEL functions:
    pdk_am57xx_1_0_11\packages\ti\board\src\evmAM572x

    evmAM572x.c: File contain Board_init API function.
    evmAM572x_clock.c: Functions that setup clock control using device control module.
    evmAM572x_ddr.c: Function to setup EMIF and PHY for DDR access
    evmAM572x_pll.c: Function to configure device PLLs

    For reference, you can refer to the boot\sbl code in the Processor SDK to see how the SOC is initialized in the secondary bootloader which is meant to initialize the device similar to GEL for production environment.

    SBL main function that calls Board_Init: pdk_am57xx_1_0_xx\packages\ti\boot\sbl\board\evmAM572x

    0x8000010 is an address in the DDR memory area which requires setup of EMIF and PHY to allow for HW leveling before you use that memory. If you have not initialized EMIF correct then you are like to see such issues.


    Regards,
    Rahul
  • Rahul,

    Before I go down this road, I've put in some work to convert the gel files to c files. I looked at the console output to understand the order of the gel files called by searching the GelTextOut() calls.

    Do the included gel files (assuming they're converted to C properly) have all the code needed to initialize the am5728 or would I need to use the functions you mentioned?

    I can provide my converted gel to c file source so you can see what functions I've called. 

    Jason 

  • Jason,

    The GEL files have all of the basic initialization for configuring clock modules, DPLL and setting up EMIF which is the basic minimum setup required to load and run any application code however device initialization also involves pinmux setup, PMIC AVS/ABB setup, etc which is not done using GEL files.

    Hence in production boot environment, you needs a secondary bootloader that sets up this functionality before loading the application.

    Regards,
    Rahul
  • Rahul,

    Okay. I will copy over the sbl_main.c code as the starting point. I found a lib folder in the path: C:\ti\pdk_am57xx_1_0_11\packages\ti\board\lib\evmAM572x\a15\release. Is this the correct library to include in the project properties?

    Just so I'm clear, the initialization of clocks, ddr, pll, etc. begins just before return 0 in the sbl_main.c. Correct?

    Jason
  • Jason,

    Yes, the board library that you have found is the correct one to use . Note that the board library also has dependency for OSAL, UART, I2C and PM drivers so you need to link in the dependencies correctly.

    Yes initialization will be completed before return 0 gets called. Actually return 0 will never get called as the expectation is either control is transfered to the application or the core execute while (1) before reaching return 0.

    Regards,
    Rahul
  • Rahul,

    The add library dialog is looking for libraries with .lib or .a extension. The libraries I found have .aa15fg, .ae66, and .aem4 extensions. Do I add these libraries anyhow?

    What are the conditionals that compare the different controllers such as:

    if (evmAM572xEntry.entryPoint_MPU_CPU1 != 0)
        {
            /* Bring the A15 CPU1 core out of reset. */
            SBL_MPU_CPU1_BringUp(evmAM572xEntry.entryPoint_MPU_CPU1);
        }

    comparing?

    Is the code just checking some registers transparent of the coder to ensure the different controllers are okay?

    This is where the code will go to user application or while(1). Can you clarify the difference between func_ptr and func_ptr()?

    I am very new at this, but from what I understand code needs to be written for each controller in a separate project.

    To me, this looks like code will run on the a15_0 core, and my user code is defined in func_ptr().

    /*Jump to MPU CPU0 APP*/
        if (evmAM572xEntry.entryPoint_MPU_CPU0 != 0)
        {
            func_ptr = (EntryFunPtr_t) evmAM572xEntry.entryPoint_MPU_CPU0;
            CSL_a15WbAllDataCache();
            CSL_a15InvAllInstrCache();
            __sync_synchronize();
            func_ptr();
        }
        else
        {
            while(1);
        }

  • Jason,

    Yes, files with .aa15fg, .ae66 and .aem4 extensions are archived elf libraries for a15, c66 and m4 core architectures that are supported in AM572x .

    The secondary bootloader loads the application binary for different CPUs and then wakes up the corresponding core using the entry point it detected. the code you listed above checks if entry point of application on A15 CPU1 was detected and whether to wake up the core to start executing app from the entry point . If the entry point is zero, it assumes that the core doesn`t need to be woken up since the boot image didn`t provide entry point for that core.

    In the order in which the cores are loaded and the application is started, A15 CPU0 is the last core since it is the boot master is executing the SBL. For this core the SBL needs to Invalidate and clean the cache state since there is code already executing on the core. After the cache state is cleaned the control is passed to the application. If entry point for CPU0 is not provided it will exit by putting the core in while (1) state since on this device A15 core 0 is always running and can`t be power off.

    Hope that clears the implementation.

    Regards,
    Rahul
  • Rahul,

    I believe I got ahead of myself a bit.
    What I need for complete initialization is the code from sbl_main, followed by the gel to c converted code. Is that accurate?

    Secondly, I see SBL_ImageCopy(&evmAM572xEntry); is likely where a15 cpu0 loads the application binary and then wakes up the corresponding cpu. What about that application binary signals if a cpu should wake up? In the gel files, there is a function AM572x_MULTICORE_EnableAllCores(). Does this function need to be in the application to signal that the different cpus are used?

    Also, I'm not clear on what I need to do programmatically to ensure control is passed to my application. Again, does the application binary already have this information assuming there is code other than the sbl_main.c code?

    I realize these may seem elementary questions but I have no experience whatsoever using this processor or IDE.

    Jason
  • Rahul,

    I read an earlier reponse from you about my debugging errors possibly being the result of incorrect EMIF initialization. I found the gel function that sets up the EMIF:

    void AM572x_DDR3_532MHz_Config()

    {

    System_printf("--->>> DDR3 Initialization is in progress ... <<<---\n");

    /* DDR PLL config */

    dpll_ddr_config(532);

    AM572x_CM_DDRIO_Config();

    AM572x_reset_emif_params_ddr3_532(SOC_EMIF1_CONF_REGS_BASE);

    AM572x_set_emif1_params_ddr3_532(SOC_EMIF1_CONF_REGS_BASE);

    EMIF_Config(SOC_EMIF1_CONF_REGS_BASE,

    HW_LEVELING_ENABLED,

    ENABLE_ECC);

    if (1 == IS_EMIF2_AVAILABLE)

    {

    AM572x_reset_emif_params_ddr3_532(SOC_EMIF2_CONF_REGS_BASE);

    AM572x_set_emif2_params_ddr3_532(SOC_EMIF2_CONF_REGS_BASE);

    EMIF_Config(SOC_EMIF2_CONF_REGS_BASE,

    HW_LEVELING_ENABLED,

    ENABLE_ECC);

    }

    AM572x_set_lisa_maps();

    System_printf("--->>> DDR3 Initialization is DONE! <<<---\n");

    }

    Is this not a good function call?

    Jason