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.

Linux/TDA2: pass buffer_site for A15 to c66

Part Number: TDA2

Tool/software: Linux

now   i   am  VISION_03_04_00_00         

  char * model_fr = (char*)OSA_memAllocSR(OSA_HEAPID_DDR_CACHED_SR1, length_fr, 32);

i   read model  file  to model_fr  buffer  in  a15  , it  will  use  by   C66 ,  so  have   can  i   send   the  model_frto  C66 dsp ?

how  can  i    pass the physical pointer of this buffer to DSP as an Alg link (on DSP) create time parameter?

i  am   run   SDK_VISION_03_04_00_00\vision_sdk\sample_app\src\hlos\usecases\nullSrc_display     , could  you  please  illustrate how to add code   take this usecase as an example .

Shuai

  • Hi,

    You can send any structure to any link from A15 from your usecase using System_linkControl api with a command to a link provided that link supports that command.
    You can also provide your model_fr to a link in its create param, provided that links create param has that member to take model.

    Regards,
    Anuj
  • Hi Anuj
    in sample_app\src\hlos\usecases\nullSrc_display\Chains_nullSrc_display this file
    get mem and read model then
    char * model_fr = (char*)OSA_memAllocSR(OSA_HEAPID_DDR_CACHED_SR1, length_fr, 32);
    gUcObj.Alg_FrameCopyPrm.mybuf = (void*)model_fr;
    i print model_fr bufsite and model data here is right.


    in sample_app\src\rtos\alg_plugins\framecopy\frameCopyAlgoLocalDma.c Alg_FrameCopyCreate
    i get the bufsite is the same, but model_data is 0 is wrong.
    float *model_fr = (float *)pCreateParams->mybuf;
    Vps_printf("rtos_model_frsite=%x,model_fr_0=%f,model_fr_1=%f \n", model_fr,model_fr[0], model_fr[1]);

    i donot know why ?
  • Hi,

    Its because you are allocating the buffer from A15 which runs linux and has a virtual memory but DSP uses physical memory.

    So you need to get the physical address of that buffer and pass that DSP.

    You can use something like below

    buffer.payload = (void *) OSA_memVirt2Phys((UInt32)buffer.payload, OSA_MEM_REGION_TYPE_SR1);

    Regards,

    Anuj

  • HI: Anuj


    char * model_fr = (char*)OSA_memAllocSR(OSA_HEAPID_DDR_CACHED_SR1, length_fr, 32);
    fread(model_fr, sizeof(char), length_fr, fp_fr);
    gUcObj.Alg_FrameCopyPrm.mybuf = (void*)OSA_memVirt2Phys((UInt32)model_fr ,OSA_HEAPID_DDR_CACHED_SR1);

    you mean like this ?
    Regards,
    SHUAI
  • HI: Anuj
    its right now!
    thanks
    SHUAI