STM3240G-EVAL: Mount procfs if enabled.

This commit is contained in:
Gregory Nutt
2017-11-25 18:03:01 -06:00
parent c2c2c4f111
commit 38dc3fe442
+23 -14
View File
@@ -39,6 +39,7 @@
#include <nuttx/config.h> #include <nuttx/config.h>
#include <sys/mount.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <syslog.h> #include <syslog.h>
@@ -247,7 +248,6 @@ int stm32_bringup(void)
{ {
syslog(LOG_ERR, syslog(LOG_ERR,
"ERROR: Failed to instantiate the RTC lower-half driver\n"); "ERROR: Failed to instantiate the RTC lower-half driver\n");
return -ENOMEM;
} }
else else
{ {
@@ -261,7 +261,6 @@ int stm32_bringup(void)
syslog(LOG_ERR, syslog(LOG_ERR,
"ERROR: Failed to bind/register the RTC driver: %d\n", "ERROR: Failed to bind/register the RTC driver: %d\n",
ret); ret);
return ret;
} }
} }
#endif #endif
@@ -275,9 +274,9 @@ int stm32_bringup(void)
if (!spi) if (!spi)
{ {
syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 0\n"); syslog(LOG_ERR, "ERROR: Failed to initialize SPI port 0\n");
return -ENODEV;
} }
else
{
/* Now bind the SPI interface to the M25P64/128 SPI FLASH driver */ /* Now bind the SPI interface to the M25P64/128 SPI FLASH driver */
mtd = m25p_initialize(spi); mtd = m25p_initialize(spi);
@@ -285,8 +284,9 @@ int stm32_bringup(void)
{ {
syslog(LOG_ERR, syslog(LOG_ERR,
"ERROR: Failed to bind SPI port 0 to the SPI FLASH driver\n"); "ERROR: Failed to bind SPI port 0 to the SPI FLASH driver\n");
return -ENODEV;
} }
}
#warning "Now what are we going to do with this SPI FLASH driver?" #warning "Now what are we going to do with this SPI FLASH driver?"
#endif #endif
@@ -300,9 +300,9 @@ int stm32_bringup(void)
syslog(LOG_ERR, syslog(LOG_ERR,
"ERROR: Failed to initialize SDIO slot %d\n", "ERROR: Failed to initialize SDIO slot %d\n",
CONFIG_NSH_MMCSDSLOTNO); CONFIG_NSH_MMCSDSLOTNO);
return -ENODEV;
} }
else
{
/* Now bind the SDIO interface to the MMC/SD driver */ /* Now bind the SDIO interface to the MMC/SD driver */
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio); ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
@@ -311,27 +311,36 @@ int stm32_bringup(void)
syslog(LOG_ERR, syslog(LOG_ERR,
"ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n", "ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
ret); ret);
return ret;
} }
/* Then let's guess and say that there is a card in the slot. I need to check to /* Then let's guess and say that there is a card in the slot. I need
* see if the STM3240G-EVAL board supports a GPIO to detect if there is a card in * to check to see if the STM3240G-EVAL board supports a GPIO to
* the slot. * detect if there is a card in the slot.
*/ */
sdio_mediachange(sdio, true); sdio_mediachange(sdio, true);
}
#endif
#ifdef CONFIG_FS_PROCFS
/* Mount the procfs file system */
ret = mount(NULL, "/proc", "procfs", 0, NULL);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: Failed to mount procfs at /proc: %d\n", ret);
}
#endif #endif
#ifdef HAVE_USBHOST #ifdef HAVE_USBHOST
/* Initialize USB host operation. stm32_usbhost_initialize() starts a thread /* Initialize USB host operation. stm32_usbhost_initialize() starts a
* will monitor for USB connection and disconnection events. * thread that will monitor for USB connection and disconnection events.
*/ */
ret = stm32_usbhost_initialize(); ret = stm32_usbhost_initialize();
if (ret != OK) if (ret != OK)
{ {
syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret); syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
return ret;
} }
#endif #endif