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?