Skip to content

Commit 0b5ceeb

Browse files
committed
stm32: spi: enable pull-up on MISO and pull-down on CLK
This should help SD over SPI. Hope does not break other SPI users
1 parent 11e0c7d commit 0b5ceeb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

firmware/hw_layer/ports/stm32/stm32_spi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ void initSpiModule(SPIDriver *driver,
151151
* Info on the silicon defect can be found in this document, section 2.5.2:
152152
* https://www.st.com/content/ccc/resource/technical/document/errata_sheet/0a/98/58/84/86/b6/47/a2/DM00037591.pdf/files/DM00037591.pdf/jcr:content/translations/en.DM00037591.pdf
153153
*/
154-
efiSetPadMode("SPI CLK ", sck, PAL_MODE_ALTERNATE(getSpiAf(driver)) | sckMode | PAL_STM32_OSPEED_HIGHEST);
154+
efiSetPadMode("SPI CLK ", sck, PAL_MODE_ALTERNATE(getSpiAf(driver)) | sckMode | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUPDR_PULLDOWN);
155155

156-
efiSetPadMode("SPI MOSI", mosi, PAL_MODE_ALTERNATE(getSpiAf(driver)) | mosiMode | PAL_STM32_OSPEED_HIGHEST);
156+
efiSetPadMode("SPI MOSI", mosi, PAL_MODE_ALTERNATE(getSpiAf(driver)) | mosiMode | PAL_STM32_OSPEED_HIGHEST | PAL_STM32_PUPDR_PULLUP);
157157

158158
// Activate the internal pullup on MISO: SD cards indicate "busy" by holding MOSI low,
159159
// so in case there is no SD card installed, the line could float low and indicate that

0 commit comments

Comments
 (0)