I generated NIMU_emacExample_EVMC6678C66BiosExampleProject with pdkProjectCreate.bat and pdk_c667x_2_0_4, which it is bundled in the latest ProcSDK(Release 03.02.00). And I see the following code in helloWorld.c :
// // THIS MUST BE THE ABSOLUTE FIRST THING DONE IN AN APPLICATION before // using the stack!! // rc = NC_SystemOpen( NC_PRIORITY_LOW, NC_OPMODE_INTERRUPT ); if( rc ) { platform_write("NC_SystemOpen Failed (%d)\n",rc); for(;;); } // // Create and build the system configuration from scratch. // // Create a new configuration hCfg = CfgNew(); if( !hCfg ) { platform_write("Unable to create configuration\n"); goto main_exit; } // // THIS MUST BE THE ABSOLUTE FIRST THING DONE IN AN APPLICATION!! // rc = NC_SystemOpen( NC_PRIORITY_LOW, NC_OPMODE_INTERRUPT ); if( rc ) { platform_write("NC_SystemOpen Failed (%d)\n",rc); for(;;); } // Print out our banner platform_write(VerStr); // // Create and build the system configuration from scratch. // // Create a new configuration hCfg = CfgNew(); if( !hCfg ) { platform_write("Unable to create configuration\n"); goto main_exit; } // We better validate the length of the supplied names if( strlen( DomainName ) >= CFG_DOMAIN_MAX || strlen( HostName ) >= CFG_HOSTNAME_MAX ) { platform_write("Names too long\n"); goto main_exit; } // Add our global hostname to hCfg (to be claimed in all connected domains) CfgAddEntry( hCfg, CFGTAG_SYSINFO, CFGITEM_DHCP_HOSTNAME, 0, strlen(HostName), (UINT8 *)HostName, 0 );
Now my question is why does this example code call NC_SystemOpen() and CfgNew() API twice ? I believe it should call these APIs only once at stack initialization. Any suggestions ?
Best Regards,
Naoki