adafruit / Adafruit_ZeroDMA

DMA helper/wrapped for ATSAMD21 such as Arduino Zero & Feather M0
MIT License
58 stars 23 forks source link

Weak handler alias not working with archived libraries #14

Closed Timvrakas closed 4 years ago

Timvrakas commented 4 years ago

I'm building with PlatformIO, so that could be the source of my issues. This is targeting SAMD51, using Feather M4 Express Under the normal build configuration, the framework is archived: Archiving .pio\build\adafruit_feather_m4\libFrameworkArduino.a The first handler is linked in properly, but the others are not. The read channel (0) works, but the write channel fails, ends up hanging at Dummy_Handler. image

Which means these directives are not being enacted in Adafruit_ZeroDMA.cpp

void DMAC_1_Handler(void) __attribute__((weak, alias("DMAC_0_Handler")));
void DMAC_2_Handler(void) __attribute__((weak, alias("DMAC_0_Handler")));
void DMAC_3_Handler(void) __attribute__((weak, alias("DMAC_0_Handler")));
void DMAC_4_Handler(void) __attribute__((weak, alias("DMAC_0_Handler")));

When I run with lib_archive = no the handlers are populated properly, and everything works as expected.

This might only be an issue with PlatformIO, I can share this over there too, but I would also expect the library to work when archived.

ladyada commented 4 years ago

we have this library now 'built' into the BSP, maybe make sure you dont have this library installed separately?

Timvrakas commented 4 years ago

I don't think I am. Its building the library that's included in the framework directory. image

ladyada commented 4 years ago

not sure then - we only use Arduino IDE

Timvrakas commented 4 years ago

On that note, is ZeroDMA SPI currently working? The most recent commit suggests perhaps not. https://github.com/adafruit/ArduinoCore-samd/commit/8b88806d46376d64131f33389f71626052cbe351

ladyada commented 4 years ago

should be - we have been using for SPI TFTs - please try arduino IDE

Timvrakas commented 4 years ago

Alright. I'll need to get it under the oscilloscope and see what timing changes the DMA introduced. My accelerometer might just be finicky. I'm not planning on dropping my build environment just yet.