SAMD21 and SPI

Hi everyone,
I’m working on a custom board using SAMD21 as the microcontroller. Unfortunately, I have not found any sample library using SPI for a SAMD21-based board; many examples for micro: bit is incompatible with SAMD21-based boards. I’m now using a customized version of circuit playground express editor as this was the closest configuration to custom my board.
Whenever I use SPI either in the CCP file or the Javascript editor, the U2F file gets downloaded locally instead of being downloaded to the board using WebUSb, and I don’t get any errors; it just does not work. Once I remove or comment out the SPI related code, everything goes back to normal.
I would appreciate it if you could help or guide me in the right direction.