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.

Problem with initialization of NDK module - CfgNew gets to system exit (code made automatically by xgconf)

Other Parts Discussed in Thread: TMS320C6748, SYSBIOS

Hello,

Maybe you can help?

Thanks in advance.

The following is the data:

Board: EVMC6748 (I am using the TMS320C6748 DSP).

I am connected using the ethernet port to my router.

ccs: 5.4.0.00091

bios: 6_35_01_29

pspdrivers: 01_30_01

nsp: nsp_1_10_02_09

ndk: ndk_2_22_03_20

xdctools: 3_25_00_48

xgconf:  I selected "global network settings", "http", "tcp", "ip" and enable IPv6.

The code builder makesa thread name "ti_ndk_config_Global_stackThread" - I verfied that the debugger gets to it.

Then it fails in the following piece of code:

hCfg = CfgNew();
if (!hCfg) {
xdc_runtime_System_printf("Unable to create configuration\n");
goto main_exit;
}


The entire function that is created by the code builder is given below:

/* Main Thread */
Void ti_ndk_config_Global_stackThread(UArg arg0, UArg arg1)
{
int rc;
HANDLE hCfg;

ti_sysbios_knl_Clock_Params clockParams;

/* Create the NDK heart beat */
ti_sysbios_knl_Clock_Params_init(&clockParams);
clockParams.startFlag = TRUE;
clockParams.period = 100;
ti_sysbios_knl_Clock_create(&llTimerTick, clockParams.period, &clockParams, NULL);


/* THIS MUST BE THE ABSOLUTE FIRST THING DONE IN AN APPLICATION!! */
rc = NC_SystemOpen(NC_PRIORITY_LOW, NC_OPMODE_INTERRUPT);
if (rc) {
xdc_runtime_System_abort("NC_SystemOpen Failed (%d)\n");
}

/* Create and build the system configuration from scratch. */
hCfg = CfgNew();
if (!hCfg) {
xdc_runtime_System_printf("Unable to create configuration\n");
goto main_exit;
}

/* add the Ip module configuration settings. */
ti_ndk_config_ip_init(hCfg);

/* add the Tcp module configuration settings. */
ti_ndk_config_tcp_init(hCfg);

/*
* Boot the system using this configuration
*
* We keep booting until the function returns 0. This allows
* us to have a "reboot" command.
*/
do
{
rc = NC_NetStart(hCfg, ti_ndk_config_Global_NetworkOpen,
ti_ndk_config_Global_NetworkClose,
ti_ndk_config_Global_NetworkIPAddr);
} while( rc > 0 );

/* Delete Configuration */
CfgFree(hCfg);

/* Close the OS */
main_exit:
NC_SystemClose();
xdc_runtime_System_flush();

}

Any idea?

Thanks in advance!!!

Gaby

  • Actually it is worst:

    i suspected that the problem is that my task is called before the network task starts, so I added a five sec delay in beginning of my task.

    as a result the network task does start, but it gets to exit() which means my problem is even before...

  • Hi Gaby,

    Looks like the task priority being set is too high.  Network tasks cannot have a higher priority than the NDK's kernel priority, can you try lowering the tasks priority to 5? 

    It might also be good to take a look at section "3.1.2.2 Priority Levels for Network Tasks" and "3.1.2.3 Priorities for Tasks that Use NDK Functions" of the NDK User's Guide.

    Thanks,

    -- Emmanuel

  • Hi, thanks for your reply, I found that quickly... actually there is a callback I shall use which indicates the ndk started and only then I can start my thread functionality.

    Please note I updated the post, as the real problem was created when I corrected the priority issue - the initialization fails....

    Any help will be appreciated!!!!

  • I paid attention I get this text in the debug console...

    But I have pretty simple project...

    Maybe I shall tool at the map file, do you know where is it?

    If you have a direct suggestion how to correct it would be great....

    00000.000 MAC Address = 00-08-ee-03-14-99

    00000.000 EMAC should be up and running

    00000.000 EMAC has been started successfully

    00000.000 Registeration of the EMAC Successful

    ti.sysbios.heaps.HeapMem: line 307: out of memory: handle=0xc005cea0, size=2048
    xdc.runtime.Error.raise: terminating execution

    Thanks

    GBL

  • Hi Gaby,

    Seems like the default BIOS heap size is insufficient for your application.  Can you try increasing it within your .cfg file?

    // Default heap size
    // BIOS.heapSize = 0x1000;
    
    // Larger heap size
    BIOS.heapSize = 0x5000; // heapSize = 20480;

    *You can increase or decrease as your application requires.  

    Thanks,

    -- Emmanuel

  • Thanks!

    It is OK now, I mean this part... i will post additional query for next :)