Hi All I'm having difficulty using the Arduino SD library with the SAMD21 based MKR Zero clone. The SAMD21 devices include two SPI interfaces, PA16, PA17 and PA19 (sercom1) or PA12, PA13 and PA15 (sercom4). Normally when using SPI the first SPI interface (PA16, 17 and 19) becomes active. However for unknown reasons the SD library uses the second interface on PA12, 13 and 14 for its SPI communication. Well, maybe it's not an unknown reason why they've done this as the standard MKR Zero board does have the SD card on PA12, 13 and 14. But my version does not.
I've worked through the SD library as far as I can and confirm that I it is using hardware SPI with call
The code up to this point within SD seems relatively straightforward and I don't notice anything that would be changing the SERCOM. Ideally I'd like to override whatever portion of the SD library is using sercom4 to put it back to sercom1. Perhaps it's in the Sd2PinMap.h file?