From 157bf153fc346be7c79f7e6163dbb1e675a63fa3 Mon Sep 17 00:00:00 2001 From: Michael Jung Date: Fri, 28 Jun 2019 06:59:09 -0600 Subject: [PATCH] configs/pnev5180b/nsh-cdcecm: Adds NSH configuration with UART0 and eth0 via CDC/ECM on USB device. --- configs/pnev5180b/README.txt | 6 ++++- configs/pnev5180b/nsh-cdcecm/defconfig | 37 ++++++++++++++++++++++++++ configs/pnev5180b/src/lpc17_bringup.c | 21 +++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 configs/pnev5180b/nsh-cdcecm/defconfig diff --git a/configs/pnev5180b/README.txt b/configs/pnev5180b/README.txt index df85dd4d8e..d5de4cb1dc 100644 --- a/configs/pnev5180b/README.txt +++ b/configs/pnev5180b/README.txt @@ -99,6 +99,10 @@ Where is one of the following: b. Execute 'make menuconfig' in nuttx/ in order to start the reconfiguration process. - nsh-usbconsole: + usbnsh: Configures the NuttShell (nsh) located at apps/system/nsh. The Configuration enables the CDC/ACM based NSH interface on /dev/ttyACM0. + + nsh-cdcecm: + Configures the NuttShell (nsh) to provide a terminal on UART0. The + Configuration also provides network interface eth0 via CDC/ECM. diff --git a/configs/pnev5180b/nsh-cdcecm/defconfig b/configs/pnev5180b/nsh-cdcecm/defconfig new file mode 100644 index 0000000000..88bd4f0404 --- /dev/null +++ b/configs/pnev5180b/nsh-cdcecm/defconfig @@ -0,0 +1,37 @@ +# +# This file is autogenerated: PLEASE DO NOT EDIT IT. +# +# You can use "make menuconfig" to make any modifications to the installed .config file. +# You can then do "make savedefconfig" to generate a new defconfig file that includes your +# modifications. +# +CONFIG_ARCH="arm" +CONFIG_ARCH_BOARD="pnev5180b" +CONFIG_ARCH_BOARD_PNEV5180B=y +CONFIG_ARCH_CHIP_LPC1769=y +CONFIG_ARCH_CHIP_LPC17XX=y +CONFIG_BOARD_LOOPSPERMSEC=11992 +CONFIG_BUILTIN=y +CONFIG_CDCECM_EPBULKIN=5 +CONFIG_CDCECM_EPBULKOUT=2 +CONFIG_FS_BINFS=y +CONFIG_FS_PROCFS=y +CONFIG_LPC17_UART0=y +CONFIG_LPC17_USBDEV=y +CONFIG_LPC17_USBDEV_NOVBUS=y +CONFIG_MM_REGIONS=2 +CONFIG_NETINIT_NOMAC=y +CONFIG_NET_CDCECM=y +CONFIG_NET_ICMP=y +CONFIG_NET_ICMP_SOCKET=y +CONFIG_NET_SOCKOPTS=y +CONFIG_NET_TCP=y +CONFIG_NET_UDP=y +CONFIG_NSH_ARCHINIT=y +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_RAM_SIZE=32768 +CONFIG_RAM_START=0x10000000 +CONFIG_SYSTEM_NSH=y +CONFIG_SYSTEM_PING=y +CONFIG_UART0_SERIAL_CONSOLE=y +CONFIG_USER_ENTRYPOINT="nsh_main" diff --git a/configs/pnev5180b/src/lpc17_bringup.c b/configs/pnev5180b/src/lpc17_bringup.c index 689c21bb77..01951a59fd 100644 --- a/configs/pnev5180b/src/lpc17_bringup.c +++ b/configs/pnev5180b/src/lpc17_bringup.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -114,6 +115,26 @@ int pnev5180b_bringup(void) { int ret = OK; +#ifdef CONFIG_FS_PROCFS + ret = mount(NULL, "/proc", "procfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount the PROC filesystem: %d (%d)\n", + ret, errno); + goto done; + } +#endif + +#ifdef CONFIG_FS_BINFS + ret = mount(NULL, "/bin", "binfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "ERROR: Failed to mount the BIN filesystem: %d (%d)\n", + ret, errno); + goto done; + } +#endif + #ifndef CONFIG_BOARDCTL_USBDEVCTRL # ifdef CONFIG_CDCACM ret = cdcacm_initialize(0, NULL);