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: VISION SDK-display dss aplication - How to display tigf video using the buffer array instead of loading the files from sd-card or local host machine path

Tool/software: TI-RTOS

Hi all,

We would like to display the video using the buffer array, instead of the scripting console in the display dss application.

We need to integrate the video image in the  output .xem4 binary file.

Is it possible to do this ?

Is there any tool for converting tigf file to store  in an array  ?

Thanks & regards

Gokul

  • I've moved your thread to the device forum.

    Todd
  • Hi Gokul,

    can you clarify which dss application you use?

    Under linux you can try 'xxd' utility (it is part of vim installation) that can convert binary files to C headers:
    stackoverflow.com/.../script-tool-to-convert-file-to-c-c-source-code-array

    Regards,
    Yordan
  • There is a bin2h utility in doc/tda3xx folder. You could even use it to convert any binary file to header file. 

    It will create a header file with the macro set to values. You could just assign this macro to an array and can have all the values.

    Regards,

    Brijesh

  • Thanks Brijesh and Yordan.

    @ Yordan,
    We are using ti_components\drivers\bsp_01_07_01_17\examples\vps\display\displayDss application.

    @Brijesh,
    I tried with the command
    bin2c.exe data.yuv
    It shows the message as below

    USAGE: bin2c <binary file name>


    Then i tried with below command and it is working.
    bin2c.exe data.yuv data.h data
  • Glad to hear it is working.

    Please close the thread if it answers your question.

    Regards,
    Brijesh
  • Hi Brijesh,

    After creating the header file we have  included the header file in .c file as 

    #include "testdata.h"

    Also declared array

    UInt8 displaydata[BSP_TESTDATA_DCC_CFG_NUM_ELEM] = BSP_DRV_TESTDATADCC_CFG;

    We have  compilation issue as below. But I tried with  test code using gcc compiler & it is build properly.

    How to fix this error ?

     

    # Making tda2xx-evm:m4vpss:release:bsp_vps...

    # Making tda2xx-evm:m4vpss:release:bsp_examples_utility...

    # Making tda2xx-evm:m4vpss:release:bsp_uart...

    # Compiling tda2xx-evm:m4vpss:release:bsp_examples_displayDss: src/DisplayDss_main.c

    INTERNAL ERROR: D:\ti\vsdkv212\ti_components\cg_tools\windows\ti-cgt-arm_5.2.5\bin\armacpia.exe experienced a segmentation fa

    ult

                     while processing function (unknown or file scope) file src\testdata.h line 192027

    This is caused by a defect in the compiler itself. TI Customer

    Support may be able to suggest a workaround to avoid this.

    Upgrading to the newest version of the compiler may fix this problem.

    Contact TI in the E2E support forums at under

    "Development Tools", "TI C/C++ Compiler". See the link titled

    "Submitting an issue". Include this ENTIRE error message and a

    copy of the .pp file created when option --preproc_with_comment

    (-ppc) is used.

    >> Compilation failure

    gmake[3]: *** [D:/ti/vsdkv212/ti_components/drivers/bsp_01_07_01_17/binary/bsp_examples_displayDss/obj/tda2xx-evm/m4vpss/rele

    ase/DisplayDss_main.oem4] Error 1

    gmake[2]: *** [m4vpss] Error 2

    gmake[1]: *** [displayDss_target] Error 2

    gmake: *** [displayDss] Error 2

    D:\ti\vsdkv212\ti_components\drivers\bsp_01_07_01_17>

    D:\ti\vsdkv212\ti_components\drivers\bsp_01_07_01_17>

    D:\ti\vsdkv212\ti_components\drivers\bsp_01_07_01_17>

    Thanks

    Gokul

  • Hi  all,

    We are able to manage the compilation problem using the bin2c tool from https://github.com/gwilymk/bin2c.

    But  there is linking issue . 

    es_displayDss_configuro/linker_mod.cmd", line 167: error:

      program will not fit into available memory.  placement with alignment fails.

    We have arrary of 3072001 bytes. We are pointing the buffer address (bufInfo->bufAddr ) to this array.

     

    Is it need to modify the linker script  file ? 

    # Compiling tda2xx-evm:m4vpss:release:bsp_examples_displayDss: src/DisplayDss_main.c

    "src/DisplayDss_main.c", line 1883: warning: function "DispApp_updateRtParam" was declared but never referenced

    # Linking into D:/ti/vsdkv212/ti_components/drivers/bsp_01_07_01_17/binary/bsp_examples_displayDss/bin/tda2xx-evm/bsp_example

    s_displayDss_m4vpss_release.xem4...

    #

    "D:/ti/vsdkv212/ti_components/drivers/bsp_01_07_01_17/binary/bsp_examples_displayDss/obj/tda2xx-evm/m4vpss/release/bsp_exampl

    es_displayDss_configuro/linker_mod.cmd", line 167: error:

      program will not fit into available memory.  placement with alignment fails

      for section ".cinit" size 0x2f43f6 .  Available memory ranges:

      VPSS_M4_CODE_MEM   size: 0x1ff000     unused: 0x1977fe     max hole:

      0x1977e8

    error: errors encountered during linking;

      "D:/ti/vsdkv212/ti_components/drivers/bsp_01_07_01_17/binary/bsp_examples_di

      splayDss/bin/tda2xx-evm/bsp_examples_displayDss_m4vpss_release.xem4" not

      built

    gmake[3]: *** [D:/ti/vsdkv212/ti_components/drivers/bsp_01_07_01_17/binary/bsp_examples_displayDss/bin/tda2xx-evm/bsp_example

    s_displayDss_m4vpss_release.xem4] Error 1

    gmake[2]: *** [m4vpss] Error 2

    gmake[1]: *** [displayDss_target] Error 2

    gmake: *** [displayDss] Error 2

    Thanks & regards

    Gokul

  • Hi Gokul,

    M4 Data size is just 3MB, please increase it in bld file stored in bsp_01_07_00_16\examples\config_tda3xx.bld.

    Regards,

    Briijesh

  • Hi Briijesh

    We are working in (tda2xx) dra7xx platform.

    Can i increase the VPSS_M4_DATA_SIZE to 14 MB in config_tda2xx.bld ?

    Thanks & regards
    Gokul
  • Hi Gokul,


    But the error shows that you have just 2MB, (0x1ff000).
    VPSS_M4_CODE_MEM size: 0x1ff000 unused: 0x1977fe max hole:

    So please try increasing the code section.

    Regards,
    Brijesh
  • Hi Brijesh,

    We increased the code section size to 4 MB and it works for an array-buffer size of 3072001 bytes.(nearly 2 to 3 MB)

    But if we try to compile for an array-buffer size of 23040001 (21 MB), we get the below error.

    We have changed the code-section size to 20 MB in this case.

    Is it possible to build with this size ?

    # Making tda2xx-evm:m4vpss:release:bsp_examples_utility...

    # Making tda2xx-evm:m4vpss:release:bsp_uart...

    # Compiling tda2xx-evm:m4vpss:release:bsp_examples_displayDss: src/DisplayDss_main.c

    "src\test.h", line 1452507: fatal error: out of memory

    1 catastrophic error detected in the compilation of "src/DisplayDss_main.c".

    Compilation terminated.

    >> Compilation failure

    gmake[3]: *** [D:/ti/vsdkv212/ti_components/drivers/bsp_01_07_01_17/binary/bsp_examples_displayDss/obj/tda2xx-evm/m4vpss/rele

    ase/DisplayDss_main.oem4] Error 1

    gmake[2]: *** [m4vpss] Error 2

    gmake[1]: *** [displayDss_target] Error 2

    gmake: *** [displayDss] Error 2

    Thanks  & regards

    Gokul

  • Hi Gokul,

    It is bit higher memory size, If you still want to keep image as an array in the application, you could just increase the code section and it will still work.

    Ideally, This buffer should be allocated from the frame buffer section and should be loaded. 

    The other solution is to allocate this buffer from the frame buffer section using pragma in c code. In this case, you dont really have to increase code section to have big images.

    Rgds,

    Brijesh

  • Hi Brijesh,

    We  tried to increase the code section to 45 MB. But it is not working.

    So We  are trying to use the frame buffer section.

    .I tried with the following lines. Still i am getting the same error.

    extern UInt8 color[];

    #if defined(__GNUC__) && !defined(__ti__)

    DATA_ALIGN(32) DATA_SECTION(".bss:frameBuffer")

    #else

    #pragma DATA_ALIGN(color, 32)

    #pragma DATA_SECTION(color,".bss:frameBuffer");

    #endif /* #if defined(__GNUC__) && !defined(__ti__) */

    How to use frame buffer section using pragma ?

    The array (color) is already  initilaized  in a header file. 

    Thanks & regards,

    Gokul

  • Hi Gokul,

    Sorry for the late reply.

    In which file you have added this code? 

    Can you just add below two lines in your c file just before declaring color array?

    #pragma DATA_ALIGN(color, 32)

    #pragma DATA_SECTION(color,".bss:frameBuffer");

    You could also check the map file to see where frame Buffer and color array is allocated from?

    Regards,

    Brijesh 

  • Hi Brijesh,

    We have a header file created using bin2c tool . This  header file contains the array data-color which is initialized.  

    We have added the following lines . Is this correct ?

    #pragma DATA_ALIGN(color, 32)

    #pragma DATA_SECTION(color,".bss:frameBuffer");


    UInt8 color[23040001] = {
    0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10,
    0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80,
    0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10,
    0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80,
    0x10, 0x80, 0x10,......}

    With the above changes, still I am getting the error 

    # Making tda2xx-evm:m4vpss:release:bsp_vps...
    # Making tda2xx-evm:m4vpss:release:bsp_examples_utility...
    # Making tda2xx-evm:m4vpss:release:bsp_uart...
    # Compiling tda2xx-evm:m4vpss:release:bsp_examples_displayDss: src/DisplayDss_main.c
    "src\testdata.h", line 1452763: fatal error: out of memory
    1 catastrophic error detected in the compilation of "src/DisplayDss_main.c".
    Compilation terminated.

    >> Compilation failure
    gmake[3]: *** [D:/ti/vsdkv212/ti_components/drivers/bsp_01_07_01_17/binary/bsp_examples_displayDss/obj/tda2xx-evm/m4vpss/rele
    ase/DisplayDss_main.oem4] Error 1
    gmake[2]: *** [m4vpss] Error 2
    gmake[1]: *** [displayDss_target] Error 2
    gmake: *** [displayDss] Error 2

    Thanks

    Gokul

  • Hi Gokul,

    For TDA2xx, the frame buffer size is really big, we have around 244MB reserved for the frame buffer. it should not go out of memory.
    Can you please share your map file? and other changes?

    Regards,
    Brijesh
  • Hi Gokul,

    In addition to putting buffer in the frame_buffer section, you will need to decrease the heap, which is used to allocate frame buffer. By default, the size of this heap is 242MB and this is exactly same as the reserved space of frame buffer section. Please reduce size of the heap by reducing value of the macro BSPUTILS_MEM_FRAME_HEAP_SIZE in vayu_drivers\bspdrivers_\examples\utility\src\bsputils_mem_default.c file. 

    You will see that this macro is set to 242MB for TDA2xx, reduce this size, lets 100MB and then try it out. 

    it should build now.

    Rgds,

    Brijesh

  • Hi Brijesh,

    I tried by reducing heap size. But still get the error.
    # Making tda2xx-evm:m4vpss:release:bsp_uart...
    # Compiling tda2xx-evm:m4vpss:release:bsp_examples_displayDss: src/DisplayDss_main.c
    "src\test.h", line 1452627: fatal error: out of memory
    1 catastrophic error detected in the compilation of "src/DisplayDss_main.c".
    Compilation terminated.

    >> Compilation failure
    gmake[3]: *** [D:/ti/vsdkv212/ti_components/drivers/bsp_01_07_01_17/binary/bsp_examples_displayDss/obj/tda2xx-evm/m4vpss/rele
    ase/DisplayDss_main.oem4] Error 1
    gmake[2]: *** [m4vpss] Error 2
    gmake[1]: *** [displayDss_target] Error 2
    gmake: *** [displayDss] Error 2



    Changed done:

    1. #define BSPUTILS_MEM_FRAME_HEAP_SIZE (100U * MB) ( src/bsputils_mem_default.c)

    2. header files
    #pragma DATA_ALIGN(color, 32)

    #pragma DATA_SECTION(color,".bss:frameBuffer");


    UInt8 color[23040001] = {
    0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10,
    0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80,
    0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10,
    0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80,
    0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10,
    0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80,
    0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10,
    0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80,
    0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10,
    0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80,
    0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10, 0x80, 0x10,
    0x80, 0x10, 0x80, 0x10, 0x80, 0x10,......
    }


    Do we need to place in some other section instead of bss , since the array is initialised ?

    Thanks
    Gokul
  • Hi Gokul,


    It seems that it is just too big file. I need to figure out why it says out of memory.
    But why do you want to static image in the code? Can you load image to memory using ccs memory window or scripting console?

    Regards,
    Brijesh