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.

Simple HEVC example on EVMK2HX?

Hi,

I tried to get the H265venc_ti_c66x project running in CCS 6.1 on my EVMK2HX board. In order to get it linked, I replaced ERAM in h265venc.cfg with DDR3, after that the MSMCSRAM was still overflowing because it was all used up by the .SL2_mem. What makes me wonder is why the MSMCSRAM has a size of 0x200000 in the linker, when the actual hardware has 6144k? Anyway, I then moves SL2_mem to DDR3 as well. Unfortunately that appears to be a bad idea because the program crashes at the VidMc_Init function during initialisation.

So I am wondering, I can't possibly be the first to get this codec running on the AK2H right? Could anyone help me with their project to get started?

Or should I switch to CCS5.5 with the MCSDK_Video?

  • Karsten,

    Apologize for the delay. I am working with expert to answer this post.
  • Hi Karsten, DSP HEVC encoder has been develop/test on C6678 platform. I got some high level steps on how to migrate codecs from Shannon (C6678) to Hawking (K2H). Please see attached doc. I hope this helps.

    StepsMigrateCodec_Shannon2Hawking.txt
    *********************
    For migration from Shannon to Hawking
    -------------------------------------
    1. Update version of tools:
    
    CodeGen DSP compiler 7.4.2
    framework_components_3_24_01_12
    XDAIS 07.23.00.06
    XDCTools DSP RTSC packaging and build tools 3.25.2.70
    EDMA3 LLD Enhanced Direct Memory LLD 2.11.9.8
    SYS/BIOS DSP real-time operating system 6.35.04.50
    IPC DSP inter-process communication 3.0.2.26
    
    -------------------------------------
    2. Update XDCTools version in RTSC tab, select "ti.platforms.evmTCI6636K2H",
    and remove custom platform package for Shannon from "Other Repositories"
    
    -------------------------------------
    3. Copy alg.h and _alg.h (if needed) from FC to codec unit test inc folder, and update include path in source files
    
    -------------------------------------
    4. Update EDMA config to use region config for Hawking
    
    -------------------------------------
    5. Update .cfg to include the following as FC is not built with the matching EDMA3LLD
    environment['xdc.cfg.check.fatal'] = 'false';
    
    -------------------------------------
    6. Update .cfg and/or linker.cmd to use memory sections defined in XDC for K2H platform
    
    -------------------------------------
    7. Check MAR registers for cache settings. Modify if needed.
    
    
    *********************
    For testing on Hawking EVM
    
    Do CPU reset for the cores before loading and running the codec unit test.
    
    
    

    thank you,

    Paula

  • Hey Paula,

    Thanks for your reply. I already did most of these, and I am still stuck with a very odd crash. Whenever the program tries to execute these assignments in h265venc_ti_VidMc.c:

        printf("L2Heap: %016X L2_heap_mem: %016X L2_HEAP_SIZE: %5d\n", &L2Heap, &L2_heap_mem, L2_HEAP_SIZE);
        /* Initialize heaps */
        L2Heap.ptr                = L2_heap_mem;
        printf("Assigned PTR\n");

    It doesn't reach the "Assigned PTR" printf. The output of the line before is:

    L2Heap: 000000009360172C L2_heap_mem: 0000000000847088 L2_HEAP_SIZE:  2048

    Which suggests that according to the memory map, the L2Heap is in DDR3B_DATA, which in my opinion should be the on board DDR and L2_heap_mem is in the local SRAM. Any ideas on why this would crash the SoC so badly that even JTAG can't connect afterwards? 

    Modifications to .cfg

    Program.sectMap[".SL2_mem"] = "DDR3";
    Program.sectMap[".uncached_DDR"] = "DDR3";
    Program.sectMap[".text"] = "MSMCSRAM";
    Program.sectMap[".stack"] = "L2SRAM";
    Program.sectMap[".external_cached_mem"] = "DDR3";
    Program.sectMap[".intDataMem"] = "L2SRAM";
    Program.sectMap[".const"] = "MSMCSRAM";
    Program.sectMap[".fardata"] = "L2SRAM";
    Program.sectMap[".neardata"] = "L2SRAM";
    Program.sectMap[".rodata"] = "L2SRAM";
    Program.sectMap[".far"] = "L2SRAM";
    Program.sectMap[".args"] = "L2SRAM";
    Program.sectMap[".bss"] = "L2SRAM";
    Program.sectMap[".bios"] = "L2SRAM";
    Program.sectMap[".switch"] = "MSMCSRAM";
    Program.sectMap[".cio"] = "L2SRAM";
    Program.sectMap[".cinit"] = "MSMCSRAM";
    Program.sectMap[".constTables"] = "MSMCSRAM";

    Memory map:

    L2SRAM 00800000 00100000 0006a060 00095fa0 RW X
    MSMCSRAM 0c000000 00600000 0013c498 004c3b68 RW X
    DDR3 80000000 80000000 13801e46 6c7fe1ba RWIX

  • Hi Karsten, it seems you have a single DDR3 area for both cached and non-cached sections. Please follow the memory allocation either in codec unit test or sv04 (MCSDK video application), for all the memory sections. For HEVC, we need to be very careful about the memory allocation, e.g., cached vs. no-cached, DDR vs Local L2.
    Program.sectMap[".uncached_DDR"] = "DDR3";
    Program.sectMap[".external_cached_mem"] = "DDR3";Thank you,Paula
  • Hey Paula,

    Thanks, I checked that. Apparently TestApp_EnableCache does indeed assume that the uncached DDR will be at 0x98000000 as per define. So I changed the mentioned section to:

    var uncached_DDR = new Program.SectionSpec;
    uncached_DDR.runAddress = 0x98000000;
    Program.sectMap[".SL2_mem"] = "MSMCSRAM";
    Program.sectMap[".uncached_DDR"] = uncached_DDR;
    Program.sectMap[".text"] = "MSMCSRAM";
    Program.sectMap[".stack"] = "L2SRAM";
    Program.sectMap[".external_cached_mem"] = "DDR3";
    Program.sectMap[".intDataMem"] = "L2SRAM";
    Program.sectMap[".const"] = "MSMCSRAM";
    Program.sectMap[".fardata"] = "L2SRAM";
    Program.sectMap[".neardata"] = "L2SRAM";
    Program.sectMap[".rodata"] = "L2SRAM";
    Program.sectMap[".far"] = "L2SRAM";
    Program.sectMap[".args"] = "L2SRAM";
    Program.sectMap[".bss"] = "L2SRAM";
    Program.sectMap[".bios"] = "L2SRAM";
    Program.sectMap[".switch"] = "MSMCSRAM";
    Program.sectMap[".cio"] = "L2SRAM";
    Program.sectMap[".cinit"] = "MSMCSRAM";
    Program.sectMap[".constTables"] = "MSMCSRAM";

    This did help a little as VidMc_Init is now passing, but whenever the uncached DDR is accessed, as for example in:

    void *VidMc_alloc(XDAS_Int32 size, XDAS_Int32 alignment, Heap_t *heap)
    {
    printf("VidMc_alloc: entry %08X\n", heap);
    XDAS_UInt32 address = (XDAS_UInt32)heap->ptr;

    It still crashes the whole system. Any more ideas?