mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 13:27:01 +08:00
STM3240G-EVAL: Mount procfs if enabled.
This commit is contained in:
@@ -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,18 +274,19 @@ 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 */
|
|
||||||
|
|
||||||
mtd = m25p_initialize(spi);
|
|
||||||
if (!mtd)
|
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR,
|
/* Now bind the SPI interface to the M25P64/128 SPI FLASH driver */
|
||||||
"ERROR: Failed to bind SPI port 0 to the SPI FLASH driver\n");
|
|
||||||
return -ENODEV;
|
mtd = m25p_initialize(spi);
|
||||||
|
if (!mtd)
|
||||||
|
{
|
||||||
|
syslog(LOG_ERR,
|
||||||
|
"ERROR: Failed to bind SPI port 0 to the SPI FLASH driver\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#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,38 +300,47 @@ 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 */
|
|
||||||
|
|
||||||
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
|
|
||||||
if (ret != OK)
|
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR,
|
/* Now bind the SDIO interface to the MMC/SD driver */
|
||||||
"ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
|
|
||||||
ret);
|
ret = mmcsd_slotinitialize(CONFIG_NSH_MMCSDMINOR, sdio);
|
||||||
return ret;
|
if (ret != OK)
|
||||||
|
{
|
||||||
|
syslog(LOG_ERR,
|
||||||
|
"ERROR: Failed to bind SDIO to the MMC/SD driver: %d\n",
|
||||||
|
ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Then let's guess and say that there is a card in the slot. I need
|
||||||
|
* to check to see if the STM3240G-EVAL board supports a GPIO to
|
||||||
|
* detect if there is a card in the slot.
|
||||||
|
*/
|
||||||
|
|
||||||
|
sdio_mediachange(sdio, true);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Then let's guess and say that there is a card in the slot. I need to check to
|
#ifdef CONFIG_FS_PROCFS
|
||||||
* see if the STM3240G-EVAL board supports a GPIO to detect if there is a card in
|
/* Mount the procfs file system */
|
||||||
* the slot.
|
|
||||||
*/
|
|
||||||
|
|
||||||
sdio_mediachange(sdio, true);
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user