arch/arm/src/stm32: Add internal pull-up option for SDIO pins (also picks up an unrelated change to a README.txt file)

This commit is contained in:
Alan Carvalho de Assis 2018-05-12 14:47:00 -06:00 committed by Gregory Nutt
parent 33a1e73bab
commit df3d9dd357
3 changed files with 38 additions and 6 deletions

View File

@ -68,6 +68,10 @@ ENVIRONMENTS
the time as Cygwin, perhaps 20 minutes for the basic Ubuntu install the time as Cygwin, perhaps 20 minutes for the basic Ubuntu install
(vs. more than a day for the complete Cygwin install). (vs. more than a day for the complete Cygwin install).
There have been even more recent ports of Linux environment to
Windows. I need to update this section to include some mention of
these alternatives.
- The MSYS environment. I have no experience using the MSYS environment - The MSYS environment. I have no experience using the MSYS environment
and that configuration will not be discussed in this README file. and that configuration will not be discussed in this README file.
See http://www.mingw.org/wiki/MSYS if you are interested in See http://www.mingw.org/wiki/MSYS if you are interested in
@ -76,6 +80,17 @@ ENVIRONMENTS
is that it is closer to a native Windows environment and uses only a is that it is closer to a native Windows environment and uses only a
minimal of add-on POSIX-land tools. minimal of add-on POSIX-land tools.
- Other POSIX environments. Check out:
UnxUtils: https://sourceforge.net/projects/unxutils/,
https://en.wikipedia.org/wiki/UnxUtils
MobaXterm: https://mobaxterm.mobatek.net/
Gow`: https://github.com/bmatzelle/gow/wiki
Disclaimer: In priniple, these should work. However, I have never
used any of these environments and cannot guarantee that there is
not some less-than-obvious issues.
NuttX can also be installed and built on a native Windows system, but with NuttX can also be installed and built on a native Windows system, but with
some potential tool-related issues (see the discussion "Native Windows some potential tool-related issues (see the discussion "Native Windows
Build" under "Building NuttX" below). GNUWin32 is used to provide Build" under "Building NuttX" below). GNUWin32 is used to provide

View File

@ -7602,6 +7602,15 @@ config STM32_SDIO_CARD
Build in additional support needed only for SDIO cards (vs. SD Build in additional support needed only for SDIO cards (vs. SD
memory cards) memory cards)
config STM32_SDIO_PULLUP
bool "Enable internal Pull-Ups"
default n
---help---
If you are using an external SDCard module that does not have the
pull-up resistors for the SDIO interface (like the Gadgeteer SD Card
Module) then enable this option to activate the internal pull-up
resistors.
config STM32_SDIO_DMA config STM32_SDIO_DMA
bool "Support DMA data transfers" bool "Support DMA data transfers"
default y if STM32_DMA2 default y if STM32_DMA2

View File

@ -151,6 +151,14 @@
# undef CONFIG_SDIO_XFRDEBUG # undef CONFIG_SDIO_XFRDEBUG
#endif #endif
/* Enable the SDIO pull-up resistors if needed */
#ifdef CONFIG_STM32_SDIO_PULLUP
# define SDIO_PULLUP_ENABLE GPIO_PULLUP
#else
# define SDIO_PULLUP_ENABLE 0
#endif
/* Friendly CLKCR bit re-definitions ****************************************/ /* Friendly CLKCR bit re-definitions ****************************************/
#define SDIO_CLKCR_RISINGEDGE (0) #define SDIO_CLKCR_RISINGEDGE (0)
@ -3038,14 +3046,14 @@ FAR struct sdio_dev_s *sdio_initialize(int slotno)
*/ */
#ifndef CONFIG_SDIO_MUXBUS #ifndef CONFIG_SDIO_MUXBUS
stm32_configgpio(GPIO_SDIO_D0); stm32_configgpio(GPIO_SDIO_D0 | SDIO_PULLUP_ENABLE);
#ifndef CONFIG_STM32_SDIO_WIDTH_D1_ONLY #ifndef CONFIG_STM32_SDIO_WIDTH_D1_ONLY
stm32_configgpio(GPIO_SDIO_D1); stm32_configgpio(GPIO_SDIO_D1 | SDIO_PULLUP_ENABLE);
stm32_configgpio(GPIO_SDIO_D2); stm32_configgpio(GPIO_SDIO_D2 | SDIO_PULLUP_ENABLE);
stm32_configgpio(GPIO_SDIO_D3); stm32_configgpio(GPIO_SDIO_D3 | SDIO_PULLUP_ENABLE);
#endif #endif
stm32_configgpio(GPIO_SDIO_CK); stm32_configgpio(GPIO_SDIO_CK | SDIO_PULLUP_ENABLE);
stm32_configgpio(GPIO_SDIO_CMD); stm32_configgpio(GPIO_SDIO_CMD | SDIO_PULLUP_ENABLE);
#endif #endif
/* Reset the card and assure that it is in the initial, unconfigured /* Reset the card and assure that it is in the initial, unconfigured