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.

TMDSCNCD28388D: TCP/IP debugging

Part Number: TMDSCNCD28388D
Other Parts Discussed in Thread: SYSBIOS

Hello All

I have the problem with tcpEchoF2838X example debugging on the TMDSCNCD28388D board.

I Have installed this one with Resource Explorer from C2000Ware-v2.01.00.00 as project which uses SYS/BIOS.

So after that I start debuging of  cm_common_config_c28x projec which was compiled with  options ETHERNET UART USB on the CPU1

for low level configuration these one  peripheries (Configure I/O and clock) and CM with clock frequency 125 Mhz.

The debugger up load it to the FLASH and stop on the entry point to the main.

After that I  up load tcpEchoF2838X example to the CM FLASH and I expect  that debugger stop it on the entry point to the main

but unfortunately it start immediately and clicking  "suspend"  button does  not lead to any reaction.

From other side if I upload tcpEchoF2838X alone(CM clock frequency 95 Mhz) it starts normaly but is pended  on the function EMACF2838XLLD_resetModule(uint32_t base) (It waits Reset completion ) in the ethernet.c  file.

As I understand there is not low level configuration (at least clock) for ethernet in this case. 

In both cases,  option Global breakpoint is on.

Can anybody consult me?

Thank's

Andrii Shevchuk

  • Hello All

    Additional information

     Version of CCS is : 9.1.0.00010

    Accordinghly cfg file -  path SYS/BIOS->System->Startup->Module Settings

    Initial Size Options                                                                                     Startup Setting

    Heap Size 0                                                                                                  User reset function -  null

    Stack size 2048                                                                                                    Maximum module init passes - 32

    Argument Size 0

    Function Called Before C Runtime Initialization                                         Function Called Before Module Initialization

    N/A                                                                                                                     First function 0  - ti.sysbios.heaps.HeapMem.init

                                                                                                                           Firstfunction 1 -  ti_sysbios_family_arm_f2838x_init_Boot_initStartup

    First function 2 - ti_sysbios_hal_Hwi_initStack

    First function 3 - ti.sysbios.family.arm.m3.Hwi.initNVIC

    Function Called After Module Initialization

    N/A

    Best Regards

  • Hello All

    The content of *.cfg file of project

     ================ General configuration ================ */
    var Defaults = xdc.useModule('xdc.runtime.Defaults');
    var Diags = xdc.useModule('xdc.runtime.Diags');
    var Error = xdc.useModule('xdc.runtime.Error');
    var Log = xdc.useModule('xdc.runtime.Log');
    var Main = xdc.useModule('xdc.runtime.Main');
    var Memory = xdc.useModule('xdc.runtime.Memory');
    var System = xdc.useModule('xdc.runtime.System');
    var Text = xdc.useModule('xdc.runtime.Text');

    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
    var Startup = xdc.useModule('xdc.runtime.Startup');

    BIOS.heapSize = 12288 + 2048;

    BIOS.heapSection = ".tcpecho_bios_heap";
    Program.sectMap[".tcpecho_bios_heap"] = "E0RAM";

    Task.idleTaskStackSize = 1024;
    Program.stack = 2048;

    /* ================ System configuration ================ */
    var SysMin    = xdc.useModule('xdc.runtime.SysMin');
    SysMin.bufSize = 2048;
    System.SupportProxy = SysMin;

    /* Enable Semihosting for GNU targets to print to CCS console */
    if (Program.build.target.$name.match(/gnu/)) {
        var SemiHost = xdc.useModule('ti.sysbios.rts.gnu.SemiHostSupport');
    }

    var Main = xdc.useModule('xdc.runtime.Main');
    Main.common$.diags_INFO = Diags.RUNTIME_ON;

    /* Bring in POSIX, and enable Mutex Priority */
    /* TODO - does NDK require mutex priority?! */
    var Settings = xdc.useModule('ti.posix.tirtos.Settings');
    Settings.enableMutexPriority = true;

    /*
     * ================ NDK configuration ================
     * Create a Task hook set and configure its register function in order to
     * enable Thread Local Storage (required by the NDK).
     */
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var ndkHooks = new Task.HookSet();
    ndkHooks.registerFxn = '&NDK_hookInit';
    Task.addHookSet(ndkHooks);

    /* NDK requires BIOS to auto delete terminated Task threads */
    Task.deleteTerminatedTasks = true;
    Main.common$.diags_ENTRY = Diags.RUNTIME_ON;
    Main.common$.diags_EXIT = Diags.RUNTIME_ON;
    Main.common$.diags_STATUS = Diags.RUNTIME_ON;
    Main.common$.diags_ANALYSIS = Diags.RUNTIME_ON;
    Defaults.common$.diags_ENTRY = Diags.RUNTIME_ON;
    Defaults.common$.diags_EXIT = Diags.RUNTIME_ON;
    Defaults.common$.diags_STATUS = Diags.RUNTIME_ON;
    Defaults.common$.diags_INFO = Diags.RUNTIME_ON;
    Defaults.common$.diags_ANALYSIS = Diags.ALWAYS_ON;
    BIOS.cpuFreq.lo = 125000000;

    Best regards

    Andrii Shevchuk

  • Hi,

    Can you please run the C28x side code first and then connect and load the CM side project and run.

    On Control card if you are observing code stuck in _resetModule at CM side then it could be due improper sequence/pinmux which is to be run  in C28x side before running the CM side. Hence follow the sequence above and let me know if it helps.

    Regards,

    Sudharsanan

  • Hello

    I investigated this problem more yours ideas as well.

    So accordingly tcpecho_pem4.c  -  path  folder_of_project/Debug/configPkg/package/cfg/

    The function ti_sysbios_family_arm_f2838x_init_resetISR contain only jump to the assembler standart  _c_int00

    #if defined(__ti__)

    #pragma RETAIN(ti_sysbios_family_arm_f2838x_init_resetISR)

    #pragma CODE_SECTION(ti_sysbios_family_arm_f2838x_init_resetISR, ".resetisr")

    #endif

    void ti_sysbios_family_arm_f2838x_init_resetISR(void)

    {

        /* jump to program entry point */

        __asm("    .global _c_int00\n"

              "    b.w     _c_int00");

    }

    But linker finds this assembler function and llinks it to code.

    So I think  the reset vector is not initialized properly by ti_sysbios_family_arm_f2838x_init_resetISR after uploading.

    At list Reset occures earlier then reset  vector initialization.  And It is treated very easy.

    To properly start this example in  debugg mode,  it is neccessary

    1) attach if necessary CPU1 and CM

    2) Enable Global breakpoint on CM

    3)Load  cm_common_config_c28x.c to CPU1, load tcpEchoF2838X to the CM

    4) Select CM  and  click button "Restart" (Not "Reset").

    After that the CM is stoped on the _c_int00

    5) Start cm_common_config_c28x.c on CPU1 after that start tcpEchoF2838X on CM

    That is all. After that it is posible to see TCP/IP address in the SysMin OutputBuffer.

    Bad race condition between signal RESET and reset vector intialization is only my guess,

    but ways around the problem is effective.

    In any case it is up to Texas Instruments to  find real cause and fix it.

    By the way during my investigation

    I have learnt  TI_RTOS Kernel (SYS/BIOS) User's Guide  SPRUEX3U February 2018

    Chapter  3.1 SYS/BIOS Startup Sequence

    1. Immediately after CPU reset, perform target/device-specific CPU initialization (beginning at c_int00).

    See the "Program Loading and Running" chapter in the Assembly Language Tools User’s Guide for

    your target family for details on this step and the cinit() step.

    2. Prior to cinit(), run the table of "reset functions" (the xdc.runtime.Reset module provides this hook).

    The functions specified in the Reset.fxns[] array are called. These reset functions are called only on

    platforms where a reset is performed before running a program.

    3. Run cinit() to initialize C runtime environment.

    4. Run the user-supplied "first functions" (the xdc.runtime.Startup module provides this hook).

    5. Run all the module initialization functions.

    6. Run the user-supplied "last functions" (the xdc.runtime.Startup module provides this hook).

    7. Run pinit().

    8. Run main().

     

    But I have found mentioned above function ti_sysbios_family_arm_f2838x_init_resetISR,  which make jump to the jump to the assembler standart  _c_int00, amoung members of   "Function Called Before Module Initialization" list.

    But accordinghly mentioned above Chapter  3.1 it is should be in step 1 but it is done in step 4 (My be it is problem which leads to problem which we dicuss?   )

    In any way  my attempts to change this function list, led to the compilation error.

    So I going to create to additional questions.

    Best regards

    Andrii Shevchuk