Suzuki, There were a handful of changes in the 10.0.0 release related to this that are discussed here: https://github.com/apache/incubator-nuttx/issues/2203
If you could comment there it might be easier to get the attention of the people involved in the change. I had not followed it as closely so it would take me a bit of time and, I personally won't have time to dig into this with some hardware until later in the week. We certainly should make sure this configuration is working correctly. --Brennan On Thu, Dec 10, 2020 at 12:24 AM SUZUKI Keiji <zuki.ebe...@gmail.com> wrote: > > Hi, > > I use STM32F407G-DISC1 (MB997D) and build nuttx on macOS Mojave (10.14.6). > > The following error occurs with the default configuration of > stm32f4discovery:usbnsh. > > NuttShell (NSH) NuttX-10.0.0 > nsh> nsh: nsh_session: readline failed: 9 > > The reason seems that instream->fs_fd is -1 instead of 0 in the readline() > function called by > nsh_session(). > > This error occurs in version 10.0-RC0 and after (I checked 10.0-RC0, 10.0 > and current master) > but does not occur in 9.1 and before (I checked 9.1, 8.2 and 7.31). > > The following patch fixed it in my environment but I don't know this is a > correct fix. > > === from here === > > diff --git a/nshlib/nsh_usbconsole.c b/nshlib/nsh_usbconsole.c > index 28f63bcc..768a621b 100644 > --- a/nshlib/nsh_usbconsole.c > +++ b/nshlib/nsh_usbconsole.c > @@ -77,8 +77,8 @@ > > static void nsh_configstdio(int fd, FAR struct console_stdio_s *pstate) > { > - /* Make sure the stdout, and stderr are flushed */ > - > + /* Make sure the stdin is closed and the stdout, and stderr are flushed */ > + fclose(stdin); > fflush(stdout); > fflush(stderr); > > @@ -88,6 +88,9 @@ static void nsh_configstdio(int fd, FAR struct > console_stdio_s *pstate) > dup2(fd, 1); > dup2(fd, 2); > > + /* fdopen stdin */ > + fdopen(0, "r"); > + > /* Setup the stdout */ > > pstate->cn_outfd = 1; > > ===== > > Thanks, > SUZUKI Keiji