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.

Main to task and back to main

Other Parts Discussed in Thread: SYSBIOS

Hi everyone,

I'm not good with SYS/BIOS as well as DSP/BIOS. I have a basic question. I have C6678L board and as everybody know, this board can be use with OpenMP compiler by TI. The Hello World example, from the main() do not call the BIOS_start(). It start and end in the main function. I need to use this OpenMP capability

At the same time, I need to transfer a very large file from my PC through tftp, and from help through these forum, I've managed to do the transfer. It is done by task. It started by BIOS_start() in the main() function and then pass to another function to do the transfer.

My question is, is it possible, after performing the file transfer, I can get back to the main() function to use the OpenMP capability in the main()? If possible, can someone please show me how and what to do from the XGCONF of my configuration (.cfg file).

If it is also possible to use OpenMP in a task, can someone prove this to me?

Thanks guys,

Rizuan

  • Hi Rizuan,

    RIZUAN said:

    My question is, is it possible, after performing the file transfer, I can get back to the main() function to use the OpenMP capability in the main()? If possible, can someone please show me how and what to do from the XGCONF of my configuration (.cfg file).

    It is not possible to return to the main() function after calling BIOS_start().

    RIZUAN said:

    If it is also possible to use OpenMP in a task, can someone prove this to me?

    I dont know much about OpenMP and will need to talk to someone who knows more about it. I will get back to you on this.

    Best,

    Ashish

  • Ashish,

    Ashish Kapania said:
    I dont know much about OpenMP and will need to talk to someone who knows more about it. I will get back to you on this.

    Appreciate it. Thanks. Look forward to it.

    Rizuan

  • Rizuan,

    Someone from the OpenMP team will soon help you with this.

    Best,

    Ashish

  • Rizuan,

    I am not sure if I understand your requirement completely. The OpenMP run time library for c6678 calls BIOS_start() as last function of XDC runtime startup during boot. The main() function is run as task from ti_omp_utils_OpenMP_masterTask__I task. So if you want to run the file transfer task before main(), it needs to be statically created with priority higher than 1.

    Example:

     var params = new Task.Params;
      params.instance.name = "tsk0";
      params.arg0 = 1;
      params.arg1 = 2;
      params.priority = 2;
      Task.create('&tsk0_func', params);

    Let me know if you need more information.

    Yogesh

     

     

  • Hi Yogesh,

    Sorry for the late reply and thanks.

    Yogesh Siraswar said:
    The OpenMP run time library for c6678 calls BIOS_start() as last function of XDC runtime startup during boot

    Did you mean this, as I captured from my HelloWorld OpenMP example?

    Yogesh Siraswar said:
    The main() function is run as task from ti_omp_utils_OpenMP_masterTask__I task

    I couldn't find ti_omp_utils_OpenMP_masterTask__I from the project. Can you please point the task?

    Yogesh Siraswar said:
    So if you want to run the file transfer task before main(), it needs to be statically created with priority higher than 1

    What if I create a task statically with priority higher than 1 (let said 2), and inside the task I create a task during run-time (TaskCreate) with task priority 3? The reason why I need to do this because the static task is needed to initialize all the ethernet related components and the run-time task is executed right after all the configuration has booted.

    Correct me if I'm wrong. I'm still in the beginning.

    Thanks and kind regards,

    Rizuan

  • Rizuan,

    I am not sure if we can see this task entry from the project. The task is statically created by OpenMP. To see the task you may have to refer the generated "C" file for this project under  <Projec_loc>/Debug/configPkg/package/cfg/omp_config_pe66.c (assuming your configuration file is omp_config.cfg). You should see the entry ti_omp_utils_OpenMP_masterTask__I  in the ti_sysbios_knl_Task_Object__table__V. Let me know if you need more information on this.

    Regarding the other query, the order looks fine to me, however I didn't get a chance to verify the same. Give it a try and we can start over from there if you see any issue.

    Thanks

    Yogesh

  • Hi Yogesh,

    I've followed your suggestion, i.e. adding a static task to the Hello World OpenMP project. This is the project.

    4857.Parallelclient.zip

    I use the example because it calls BIOS_start() as last function of XDC runtime startup as you mentioned before. The task is from other project that is based on the client_evmc6678l (located in mcsdk_2_01_00_03\examples\ndk\client folder. The task initialize NDK (e.g. http, telnet, dhcpc etc.) and when an IP address is issued, I create a dynamic task called RecvTFTP to receive my data through tftp from host. When the data transfer finished, that is when I want to use the OpenMP for my processing.

    I combined .cfg from both of the project (Hello WOrld OpenMP and the client_evmc6678l projects), and received a lot of warnings when compile. Can you please help me?

    Kind regards,

    Rizuan

  • Rizuan,

    I have started working on the project. I will let you know once I have it working.

    Also for your application project, the Image processing openmp demo configuration file ( mcsdk_2_01_00_03\demos\image_processing\openmp\evmc6678l. ) is a better starting point than hello world.

     

    Thanks

    Yogesh

  • Hi Yogesh,

    Really appreciate your help.

    You were right, Image Processing OpenMP Demo configuration file is the better starting point. Now, I don't have the warning and error. The .cfg file have been modified especially at the memory configuration (project is attached).

    However, for the QMSS, CPPI etc initialization, I still use the resourcemgr.c from the client_evmc6678l example. I did try to use the Image Processing OpenMP Demo's resourcemgr.c, but it cause exception error.

    Now, about the attached project, it gave me error:

    Error: Inserting memory region 0, Error code -131, Failed to initialized the QMSS subsystem.

    However, when I debug the code and put breakpoint at the point where the QMSS need to be initialized, there wasn't error and my data transfer could execute. Can you help me regarding this?

    Also, right after the data transfer finish executing, it didn't go to the main function where I'm supposed to put the code for OpenMP implementation.

    This program also currently only for core0. Later, how can I assign only core0 to perform the data transfer? and when entering the main function all cores will be use for the processing?

    Thanks very much and sorry for the delay cause I'm working on this project for the last 3 days.

    Rizuan

    1300.ParallelClient.zip

  • Hi Yogesh,

    I'm going to use the Image Processing OpenMP Demo project for my project. The only thing that I need is call to my dynamically created task for TFTP file transfering. I believe this is possible.

    I'm going to need large memory in DDR3 area so I might need to change the platform detail.

    Will let you know any progress.

    Rizuan

  • Hi, all!

    I have the same problem.
    Maybe someone knows how to fix it?

    Regards,
    Nik
  • Hi Nikolay,

    This is an old thread. Can you please create a new thread and explain your problem along with the versions of TI-RTOS, tools and other products that you are using.

    Thanks,

    Vikram

  • Vikram,

    Thank you for reply.
    I created new thread and I hope that someone will be able to answer.
    Link to the new thread:
    http://e2e.ti.com/support/embedded/tirtos/f/355/t/391170

    Regards,
    Nik