PIC32 DMA problem

Cross-platform IDE for the rapid development of applications for the embedded world, available on Windows, Linux, and macOS.
Post Reply
Author
Message
takeshikawami@gmail.com
Posts: 4
Joined: 03 Dec 2023 05:43

PIC32 DMA problem

#1 Post by takeshikawami@gmail.com » 11 Jan 2024 22:10

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,

User avatar
IvanJeremic
mikroElektronika team
Posts: 316
Joined: 05 Sep 2022 14:32

Re: PIC32 DMA problem

#2 Post by IvanJeremic » 15 Jan 2024 12:26

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.

Post Reply

Return to “IDE”