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.

Combining NDK with OpenMP

Other Parts Discussed in Thread: SYSBIOS

Hello Everyone,


I am currently working on adding OpenMP to the NDK helloworld example on the C6678. I have read through most of the discussion on the forum and can build the project without errors. I used the MCSDK image processing using openmp example as the base project and modified it  to start a UDP server like in the helloworld example. However, when run, I get the following errors:

Error allocating memory for Rx data buffer
Error allocating Rx free descriptors
Rx setup failed
Error: Unable to register the EMAC
ti.sysbios.heaps.HeapMem: line 307: out of memory: handle=0x835070, size=1536
ti.sysbios.heaps.HeapMem: line 307: out of memory: handle=0x835070, size=2048

I guess it is linked to the Program.sectMap as it seems to be the only significant difference between the two .cfg files of the mentioned projects. I have no idea how to fix the allocation memory for the RX data buffer and hope someone can give me a pointer or two. Your help is much appreciated.


Regards,

Chan

  • Chan,

    You could see the image processing demo with openMP.
    Yes, this demo have TCP/IP routine to access the webpage and test this demo.
    You are trying to add the UDP send and recv in this demo project. Is my understanding correct?
    If yes, please have a look at the Hellow World NDK example project.
    Refer the udpHello.c file for recv and send the data using UDP Echo Server Daemon Function.
    Will you try this code on image processing with openMP demo?
    I do not know much about openMP, but you can create a task for UDP like udpHello.c
    If possible share your piece of code for UDP, which is added with image processing with openMP demo by you.
    In addition that, refer this wiki page for how to test the demo on EVM.
    http://processors.wiki.ti.com/index.php/MCSDK_Image_Processing_Demonstration_Guide#OpenMP-Based

  • Hi Pubesh,

    I am combining the image processing OpenMP demo with the UDP echo server example. The problem is not with the udpHello.c file, but with the helloworld file. I haven't been able to initialise all the necessary NDK configuration. I have attached the .cfg file as well as the helloworld file.


    The error it gives me is as follows when I debug it now :

    [C66xx_0] Error: Inserting memory region 0, Error code : -131
    Failed to initialize the QMSS subsystem

    Is there any guide on how to integrate OpenMP to existing projects? It seems quite complicated.

    Regards,

    Chan

    ndk_omp.zip
  • I found out by including OpenMP, the function ti.sysbios.BIOS.start is added to the startup last function automatically. This caused the DSP to crash when Bios_start() is called. Does this mean I have to setup the NDK in a different way by setting up the NDK stuff and call udp_hello function during runtime instead of depending on the callback?

    Trying to run the NDK setup functions before ti.sysbios.BIOS.start gives me the error as follows:

    Error allocating memory for Rx data buffer
    Error allocating Rx free descriptors
    Rx setup failed
    Error: Unable to register the EMAC
    ti.sysbios.heaps.HeapMem: line 307: out of memory: handle=0x835070, size=1536
    ti.sysbios.heaps.HeapMem: line 307: out of memory: handle=0x835070, size=2048

    Sorry for the inconvenience as the OpenMP documentation provide enough information on how to replace Bios_start(). Cheers

    Regards,

    Chan

  • Chan,

    Please confirm that which project are you using?
    mcsdk_2_01_02_06\demos\image_processing\openmp\evmc6678l

    I do not know, why you added the below sequence on your file
    //Scott's additions
    #include <ti/ipc/Ipc.h>
    #include <ti/ipc/Notify.h>
    #include <ti/sysbios/knl/Semaphore.h>
    #include <xdc/cfg/global.h>
    #include <ti/ipc/SharedRegion.h>

    I think, mcip_master_main.c have the network open, etc. You can just add udphello.c on this project.
    Create task for this in the openMP_Image project

  • Yes, I am using the mcsdk_2_01_02_06\demos\image_processing\openmp\evmc6678l example. Ignore those lines as they were leftover from previous projects and I have omitted them. Although the network is open but its using HTTP, rather than UDP as used in the NDK helloworld example. Will find out how to fit UDP in it. Cheers.

  • It turns out that the CGtools was not compatible and ver 7.4.0 should be used instead. Its now not giving me random exception and it occasionally works as I start the task in the main function and then stop it at the while loop. Is there a way to tell the DSP to enter an idle loop from the main function so that the network server can be triggered? At the moment it connects occasionally with the while loop.