Page 1 of 1

PIC32 DMA problem

Posted: 11 Jan 2024 22:10
by takeshikawami@gmail.com
Hello,

I'm now working with mini-32 for pic32, and I'm trying to use DMA to transfer the ADC data. I saw the Microchip mannual and they provide some example code to do so. And to use DMA I should declear the buffer as coherent.And the example code declear the buffer as following:

// *************************************************************************************************
// G L O B A L V A R I A B L E S
// *************************************************************************************************
uint32_t __attribute__((coherent)) adc_bufA[INTERLEAVED_ADC_COUNT * ADC_DMA_BUFF_SIZE];
uint32_t __attribute__((coherent)) adc_bufB[INTERLEAVED_ADC_COUNT * ADC_DMA_BUFF_SIZE];
uint32_t adc_buf_index = 0;
bool adc_dma_buf_full_flg = 0;

But it seems that the mikroC PRO does not recognize '__attribute__((coherent))' (specifically, it doesn't recognized ((coherent))). Could you give me some advice on how to modify this? Basically I'm trying to allocate memory in uncached regions, i.e. KSEG1.

Best,

Re: PIC32 DMA problem

Posted: 15 Jan 2024 12:26
by IvanJeremic
Hi,

We spoke about this in a helpdesk ticket, but for everyone who might have a similar problem, here is the answer:

"Attribute" is a GCC oriented feature and GCC is not supported in MikroC unfortunately.

Regards,

Ivan.