It turns out that assert() generates live code on samd processors, and the default (defined in newlib) function invokes fiprintf()
Since stdio isn't set up in most Arduino compiles, this is pretty useless, and it can cause code bloat in sketchs that include SPI.
(I think this is normally masked because there is only one SPI port on most SAMD platforms, so the constructor always optimizes away the assert. But it's an issue for boards with more than one SPI. See https://forums.adafruit.com/viewtopic.php?f=62&t=169034 )
(Note that this is the ONLY use of assert in the entire SAMD core.)
The SPIClass Constructor in the SPI library contains an assert:
It turns out that assert() generates live code on samd processors, and the default (defined in newlib) function invokes fiprintf() Since stdio isn't set up in most Arduino compiles, this is pretty useless, and it can cause code bloat in sketchs that include SPI. (I think this is normally masked because there is only one SPI port on most SAMD platforms, so the constructor always optimizes away the assert. But it's an issue for boards with more than one SPI. See https://forums.adafruit.com/viewtopic.php?f=62&t=169034 )
(Note that this is the ONLY use of assert in the entire SAMD core.)