Dspic33fj ADC mit DMA

OP #2704393
Lesenswert?

Hallo,

ich hab Probleme bei der Konfigurierung des DMA in Verbindung  meines 
dsPIC33FJ. Wenn ich mein Code kompilieren will kommt immer dieser 
Fehler.


config.c:178: warning: ignoring space attribute applied to automatic 
BufferB
config.c:180: warning: ignoring space attribute applied to automatic 
BufferA
config.c:183: error: Argument to __builtin_dmaoffset()  is not the 
address
   of an object in a dma section;
   the object must not be qualified with any form of index
config.c:184: error: Argument to __builtin_dmaoffset()  is not the 
address
   of an object in a dma section;
   the object must not be qualified with any form of index


die passende Code Zeilen

  struct
  {
  unsigned int Adc1Ch0;
  unsigned int Adc1Ch1;
  } BufferB  __attribute__((space(dma)));

  unsigned int BufferA[2] __attribute__((space(dma)));


DMA0STA  = __builtin_dmaoffset(BufferA);
DMA0STB = __builtin_dmaoffset(BufferB);




weiß nicht wo der Fehler ist. Hoff es kann mir jemand helfen

danke ;)
#2704489
Lesenswert?

Ich habe den DMA z.B. im CAN Modul so gelöst, wie es auch Microchip in 
seiner Appnote vormacht. Vielleicht hilft es dir irgendwie weiter...
1
ecan1Drv.h
2
...
3
/* CAN Message Buffer Configuration */
4
#define NUM_OF_CAN_DMA_BUFFERS 8
5

6
typedef int ECANMSGBUF [NUM_OF_CAN_DMA_BUFFERS][8];
7
extern ECANMSGBUF ecanMsgBuffer __attribute__((space(dma)));
8
...
9

10
ecan1Drv.c
11
...
12
// Define ECAN DMA Message Buffers
13
ECANMSGBUF ecanMsgBuffer __attribute__((space(dma)));
14

15
...
16
DMA0STA = __builtin_dmaoffset(ecanMsgBuffer);
17
...

Gruß, Steffen

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren