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.

RTOS/TMDXICE110: PRU initialization questions

Part Number: TMDXICE110

Tool/software: TI-RTOS

Hello.

I have a two questions. Questions related to the example of TI NIMU_ICSS_BasicExample_iceAMIC110_wSoCLib_armExampleproject

Question №1. In the code of example there is a task void taskPruss (UArg a0, UArg a1). I do not quite understand what this task is doing. Judging by the code, this task is called once and executes something copy in memory. The comment says that this is initialization of PRU. What does this task do?

Question №1. In the code of example there is a function void stackInitHook(HANDLE hCfg). What does this task do? What stack initialise this hook? 

  • The RTOS team have been notified. They will respond here.
  • Hi Kiselev,

    Ans #1 - taskPruss is to load the PRU program/firmware to instruction memory (IRAM) of PRU core 0 and 1, and then enable PRU after loading.

    The firmware is located in ti/drv/icss_emac/firmware/icss_dualemac/bin/am335x/a8host/REV1/ and you can find the link details in the CCS-CCSBuild->GNU Linker->Miscellaneous.

    Ans #2 - The stackInitHook function is to add P address and gateway for icss emac interface 1. This is part of NDK stack initialization (Global.stackInitHook = "&stackInitHook"; in cfg file), below is copied from NDK API reference guide,  4.5.1 Initialization Procedure -

    If you use the XGCONF configuration tool to configure the NDK, the basic process of stack initialization

    occurs as follows:

    1. Run the Stack Thread Begin (Global.stackBeginHook) hook function if one is configured. Note that no

    NDK-related code can run in this hook function because the NC_SystemOpen() function has not yet

    run.

    2. Initialize the operating system environment with the initialization function NC_SystemOpen( Priority,

    OpMode ). This function must always be called first - before any other NDK related function. The

    calling parameters determine the priority and operating mode of the network event scheduler.

    3. Create a new configuration via CfgNew() (which is called from generated code).

    4. Run the Stack Thread Initialization (Global.stackInitHook) hook function if one is configured.

    Regards,

    Garrett

  • As for the first question, it's all clear to me.But for the second question I have not all clear. What I not understanded.

    What is the handle hCfg. Where declared it handle? What function does use it hCfg next? Why NA and RT structures are needed? And what entry created the function CfgAddEntry(hCfg, CFGTAG_IPNET, 1, 0, sizeof(CI_IPNET), (UINT8 *)&NA, 0 );

    In the PDF document, that you have attached, the initialization process is described fairly generically and there is nothing like the functions that are used in the example.

    I also tried to understand which code responds to the request from the console like ping 192.168.3.229. The IP 192.168.3.229 it IP of my board in my net. I could not understand that. For me it is still very difficult.

  • Hi Kiselev,

    You may have to look into the source code of NDK to understand the details, specifically you may check the ndk\nettools\config\config.c and ndk\netctrl\netctrl.c for hcfg and CfgAddEntry().

    For ping, you may look into the icmp code located in ndk\stack\icmp.

    Regards,
    Garrett