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.

66AK2G12: NDK setup using XCONFIG

Part Number: 66AK2G12

Trying to setup NDK for EVMK2G using CCS XCONFIG and the next doubts arise:

1.- Does the NDK code generated by XCONFIG include qmss and cppi setup?

2.- Does the NDK code generated by XCONFIG include the OSAL layer setup?

3.- I see that the 66AK2G12 device is not included in the EMAC module so I need to link the EMAC driver myself. How to do this? Is there any example? I have seen examples to setup NDK using the C code method but none ussing the XCONFIG method.

I use CCS 10.4.0.00006 and NDK 3.61.01.01.

Thanks and best regards.

  • Hello,

    Does the NDK code generated by XCONFIG include qmss and cppi setup?

    XCONFIG does not generate NDK code. It just configures the NDK library. CPPI/AMSS needs to be configured separately to NDK.

    Does the NDK code generated by XCONFIG include the OSAL layer setup?

    No, OSAL needs to be configured independently too.

    I see that the 66AK2G12 device is not included in the EMAC module so I need to link the EMAC driver myself. How to do this? Is there any example? I have seen examples to setup NDK using the C code method but none ussing the XCONFIG method.

    Please look into PDK examples from the Processor SDK for K2G (download from here). Please follow guides here to create PDK example projects. Once the example projects are created, you'll find EMAC examples as well as NIMU examples which use NDK.

    Regards,

    Jianzhong

  • Thanks Jianzhongxu,

    Document SPRU523K, page 32, says that XCONFIG generates code both to populate the configuration database and to act as the network scheduling function. As a matter of fact I have found in debug/configPkg/package/cfg that there is such generated code; there is a file named gpio_arm_pa15fg.c that effectively includes such code and taht is linked to the project.

    In this file there is no cppi/qmss nor osal code, so there you are right, I suppose I will have to setup these appart.

    As for the examples, I already have them; I have imported into my CCS projects both EMAC_BasicExample_evmK2G_armBiosExampleProject and NIMU_BasicExample_evmK2G_armexampleproject. Both compile and appart for some warnings they compile and work. But in both cases these are projects that use the C code setup option, they do not use the XCONFIG setup option. I have also taken a look to the other examples and none of them use the XCONFIG option that is what I'm looking for.

    I have tried to confiugre NDK using XCONFIG and following instructions from SPRU523K document, when compiling, the first thing you get is a compilation error saying that NIMUDeviceTable is missing. This error is not documened in SPRU523K, and I have only found poor documentation in Internet regarding this error. Finally I copied from the NIMU example and created NIMUDeviceTable[MAX_TABLE_ENTRIES]. MAX_TABLE_ENTRIES is equal to 3 in the example so I copied that not knowing exactly what I'm doing. But al least the project compiles. I run the compilation in the EVMK2G board and I see that just after running NetworkStart I get NetworkClose (I have setup hook functions in XCONFIG for both net start and net close, functions that only print messages, so thats how I know where the program has run to).

    After several weeks looking for docs and examples and trying this and that, I'm not able to avoid getting the network stop a few milisencods after running the network start.

    In the examples I see that the only EMAC configuration performed is to update the descriptor base address. I've done the same in my project copying from the example, but still no results. Also I see there is an nssPowerUp function; I suppose that XCONFIG takes care of powering up the NSS, nevertheless I also cpied this function and called where appropriate but still no results.

    I also see that both examples configure qmss and cppi. Why is this configuration needed? Can this bee the reason why my net stops just after starting it?

    Thanks and best regards.

  • But in both cases these are projects that use the C code setup option, they do not use the XCONFIG setup option

    For the example project NIMU_BasicExample_evmK2G_armexampleproject, I can see the NDK Core Stack using the XGCONF. I had to choose NDK Core Stack from the upper left drop down list:

  • Yes but in the advanced options you can see that the "enableCodeGeneration" flag is set to FALSE, therefore XCONFIG only links the NDK libraries but does not generate any C code; in these examples all C code is written by hand. Setting the "enableCodeGeneration" flag to TRUE in the advanced NDK settings you also get the C code that configures the stack and inserts the main NDK task, the one that calls NC_NetStart().

  • Okay. I see what you mean now. Yes, the configuration code can be generated by the XGCONF tool.

  • Thankyou Jianzhongxu.

    I have made some progress studying chapter 11.13 in document 66AK2GXX.trm, "Networking Subsystem (NSS)". Now I understand the need of cppi and qmss when using NDK.

    To this regard I have also seen that the example project NIMU_BasicExample_evmK2G_armexampleproject, in its .cfg script has the next entries:

    /* Load the CPPI package */
    var Cppi = xdc.loadPackage('ti.drv.cppi');

    /* Load the QMSS package */
    var Qmss = xdc.loadPackage('ti.drv.qmss');

    /* Load the RM package */
    var Rm = xdc.loadPackage('ti.drv.rm');

    var socType = "k2g";
    var Nimu = xdc.loadPackage('ti.transport.ndk.nimu');
    Nimu.Settings.socType = socType;

    Osal.osType = osType;
    Osal.socType = devType;

    That my .cfg script does not have. Because my config graphical interface is practically equal to that of the example, I assume that the configuraqtion graphical interface, XCONFIG, does not write these entries into the script. Therefore I suspect that the designer of the example included these entries by hand himself.

    ¿Why has XCONFIG not include these entries automatically in my script if they are needed for the NDK to work? Or is it that I'm missing something and the XCONFIG does include these entries automatically but there is something that I'm not configuring or configuring wrongly?

    After adding these entries and including in the project cppi_device.c, qmss_device.c and nimu_osal.c (copied from the example), the project builds O.K. with no errors. I cannot test the results using EVMK2G yet, as I do not have it near me at these moments, but I will test this compilation further on this week and let you know if finally I do not get the network close just after the network open. 

  • Why has XCONFIG not include these entries automatically in my script if they are needed for the NDK to work?

    Because XGCONF doesn't know the dependent packages for NDK.

  • Thanks Jianzhongxu.

    I have tested linking those packages by hand, as I mentioned before it compiles but now I get the next error:

    Can't find a source file at "/db/ztree/library/trees/newlib/newlib-a00/src/linaro/gcc-arm-none-eabi-7-2017-q4-major/src/newlib/libgloss/arm/swi.h" 

    I suppose this is a diferent problem that I will try to learn next. I will post a new question if needed, this post can be set as resolved. Thanks again.