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.

Desktop Linux SDK questions

Hello,

I am using DSPC-8681e. I have few questions regarding Desktop Linux SDK:

1) I use the following function to find out DSP number:

#define GPIO_IN_DATA 0x02320020 // for DSP number

unsigned int get_dsp_id() {
    return (((*(unsigned int*) GPIO_IN_DATA) & 0x6) >> 1);
}

But when I execute "dsp_utils load 0 [address] [file.hex]" program runs on 4-th DSP (i.e get_dsp_id returns 3)

And vice versa "dsp_utils load 3 [address] [file.hex]" runs program on 1-st DSP (i.e get_dsp_id returns 0)

Can you explain this behavior? Also it will be great if in the future releases the order will match.

2) I use the following code to map DSP and PC memory:

    #define DSPC8681_IO_BUFFER_SIZE 0x00400000 // CMEM works only with 4 MB :-(

    cmem_host_buf_desc_t buf_desc = { 0 };
    uint32_t dsp_start_addr = 0;
    pciedrv_open_config_t pciedrv_open_config;

    puts("Open DSPC-8681 driver");

    pciedrv_open_config.dsp_outbound_reserved_mem_size = DSPC8681_IO_BUFFER_SIZE;
    pciedrv_open_config.start_dma_chan_num = 0;
    pciedrv_open_config.num_dma_channels = 0;
    pciedrv_open_config.start_param_set_num = 0;
    pciedrv_open_config.num_param_sets = 0;
    pciedrv_open_config.dsp_outbound_block_size = DSPC8681_IO_BUFFER_SIZE;

    if (pciedrv_open(&pciedrv_open_config) != 0) {
        puts("Failed");
        goto END;
    }

    puts("Open CMEM driver");

    if (cmem_drv_open() != 0) {
        puts("Failed");
        goto END;
    }

    puts("Allocate memory range for DMA on DSP");

    if (pciedrv_dsp_memrange_alloc(chip_id, DSPC8681_IO_BUFFER_SIZE, &dsp_start_addr) != 0) {
        puts("Failed");
        goto END;
    }

    printf("Memory range start address is 0x%08X\n", dsp_start_addr);

    puts("Allocate memory using CMEM");

    if (cmem_drv_alloc(1, DSPC8681_IO_BUFFER_SIZE, HOST_BUF_TYPE_DYNAMIC, &buf_desc) != 0) {
        puts("Failed");
        goto END;
    }

    puts("Map CMEM buffer to DSP range");

    if (pciedrv_map_bufs_to_dsp_memrange(chip_id, 1, &buf_desc, dsp_start_addr) != 0) {
        puts("Failed");
        goto END;
    }

When DSPC8681_IO_BUFFER_SIZE is 4 MB everything works fine.

When DSPC8681_IO_BUFFER_SIZE is 1 MB or 2 MB the code reports no error, but mapping does NOT work (i.e. when I change memory on DSP I do not see the changes in host PC memory)

When DSPC8681_IO_BUFFER_SIZE is 8 MB the code responds with error:

     Allocate memory using CMEM
     ERROR: DMA MEM Buffer allocation failed
     Failed

Can you please explain this behavior?

3) I am using Version 1.0.0.2 Alpha Release of Desktop Linux SDK. Is it latest version? When a new version will be available?

  • Please see my comments below.

    1).  This depends on how the DSPs are enumerating on the PCIE bus on your Desktop.  What is the Ubuntu version you are using?

    2)  The 4MB limitation is due to the limitation of dma memory allocation limited to 4 MB in linux. We have some updated drivers to overcome this in next release.

    3) We are planning for an updated release end of this month.

  • FYI

    The new release of desktop linux sdk: 1.0.0.4 http://software-dl.ti.com/sdoemb/sdoemb_public_sw/desktop_linux_sdk/01_00_00_04/index_FDS.html

    addresses the 4 MB limitation.

    Note, to use the 8 MB the "Using larger and pre-reserved contiguous memory allocation" ( See Getting started guide) should be used using the install_grub.sh