From 1ef922faaceabb5345bec6161b69aaa5682a6704 Mon Sep 17 00:00:00 2001 From: "Daniel P. Carvalho" Date: Tue, 17 Jul 2018 10:57:09 -0600 Subject: [PATCH] configs/nucleo-l432kc: Fix RAM size; STM31L4x2xx has only 64Kb of RAM. Remove references to I2C and SDIO: There is no I2C2 or SDIO on the STM32F4x2xx. --- configs/nucleo-l432kc/README.txt | 1 - configs/nucleo-l432kc/include/board.h | 11 ------- configs/nucleo-l432kc/include/nucleo-l432kc.h | 3 +- configs/nucleo-l432kc/nsh/defconfig | 2 +- configs/nucleo-l432kc/src/nucleo-l432kc.h | 6 ---- configs/nucleo-l432kc/src/stm32_appinit.c | 31 ------------------- configs/nucleo-l432kc/src/stm32_spi.c | 11 ------- 7 files changed, 2 insertions(+), 63 deletions(-) diff --git a/configs/nucleo-l432kc/README.txt b/configs/nucleo-l432kc/README.txt index ff027bf25b..9010e8bb84 100644 --- a/configs/nucleo-l432kc/README.txt +++ b/configs/nucleo-l432kc/README.txt @@ -20,7 +20,6 @@ NucleoL432KC: SPIs: Up to 2 SPIs SAIs: 1 dual-channel audio interface CAN interface - SDIO interface QSPI interface USB: USB 2.0 full-speed device/host/OTG controller with on-chip PHY CRC calculation unit diff --git a/configs/nucleo-l432kc/include/board.h b/configs/nucleo-l432kc/include/board.h index ce817272af..5f5b8fa4fd 100644 --- a/configs/nucleo-l432kc/include/board.h +++ b/configs/nucleo-l432kc/include/board.h @@ -125,17 +125,6 @@ (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | \ GPIO_PORTB | GPIO_PIN7) -#define GPIO_I2C2_SCL \ - (GPIO_I2C2_SCL_1 | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET) -#define GPIO_I2C2_SDA \ - (GPIO_I2C2_SDA_1 | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET) -#define GPIO_I2C2_SCL_GPIO \ - (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | \ - GPIO_PORTB | GPIO_PIN10) -#define GPIO_I2C2_SDA_GPIO \ - (GPIO_OUTPUT | GPIO_OPENDRAIN | GPIO_SPEED_50MHz | GPIO_OUTPUT_SET | \ - GPIO_PORTB | GPIO_PIN11) - /* SPI */ /* SPI1 is available on the arduino protocol at positions D11/12/13 */ diff --git a/configs/nucleo-l432kc/include/nucleo-l432kc.h b/configs/nucleo-l432kc/include/nucleo-l432kc.h index 36d22c39ec..6d03cb2fb9 100644 --- a/configs/nucleo-l432kc/include/nucleo-l432kc.h +++ b/configs/nucleo-l432kc/include/nucleo-l432kc.h @@ -83,7 +83,7 @@ * Flash Latency(WS) : 4 * Prefetch Buffer : OFF * 48MHz for USB OTG FS, : Doable if required using PLLSAI1 or MSI - * SDIO and RNG clock + * RNG clock */ /* HSI - 16 MHz RC factory-trimmed @@ -190,7 +190,6 @@ * UART5 * LPUART1 * I2C1 - * I2C2 * I2C3 * LPTIM1 * LPTIM2 diff --git a/configs/nucleo-l432kc/nsh/defconfig b/configs/nucleo-l432kc/nsh/defconfig index 8c73c2f26d..451c7f04b6 100644 --- a/configs/nucleo-l432kc/nsh/defconfig +++ b/configs/nucleo-l432kc/nsh/defconfig @@ -38,7 +38,7 @@ CONFIG_NSH_READLINE=y CONFIG_PREALLOC_MQ_MSGS=4 CONFIG_PREALLOC_TIMERS=4 CONFIG_PREALLOC_WDOGS=8 -CONFIG_RAM_SIZE=98304 +CONFIG_RAM_SIZE=65536 CONFIG_RAM_START=0x20000000 CONFIG_RAW_BINARY=y CONFIG_RR_INTERVAL=200 diff --git a/configs/nucleo-l432kc/src/nucleo-l432kc.h b/configs/nucleo-l432kc/src/nucleo-l432kc.h index 2c4652f7d8..88fa92c7a8 100644 --- a/configs/nucleo-l432kc/src/nucleo-l432kc.h +++ b/configs/nucleo-l432kc/src/nucleo-l432kc.h @@ -54,7 +54,6 @@ #define HAVE_PROC 1 #define HAVE_RTC_DRIVER 1 -#define HAVE_MMCSD 1 #if !defined(CONFIG_FS_PROCFS) # undef HAVE_PROC @@ -71,11 +70,6 @@ # undef HAVE_RTC_DRIVER #endif -#if !defined(CONFIG_STM32L4_SDIO) || !defined(CONFIG_MMCSD) || \ - !defined(CONFIG_MMCSD_SDIO) -# undef HAVE_MMCSD -#endif - /* LED. User LD3: the green LED is a user LED connected to Arduino signal D13 * corresponding to MCU I/O PB3 (pin 26) * target. diff --git a/configs/nucleo-l432kc/src/stm32_appinit.c b/configs/nucleo-l432kc/src/stm32_appinit.c index d3a725c776..0532f1fbbe 100644 --- a/configs/nucleo-l432kc/src/stm32_appinit.c +++ b/configs/nucleo-l432kc/src/stm32_appinit.c @@ -170,37 +170,6 @@ int board_app_initialize(uintptr_t arg) } #endif -#ifdef HAVE_MMCSD - /* First, get an instance of the SDIO interface */ - - g_sdio = sdio_initialize(CONFIG_NSH_MMCSDSLOTNO); - if (!g_sdio) - { - syslog(LOG_ERR, "ERROR: Failed to initialize SDIO slot %d\n", - CONFIG_NSH_MMCSDSLOTNO); - return -ENODEV; - } - - /* Now bind the SDIO interface to the MMC/SD driver */ - - ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, g_sdio); - if (ret != OK) - { - syslog(LOG_ERR, - "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", - ret); - return ret; - } - - /* Then let's guess and say that there is a card in the slot. There is no - * card detect GPIO. - */ - - sdio_mediachange(g_sdio, true); - - syslog(LOG_INFO, "[boot] Initialized SDIO\n"); -#endif - #ifdef CONFIG_PWM /* Initialize PWM and register the PWM device. */ diff --git a/configs/nucleo-l432kc/src/stm32_spi.c b/configs/nucleo-l432kc/src/stm32_spi.c index d69c3a2dff..7fcf9a3850 100644 --- a/configs/nucleo-l432kc/src/stm32_spi.c +++ b/configs/nucleo-l432kc/src/stm32_spi.c @@ -85,10 +85,6 @@ void stm32l4_spiinitialize(void) g_spi1 = stm32l4_spibus_initialize(1); -#ifdef HAVE_MMCSD - stm32l4_configgpio(GPIO_SPI_CS_SD_CARD); -#endif - spiinfo("SPI1 initialized\n"); #endif @@ -133,13 +129,6 @@ void stm32l4_spi1select(FAR struct spi_dev_s *dev, uint32_t devid, bool selected { spiinfo("devid: %08X CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); -#ifdef HAVE_MMCSD - if (devid == SPIDEV_MMCSD(0)) - { - stm32l4_gpiowrite(GPIO_SPI_CS_SD_CARD, !selected); - } -#endif - } uint8_t stm32l4_spi1status(FAR struct spi_dev_s *dev, uint32_t devid)