0

Compile error with Feather M0 LoRa and I2S DMA
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Compile error with Feather M0 LoRa and I2S DMA

by HikerGlenn on Fri May 14, 2021 7:25 pm

I'm attempting to get the I2S DMA Demo running from the Max98357 I2S DMA Demo Page

However, when I build I get the following error:

/Users/glenne/Library/Arduino15/packages/adafruit/hardware/samd/1.6.8/libraries/Adafruit_ZeroDMA/utility/dma.h:69:37: error: 'DMAC_CHCTRLB_TRIGACT_BLOCK_Val' was not declared in this scope
69 | DMA_TRIGGER_ACTON_BLOCK = DMAC_CHCTRLB_TRIGACT_BLOCK_Val,


Adafruit Board: Adafruit Feather M0 with RFM95 LoRa Radio
Arduino Board: Adafruit Feather M0
Arduino version: 1.8.15

The demo works fine with the non-dma example.


Is there some other setting I need to assert?

HikerGlenn
 
Posts: 18
Joined: Sat May 07, 2016 7:00 pm

Re: Compile error with Feather M0 LoRa and I2S DMA

by adafruit_support_mike on Sat May 15, 2021 12:54 am

Check to see if you have the "Arduino SAMD Boards" support package installed. That contains the CMSIS files that define the software interface for the microcontrollers.

The specific file you need is

Arduino15/packages/arduino/tools/CMSIS-Atmel/[version]/CMSIS/Device/ATMEL/samd21/include/component/dmac.h

adafruit_support_mike
 
Posts: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Re: Compile error with Feather M0 LoRa and I2S DMA

by HikerGlenn on Sat May 15, 2021 11:18 am

Thanks for the suggestion - it helped me find the root cause of the error.

I updated my old version of the Arduino SAMD via the Board Manager but go the same error. However, this time I noticed that it also had a message saying it found the missing definition after it was used.

It turns out my VSCode setup sorts contiguous file includes so "" includes are first. The result was that "utility/dma.h" was included before the Adafruit dma and i2s includes.

I would suggested changing the demo example to either use angle brackets for utility/dma.h or place a blank line before it.

HikerGlenn
 
Posts: 18
Joined: Sat May 07, 2016 7:00 pm

Re: Compile error with Feather M0 LoRa and I2S DMA

by adafruit_support_mike on Sat May 15, 2021 7:59 pm

Glad to hear you found the solution.

I''ll pass the suggestion about #include syntax along, but that might break compatibility with the Arduino IDE. It also uses #include syntax to decide where to look for libraries.

adafruit_support_mike
 
Posts: 62799
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.