You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SAMD fl::pinMode/digitalWrite map Arduino pins to the wrong pads #5130
getPinMapping in src/platforms/arm/samd/pin_samd_native.hpp uses group=pin/32, bit=pin%32 and does not use the variant's g_APinDescription. On the Adafruit Arduino Zero variant, Arduino pin 24 is PB11 (SCK), but this drives PA24, which the variant marks as a USB pad. Pin 23 is PB10 (MOSI), but this drives PA23. PINCFG=0 also clears the wrong pad's mux. Any FastLED code calling these on SAMD can hit this; #5053's PR only removes the SAMDHardwareSPIOutput::writeBit caller. Found by reading the code and variant files; not reproduced on hardware. Proposal: resolve pins through g_APinDescription, and audit callers such as the bit-bang channel driver.
PR #5167 makes getPinMapping read the pad from the variant's g_APinDescription table. Pin 24 now drives PB11 and pin 23 drives PB10, confirmed in the generated samd21 code and in the linked pin table. Still open here:
It has not been run on hardware.
The callers, such as the bit-bang channel driver, have not been audited for code that assumed the old linear numbering.
Verified already fixed on master by 108ff67 (PR #5167): Arduino builds use g_APinDescription in getPinMapping, and pinMode/digitalWrite/digitalRead all use that mapping. Arithmetic pin/32 mapping remains only in the bare-metal fallback. Follow-up b4d24ff (PR #5206) handles variant pins beyond PINS_COUNT. Re-ran bash test pin_samd_table_size successfully (1/1). No new source changes and no electrical validation claimed.
Activity
zackees commentedon Nov 8, 2026
PR #5167 makes
getPinMappingread the pad from the variant'sg_APinDescriptiontable. Pin 24 now drives PB11 and pin 23 drives PB10, confirmed in the generated samd21 code and in the linked pin table. Still open here:zackees commentedon Nov 9, 2026
Verified already fixed on master by 108ff67 (PR #5167): Arduino builds use g_APinDescription in getPinMapping, and pinMode/digitalWrite/digitalRead all use that mapping. Arithmetic pin/32 mapping remains only in the bare-metal fallback. Follow-up b4d24ff (PR #5206) handles variant pins beyond PINS_COUNT. Re-ran bash test pin_samd_table_size successfully (1/1). No new source changes and no electrical validation claimed.
fix(samd): map fl::pinMode/digitalWrite pins through g_APinDescription (