You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Flavio Castro Alves Filho <fl...@gmail.com> on 2021/01/17 13:43:23 UTC

Problem with USB CDC initialization on board based on STM32F4DISCO

Hello,

I am working to port NuttX on a board based on STM32F4DISCOVERY. The
microcontroller is the STM32F407VET6.

USB CDC support is not initializing.

When I plug the USB on the board, I have the following dmesg response in Linux:

[517062.075048] usb usb1-port2: attempt power cycle
[517062.726922] usb 1-2: new full-speed USB device number 47 using xhci_hcd
[517062.727170] usb 1-2: Device not responding to setup address.
[517062.935148] usb 1-2: Device not responding to setup address.
[517063.142906] usb 1-2: device not accepting address 47, error -71
[517063.270916] usb 1-2: new full-speed USB device number 48 using xhci_hcd
[517063.271141] usb 1-2: Device not responding to setup address.
[517063.479134] usb 1-2: Device not responding to setup address.

When I run stm32f4discovery:usbnsh on my discovery board, it works.

I compared the defconfig from the base project and from mine and I
believe I have initialized everything that is related to the USB.

Here is the defconfig for my board:

#
# 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_FPU is not set
# CONFIG_MMCSD_MMCSUPPORT is not set
# CONFIG_MMCSD_SPI is not set
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="phi-innovations"
CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
CONFIG_ARCH_CHIP="stm32"
CONFIG_ARCH_CHIP_STM32=y
CONFIG_ARCH_CHIP_STM32F407VG=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_MEMCPY=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARDCTL_UNIQUEID=y
CONFIG_BOARDCTL_USBDEVCTRL=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_CDCACM=y
CONFIG_CDCACM_CONSOLE=y
CONFIG_CDCACM_RXBUFSIZE=256
CONFIG_CDCACM_TXBUFSIZE=256
CONFIG_CLOCK_MONOTONIC=y
CONFIG_CONSOLE_SYSLOG=y
CONFIG_DEBUG_ASSERTIONS=y
CONFIG_DEBUG_DMA=y
CONFIG_DEBUG_DMA_ERROR=y
CONFIG_DEBUG_DMA_INFO=y
CONFIG_DEBUG_DMA_WARN=y
CONFIG_DEBUG_ERROR=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ERROR=y
CONFIG_DEBUG_FS_WARN=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_HARDFAULT_ALERT=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_NET=y
CONFIG_DEBUG_NET_ERROR=y
CONFIG_DEBUG_NET_INFO=y
CONFIG_DEBUG_NET_WARN=y
CONFIG_DEBUG_RTC=y
CONFIG_DEBUG_RTC_ERROR=y
CONFIG_DEBUG_RTC_INFO=y
CONFIG_DEBUG_RTC_WARN=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEBUG_WARN=y
CONFIG_DEV_GPIO=y
CONFIG_ETH0_PHY_LAN8742A=y
CONFIG_EXAMPLES_PPPD=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_SMARTFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_HEAP_COLORATION=y
CONFIG_IDLETHREAD_STACKSIZE=2048
CONFIG_INTELHEX_BINARY=y
CONFIG_IOEXPANDER=y
CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
CONFIG_MAX_TASKS=16
CONFIG_MMCSD=y
CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
CONFIG_MMCSD_SDIO=y
CONFIG_MTD=y
CONFIG_MTD_MX25L=y
CONFIG_MTD_SMART=y
CONFIG_MTD_SMART_FSCK=y
CONFIG_MX25L_SPIFREQUENCY=21000000
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETINIT_DEBUG=y
CONFIG_NETINIT_DHCPC=y
CONFIG_NETINIT_DNS=y
CONFIG_NETINIT_DNSIPADDR=0x08080808
CONFIG_NETINIT_DRIPADDR=0x0a010101
CONFIG_NETINIT_NOMAC=y
CONFIG_NETINIT_THREAD=y
CONFIG_NETUTILS_DHCPC=y
CONFIG_NETUTILS_NETCAT=y
CONFIG_NETUTILS_PPPD_PAP=y
CONFIG_NET_ARP_DUMP=y
CONFIG_NET_ARP_SEND=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_PKTSIZE=1294
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_SOLINGER=y
CONFIG_NET_STATISTICS=y
CONFIG_NET_TCP=y
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_TCPURGDATA=y
CONFIG_NET_TCP_KEEPALIVE=y
CONFIG_NET_TCP_WRITE_BUFFERS=y
CONFIG_NET_UDP=y
CONFIG_NET_UDP_CHECKSUMS=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_DISABLE_LOSMART=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_PROMPT_STRING="nsh$ "
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x20000000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_EXTERNAL=y
CONFIG_RTC_PCF8563=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=13
CONFIG_START_MONTH=9
CONFIG_START_YEAR=2014
CONFIG_STM32F4DISBB=y
CONFIG_STM32_ADC1=y
CONFIG_STM32_DMA1=y
CONFIG_STM32_DMA2=y
CONFIG_STM32_DMACAPABLE=y
CONFIG_STM32_ETHMAC=y
CONFIG_STM32_I2C1=y
CONFIG_STM32_JTAG_SW_ENABLE=y
CONFIG_STM32_OTGFS=y
CONFIG_STM32_PHYADDR=0
CONFIG_STM32_PHYSR=31
CONFIG_STM32_PHYSR_100FD=0x0018
CONFIG_STM32_PHYSR_100HD=0x0008
CONFIG_STM32_PHYSR_10FD=0x0014
CONFIG_STM32_PHYSR_10HD=0x0004
CONFIG_STM32_PHYSR_ALTCONFIG=y
CONFIG_STM32_PHYSR_ALTMODE=0x001c
CONFIG_STM32_PWR=y
CONFIG_STM32_RMII_EXTCLK=y
CONFIG_STM32_SDIO=y
CONFIG_STM32_SPI1=y
CONFIG_STM32_USART1=y
CONFIG_STM32_USART2=y
CONFIG_STM32_USART3=y
CONFIG_STM32_USART6=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_PING=y
CONFIG_USART2_IFLOWCONTROL=y
CONFIG_USART2_OFLOWCONTROL=y
CONFIG_USART3_RS485=y
CONFIG_USART6_RXBUFSIZE=64
CONFIG_USART6_TXBUFSIZE=64
CONFIG_USBDEV=y
CONFIG_USER_ENTRYPOINT="nsh_main"

I believe that there is something missing or wrong in my
configuration, but I couldn't find what it is.

Can anybody give me some advice on how to solve this issue?

Best regards,

Flavio


-- 
Flavio de Castro Alves Filho

flavio.alves@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Nathan Hartman <ha...@gmail.com>.
On Sun, Jan 17, 2021 at 1:34 PM Grr <ge...@gmail.com> wrote:
>
> Sort of binary search? You're right, that's faster. I tend to see it like a
> sequence rather than a searchable collection

Oh yes, bisect does a binary search of a sequence of commits to find
the one that broke something. I've used it to find which commit
introduced a subtle bug, where there were tens of thousands of commits
between a "known good" revision and a "known bad" revision, and by
using bisect I only had to test maybe 10 or 15 revisions. The bigger
the search space, the more useful bisect is. For Git, bisect is built
in [1]. For Subversion, there's a perl script to do it [2]. It might
be helpful for you in this case, but even if not, it's good to know
how to use it when you need it.

[1] https://git-scm.com/docs/git-bisect

[2] https://metacpan.org/pod/distribution/App-SVN-Bisect/bin/svn-bisect

Nathan

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Grr <ge...@gmail.com>.
Sort of binary search? You're right, that's faster. I tend to see it like a
sequence rather than a searchable collection

El dom, 17 ene 2021 a las 11:15, Nathan Hartman (<ha...@gmail.com>)
escribió:

> On Sun, Jan 17, 2021 at 11:36 AM Grr <ge...@gmail.com> wrote:
>
> > Have you tried starting from original, working config and adding and
> > testing after _every single_ change?
> >
> > If you're changing OS elements, maybe one of them is affecting USB
> without
> > you knowing
> >
> > Testing at every change is tedious but sometimes the only possible
> > technique
>
>
> If you're using version control, and each feature you add is a new commit,
> then you can bisect to find which commit breaks USB, with fewer tests than
> testing each commit in sequence.
>
> Nathan
>

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Flavio Castro Alves Filho <fl...@gmail.com>.
I was preparing myself psychology to start rebuilding, but the idea to
follow the commits is much more attractive :-)

Thank you for the advice.

Best regards

Flavio

Em dom, 17 de jan de 2021 14:15, Nathan Hartman <ha...@gmail.com>
escreveu:

> On Sun, Jan 17, 2021 at 11:36 AM Grr <ge...@gmail.com> wrote:
>
> > Have you tried starting from original, working config and adding and
> > testing after _every single_ change?
> >
> > If you're changing OS elements, maybe one of them is affecting USB
> without
> > you knowing
> >
> > Testing at every change is tedious but sometimes the only possible
> > technique
>
>
> If you're using version control, and each feature you add is a new commit,
> then you can bisect to find which commit breaks USB, with fewer tests than
> testing each commit in sequence.
>
> Nathan
>

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Nathan Hartman <ha...@gmail.com>.
On Sun, Jan 17, 2021 at 11:36 AM Grr <ge...@gmail.com> wrote:

> Have you tried starting from original, working config and adding and
> testing after _every single_ change?
>
> If you're changing OS elements, maybe one of them is affecting USB without
> you knowing
>
> Testing at every change is tedious but sometimes the only possible
> technique


If you're using version control, and each feature you add is a new commit,
then you can bisect to find which commit breaks USB, with fewer tests than
testing each commit in sequence.

Nathan

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Grr <ge...@gmail.com>.
El dom, 17 ene 2021 a las 9:10, Flavio Castro Alves Filho (<
flavio.alves@gmail.com>) escribió:

> Thank you very much for your fast response.
>
> I checked the boot calls and they are the same, regarding USB
> initialization.
>
> I compared the include/nuttx/config.h files too ... at least regarding
> USB, I couldn't see anything critical.
>

That means problem is in a dependency and not exactly USB

>

>
> The development approach that I am working was exactly starting with
> stm32discovery board and increasing features. Maybe I have to restart,
> checking first the USB.
>

Have you tried starting from original, working config and adding and
testing after _every single_ change?

If you're changing OS elements, maybe one of them is affecting USB without
you knowing

Testing at every change is tedious but sometimes the only possible technique

>
> Best regards,
>
> Flavio
>
> Em dom., 17 de jan. de 2021 às 11:39, Grr <ge...@gmail.com> escreveu:
> >
> > What you can do is compare .config generated from that defconfig to
> .config
> > generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
> > the differences. You can also compare include/nuttx/config.h from both
> > configs
> >
> > Another approach is to start from discovery config and do the
> modifications
> > for your board. After you have it working, clone the config to a
> different
> > board name. With "make savedefconfig" you can save your working defconfig
> >
> > El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
> > flavio.alves@gmail.com>) escribió:
> >
> > > As an additional information, if I load the STM32F4DISCO on my board,
> USB
> > > works.
> > >
> > > Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
> > > <fl...@gmail.com> escreveu:
> > > >
> > > > Hello,
> > > >
> > > > I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> > > > microcontroller is the STM32F407VET6.
> > > >
> > > > USB CDC support is not initializing.
> > > >
> > > > When I plug the USB on the board, I have the following dmesg
> response in
> > > Linux:
> > > >
> > > > [517062.075048] usb usb1-port2: attempt power cycle
> > > > [517062.726922] usb 1-2: new full-speed USB device number 47 using
> > > xhci_hcd
> > > > [517062.727170] usb 1-2: Device not responding to setup address.
> > > > [517062.935148] usb 1-2: Device not responding to setup address.
> > > > [517063.142906] usb 1-2: device not accepting address 47, error -71
> > > > [517063.270916] usb 1-2: new full-speed USB device number 48 using
> > > xhci_hcd
> > > > [517063.271141] usb 1-2: Device not responding to setup address.
> > > > [517063.479134] usb 1-2: Device not responding to setup address.
> > > >
> > > > When I run stm32f4discovery:usbnsh on my discovery board, it works.
> > > >
> > > > I compared the defconfig from the base project and from mine and I
> > > > believe I have initialized everything that is related to the USB.
> > > >
> > > > Here is the defconfig for my board:
> > > >
> > > > #
> > > > # 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_FPU is not set
> > > > # CONFIG_MMCSD_MMCSUPPORT is not set
> > > > # CONFIG_MMCSD_SPI is not set
> > > > # CONFIG_NSH_ARGCAT is not set
> > > > # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> > > > # CONFIG_NSH_CMDPARMS is not set
> > > > CONFIG_ADC=y
> > > > CONFIG_ANALOG=y
> > > > CONFIG_ARCH="arm"
> > > > CONFIG_ARCH_BOARD="phi-innovations"
> > > > CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
> > > > CONFIG_ARCH_CHIP="stm32"
> > > > CONFIG_ARCH_CHIP_STM32=y
> > > > CONFIG_ARCH_CHIP_STM32F407VG=y
> > > > CONFIG_ARCH_STACKDUMP=y
> > > > CONFIG_ARMV7M_MEMCPY=y
> > > > CONFIG_BOARDCTL_RESET=y
> > > > CONFIG_BOARDCTL_UNIQUEID=y
> > > > CONFIG_BOARDCTL_USBDEVCTRL=y
> > > > CONFIG_BOARD_LOOPSPERMSEC=16717
> > > > CONFIG_BUILTIN=y
> > > > CONFIG_CDCACM=y
> > > > CONFIG_CDCACM_CONSOLE=y
> > > > CONFIG_CDCACM_RXBUFSIZE=256
> > > > CONFIG_CDCACM_TXBUFSIZE=256
> > > > CONFIG_CLOCK_MONOTONIC=y
> > > > CONFIG_CONSOLE_SYSLOG=y
> > > > CONFIG_DEBUG_ASSERTIONS=y
> > > > CONFIG_DEBUG_DMA=y
> > > > CONFIG_DEBUG_DMA_ERROR=y
> > > > CONFIG_DEBUG_DMA_INFO=y
> > > > CONFIG_DEBUG_DMA_WARN=y
> > > > CONFIG_DEBUG_ERROR=y
> > > > CONFIG_DEBUG_FEATURES=y
> > > > CONFIG_DEBUG_FS=y
> > > > CONFIG_DEBUG_FS_ERROR=y
> > > > CONFIG_DEBUG_FS_WARN=y
> > > > CONFIG_DEBUG_FULLOPT=y
> > > > CONFIG_DEBUG_HARDFAULT_ALERT=y
> > > > CONFIG_DEBUG_INFO=y
> > > > CONFIG_DEBUG_NET=y
> > > > CONFIG_DEBUG_NET_ERROR=y
> > > > CONFIG_DEBUG_NET_INFO=y
> > > > CONFIG_DEBUG_NET_WARN=y
> > > > CONFIG_DEBUG_RTC=y
> > > > CONFIG_DEBUG_RTC_ERROR=y
> > > > CONFIG_DEBUG_RTC_INFO=y
> > > > CONFIG_DEBUG_RTC_WARN=y
> > > > CONFIG_DEBUG_SYMBOLS=y
> > > > CONFIG_DEBUG_WARN=y
> > > > CONFIG_DEV_GPIO=y
> > > > CONFIG_ETH0_PHY_LAN8742A=y
> > > > CONFIG_EXAMPLES_PPPD=y
> > > > CONFIG_FAT_LCNAMES=y
> > > > CONFIG_FAT_LFN=y
> > > > CONFIG_FS_FAT=y
> > > > CONFIG_FS_PROCFS=y
> > > > CONFIG_FS_SMARTFS=y
> > > > CONFIG_HAVE_CXX=y
> > > > CONFIG_HAVE_CXXINITIALIZE=y
> > > > CONFIG_HEAP_COLORATION=y
> > > > CONFIG_IDLETHREAD_STACKSIZE=2048
> > > > CONFIG_INTELHEX_BINARY=y
> > > > CONFIG_IOEXPANDER=y
> > > > CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
> > > > CONFIG_MAX_TASKS=16
> > > > CONFIG_MMCSD=y
> > > > CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
> > > > CONFIG_MMCSD_SDIO=y
> > > > CONFIG_MTD=y
> > > > CONFIG_MTD_MX25L=y
> > > > CONFIG_MTD_SMART=y
> > > > CONFIG_MTD_SMART_FSCK=y
> > > > CONFIG_MX25L_SPIFREQUENCY=21000000
> > > > CONFIG_NET=y
> > > > CONFIG_NETDB_DNSCLIENT=y
> > > > CONFIG_NETINIT_DEBUG=y
> > > > CONFIG_NETINIT_DHCPC=y
> > > > CONFIG_NETINIT_DNS=y
> > > > CONFIG_NETINIT_DNSIPADDR=0x08080808
> > > > CONFIG_NETINIT_DRIPADDR=0x0a010101
> > > > CONFIG_NETINIT_NOMAC=y
> > > > CONFIG_NETINIT_THREAD=y
> > > > CONFIG_NETUTILS_DHCPC=y
> > > > CONFIG_NETUTILS_NETCAT=y
> > > > CONFIG_NETUTILS_PPPD_PAP=y
> > > > CONFIG_NET_ARP_DUMP=y
> > > > CONFIG_NET_ARP_SEND=y
> > > > CONFIG_NET_BROADCAST=y
> > > > CONFIG_NET_ETH_PKTSIZE=1294
> > > > CONFIG_NET_ICMP=y
> > > > CONFIG_NET_ICMP_SOCKET=y
> > > > CONFIG_NET_SOCKOPTS=y
> > > > CONFIG_NET_SOLINGER=y
> > > > CONFIG_NET_STATISTICS=y
> > > > CONFIG_NET_TCP=y
> > > > CONFIG_NET_TCPBACKLOG=y
> > > > CONFIG_NET_TCPURGDATA=y
> > > > CONFIG_NET_TCP_KEEPALIVE=y
> > > > CONFIG_NET_TCP_WRITE_BUFFERS=y
> > > > CONFIG_NET_UDP=y
> > > > CONFIG_NET_UDP_CHECKSUMS=y
> > > > CONFIG_NFILE_DESCRIPTORS=8
> > > > CONFIG_NSH_ARCHINIT=y
> > > > CONFIG_NSH_BUILTIN_APPS=y
> > > > CONFIG_NSH_DISABLE_LOSMART=y
> > > > CONFIG_NSH_FILEIOSIZE=512
> > > > CONFIG_NSH_LINELEN=64
> > > > CONFIG_NSH_PROMPT_STRING="nsh$ "
> > > > CONFIG_NSH_READLINE=y
> > > > CONFIG_PREALLOC_TIMERS=4
> > > > CONFIG_RAM_SIZE=114688
> > > > CONFIG_RAM_START=0x20000000
> > > > CONFIG_RAW_BINARY=y
> > > > CONFIG_RR_INTERVAL=200
> > > > CONFIG_RTC=y
> > > > CONFIG_RTC_EXTERNAL=y
> > > > CONFIG_RTC_PCF8563=y
> > > > CONFIG_SCHED_HPWORK=y
> > > > CONFIG_SCHED_HPWORKPRIORITY=192
> > > > CONFIG_SCHED_WAITPID=y
> > > > CONFIG_SDCLONE_DISABLE=y
> > > > CONFIG_STACK_COLORATION=y
> > > > CONFIG_START_DAY=13
> > > > CONFIG_START_MONTH=9
> > > > CONFIG_START_YEAR=2014
> > > > CONFIG_STM32F4DISBB=y
> > > > CONFIG_STM32_ADC1=y
> > > > CONFIG_STM32_DMA1=y
> > > > CONFIG_STM32_DMA2=y
> > > > CONFIG_STM32_DMACAPABLE=y
> > > > CONFIG_STM32_ETHMAC=y
> > > > CONFIG_STM32_I2C1=y
> > > > CONFIG_STM32_JTAG_SW_ENABLE=y
> > > > CONFIG_STM32_OTGFS=y
> > > > CONFIG_STM32_PHYADDR=0
> > > > CONFIG_STM32_PHYSR=31
> > > > CONFIG_STM32_PHYSR_100FD=0x0018
> > > > CONFIG_STM32_PHYSR_100HD=0x0008
> > > > CONFIG_STM32_PHYSR_10FD=0x0014
> > > > CONFIG_STM32_PHYSR_10HD=0x0004
> > > > CONFIG_STM32_PHYSR_ALTCONFIG=y
> > > > CONFIG_STM32_PHYSR_ALTMODE=0x001c
> > > > CONFIG_STM32_PWR=y
> > > > CONFIG_STM32_RMII_EXTCLK=y
> > > > CONFIG_STM32_SDIO=y
> > > > CONFIG_STM32_SPI1=y
> > > > CONFIG_STM32_USART1=y
> > > > CONFIG_STM32_USART2=y
> > > > CONFIG_STM32_USART3=y
> > > > CONFIG_STM32_USART6=y
> > > > CONFIG_SYSTEM_NSH=y
> > > > CONFIG_SYSTEM_PING=y
> > > > CONFIG_USART2_IFLOWCONTROL=y
> > > > CONFIG_USART2_OFLOWCONTROL=y
> > > > CONFIG_USART3_RS485=y
> > > > CONFIG_USART6_RXBUFSIZE=64
> > > > CONFIG_USART6_TXBUFSIZE=64
> > > > CONFIG_USBDEV=y
> > > > CONFIG_USER_ENTRYPOINT="nsh_main"
> > > >
> > > > I believe that there is something missing or wrong in my
> > > > configuration, but I couldn't find what it is.
> > > >
> > > > Can anybody give me some advice on how to solve this issue?
> > > >
> > > > Best regards,
> > > >
> > > > Flavio
> > > >
> > > >
> > > > --
> > > > Flavio de Castro Alves Filho
> > > >
> > > > flavio.alves@gmail.com
> > > > Twitter: http://twitter.com/#!/fraviofii
> > > > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> > >
> > >
> > >
> > > --
> > > Flavio de Castro Alves Filho
> > >
> > > flavio.alves@gmail.com
> > > Twitter: http://twitter.com/#!/fraviofii
> > > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> > >
>
>
>
> --
> Flavio de Castro Alves Filho
>
> flavio.alves@gmail.com
> Twitter: http://twitter.com/#!/fraviofii
> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Flavio Castro Alves Filho <fl...@gmail.com>.
I have good news (for me) :-)

I've built my customization using the stm32discovery:usbnsh
configuration and it worked.

I will restart from there.

Thank you for all your considerations.

Best regards,

Flavio

Em dom., 17 de jan. de 2021 às 19:16, spudaneco <sp...@gmail.com> escreveu:
>
> This probably explains why you get no USB log.  How could you?  It is configured to go to the console (i.e., /dev/console) but there is no console device.Sent from my Galaxy
> -------- Original message --------From: Flavio Castro Alves Filho <fl...@gmail.com> Date: 1/17/21  3:50 PM  (GMT-06:00) To: dev@nuttx.apache.org Subject: Re: Problem with USB CDC initialization on board based on STM32F4DISCO Em dom, 17 de jan de 2021 13:52, Gregory Nutt <sp...@gmail.com>escreveu:> I don't think that this combination will work:>> CONFIG_CDCACM_CONSOLE=y> CONFIG_CONSOLE_SYSLOG=y>> I think that the syslog console device would have to be available at> bootup. Normally a RAM log is is used to hold syslog data if a USB> console is used.>In my case, I am following the implementation from discovery board, wheresyslog is pointing to the uart and console on the USB.I will review if it was done correctly.Thank you for your remark.Best regardsFlavio> I might be wrong about that and this should not prevent the USB device> connecting.>> On 1/17/2021 9:10 AM, Flavio Castro Alves Filho wrote:> > Thank you very much for your fast response.> >> > I checked the boot calls and they are the same, regarding USB> initialization.> >> > I compared the include/nuttx/config.h files too ... at least regarding> > USB, I couldn't see anything critical.> >> > The development approach that I am working was exactly starting with> > stm32discovery board and increasing features. Maybe I have to restart,> > checking first the USB.> >> > Best regards,> >> > Flavio> >> > Em dom., 17 de jan. de 2021 às 11:39, Grr <ge...@gmail.com> escreveu:> >> What you can do is compare .config generated from that defconfig to> .config> >> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see> >> the differences. You can also compare include/nuttx/config.h from both> >> configs> >>> >> Another approach is to start from discovery config and do the> modifications> >> for your board. After you have it working, clone the config to a> different> >> board name. With "make savedefconfig" you can save your working> defconfig> >>> >> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<> >> flavio.alves@gmail.com>) escribió:> >>> >>> As an additional information, if I load the STM32F4DISCO on my board,> USB> >>> works.> >>>> >>> Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho> >>> <fl...@gmail.com> escreveu:> >>>> Hello,> >>>>> >>>> I am working to port NuttX on a board based on STM32F4DISCOVERY. The> >>>> microcontroller is the STM32F407VET6.> >>>>> >>>> USB CDC support is not initializing.> >>>>> >>>> When I plug the USB on the board, I have the following dmesg response> in> >>> Linux:> >>>> [517062.075048] usb usb1-port2: attempt power cycle> >>>> [517062.726922] usb 1-2: new full-speed USB device number 47 using> >>> xhci_hcd> >>>> [517062.727170] usb 1-2: Device not responding to setup address.> >>>> [517062.935148] usb 1-2: Device not responding to setup address.> >>>> [517063.142906] usb 1-2: device not accepting address 47, error -71> >>>> [517063.270916] usb 1-2: new full-speed USB device number 48 using> >>> xhci_hcd> >>>> [517063.271141] usb 1-2: Device not responding to setup address.> >>>> [517063.479134] usb 1-2: Device not responding to setup address.> >>>>> >>>> When I run stm32f4discovery:usbnsh on my discovery board, it works.> >>>>> >>>> I compared the defconfig from the base project and from mine and I> >>>> believe I have initialized everything that is related to the USB.> >>>>> >>>> Here is the defconfig for my board:> >>>>> >>>> #> >>>> # 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_FPU is not set> >>>> # CONFIG_MMCSD_MMCSUPPORT is not set> >>>> # CONFIG_MMCSD_SPI is not set> >>>> # CONFIG_NSH_ARGCAT is not set> >>>> # CONFIG_NSH_CMDOPT_HEXDUMP is not set> >>>> # CONFIG_NSH_CMDPARMS is not set> >>>> CONFIG_ADC=y> >>>> CONFIG_ANALOG=y> >>>> CONFIG_ARCH="arm"> >>>> CONFIG_ARCH_BOARD="phi-innovations"> >>>> CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y> >>>> CONFIG_ARCH_CHIP="stm32"> >>>> CONFIG_ARCH_CHIP_STM32=y> >>>> CONFIG_ARCH_CHIP_STM32F407VG=y> >>>> CONFIG_ARCH_STACKDUMP=y> >>>> CONFIG_ARMV7M_MEMCPY=y> >>>> CONFIG_BOARDCTL_RESET=y> >>>> CONFIG_BOARDCTL_UNIQUEID=y> >>>> CONFIG_BOARDCTL_USBDEVCTRL=y> >>>> CONFIG_BOARD_LOOPSPERMSEC=16717> >>>> CONFIG_BUILTIN=y> >>>> CONFIG_CDCACM=y> >>>> CONFIG_CDCACM_CONSOLE=y> >>>> CONFIG_CDCACM_RXBUFSIZE=256> >>>> CONFIG_CDCACM_TXBUFSIZE=256> >>>> CONFIG_CLOCK_MONOTONIC=y> >>>> CONFIG_CONSOLE_SYSLOG=y> >>>> CONFIG_DEBUG_ASSERTIONS=y> >>>> CONFIG_DEBUG_DMA=y> >>>> CONFIG_DEBUG_DMA_ERROR=y> >>>> CONFIG_DEBUG_DMA_INFO=y> >>>> CONFIG_DEBUG_DMA_WARN=y> >>>> CONFIG_DEBUG_ERROR=y> >>>> CONFIG_DEBUG_FEATURES=y> >>>> CONFIG_DEBUG_FS=y> >>>> CONFIG_DEBUG_FS_ERROR=y> >>>> CONFIG_DEBUG_FS_WARN=y> >>>> CONFIG_DEBUG_FULLOPT=y> >>>> CONFIG_DEBUG_HARDFAULT_ALERT=y> >>>> CONFIG_DEBUG_INFO=y> >>>> CONFIG_DEBUG_NET=y> >>>> CONFIG_DEBUG_NET_ERROR=y> >>>> CONFIG_DEBUG_NET_INFO=y> >>>> CONFIG_DEBUG_NET_WARN=y> >>>> CONFIG_DEBUG_RTC=y> >>>> CONFIG_DEBUG_RTC_ERROR=y> >>>> CONFIG_DEBUG_RTC_INFO=y> >>>> CONFIG_DEBUG_RTC_WARN=y> >>>> CONFIG_DEBUG_SYMBOLS=y> >>>> CONFIG_DEBUG_WARN=y> >>>> CONFIG_DEV_GPIO=y> >>>> CONFIG_ETH0_PHY_LAN8742A=y> >>>> CONFIG_EXAMPLES_PPPD=y> >>>> CONFIG_FAT_LCNAMES=y> >>>> CONFIG_FAT_LFN=y> >>>> CONFIG_FS_FAT=y> >>>> CONFIG_FS_PROCFS=y> >>>> CONFIG_FS_SMARTFS=y> >>>> CONFIG_HAVE_CXX=y> >>>> CONFIG_HAVE_CXXINITIALIZE=y> >>>> CONFIG_HEAP_COLORATION=y> >>>> CONFIG_IDLETHREAD_STACKSIZE=2048> >>>> CONFIG_INTELHEX_BINARY=y> >>>> CONFIG_IOEXPANDER=y> >>>> CONFIG_LIB_HOSTNAME="STM32F4-Discovery"> >>>> CONFIG_MAX_TASKS=16> >>>> CONFIG_MMCSD=y> >>>> CONFIG_MMCSD_MULTIBLOCK_DISABLE=y> >>>> CONFIG_MMCSD_SDIO=y> >>>> CONFIG_MTD=y> >>>> CONFIG_MTD_MX25L=y> >>>> CONFIG_MTD_SMART=y> >>>> CONFIG_MTD_SMART_FSCK=y> >>>> CONFIG_MX25L_SPIFREQUENCY=21000000> >>>> CONFIG_NET=y> >>>> CONFIG_NETDB_DNSCLIENT=y> >>>> CONFIG_NETINIT_DEBUG=y> >>>> CONFIG_NETINIT_DHCPC=y> >>>> CONFIG_NETINIT_DNS=y> >>>> CONFIG_NETINIT_DNSIPADDR=0x08080808> >>>> CONFIG_NETINIT_DRIPADDR=0x0a010101> >>>> CONFIG_NETINIT_NOMAC=y> >>>> CONFIG_NETINIT_THREAD=y> >>>> CONFIG_NETUTILS_DHCPC=y> >>>> CONFIG_NETUTILS_NETCAT=y> >>>> CONFIG_NETUTILS_PPPD_PAP=y> >>>> CONFIG_NET_ARP_DUMP=y> >>>> CONFIG_NET_ARP_SEND=y> >>>> CONFIG_NET_BROADCAST=y> >>>> CONFIG_NET_ETH_PKTSIZE=1294> >>>> CONFIG_NET_ICMP=y> >>>> CONFIG_NET_ICMP_SOCKET=y> >>>> CONFIG_NET_SOCKOPTS=y> >>>> CONFIG_NET_SOLINGER=y> >>>> CONFIG_NET_STATISTICS=y> >>>> CONFIG_NET_TCP=y> >>>> CONFIG_NET_TCPBACKLOG=y> >>>> CONFIG_NET_TCPURGDATA=y> >>>> CONFIG_NET_TCP_KEEPALIVE=y> >>>> CONFIG_NET_TCP_WRITE_BUFFERS=y> >>>> CONFIG_NET_UDP=y> >>>> CONFIG_NET_UDP_CHECKSUMS=y> >>>> CONFIG_NFILE_DESCRIPTORS=8> >>>> CONFIG_NSH_ARCHINIT=y> >>>> CONFIG_NSH_BUILTIN_APPS=y> >>>> CONFIG_NSH_DISABLE_LOSMART=y> >>>> CONFIG_NSH_FILEIOSIZE=512> >>>> CONFIG_NSH_LINELEN=64> >>>> CONFIG_NSH_PROMPT_STRING="nsh$ "> >>>> CONFIG_NSH_READLINE=y> >>>> CONFIG_PREALLOC_TIMERS=4> >>>> CONFIG_RAM_SIZE=114688> >>>> CONFIG_RAM_START=0x20000000> >>>> CONFIG_RAW_BINARY=y> >>>> CONFIG_RR_INTERVAL=200> >>>> CONFIG_RTC=y> >>>> CONFIG_RTC_EXTERNAL=y> >>>> CONFIG_RTC_PCF8563=y> >>>> CONFIG_SCHED_HPWORK=y> >>>> CONFIG_SCHED_HPWORKPRIORITY=192> >>>> CONFIG_SCHED_WAITPID=y> >>>> CONFIG_SDCLONE_DISABLE=y> >>>> CONFIG_STACK_COLORATION=y> >>>> CONFIG_START_DAY=13> >>>> CONFIG_START_MONTH=9> >>>> CONFIG_START_YEAR=2014> >>>> CONFIG_STM32F4DISBB=y> >>>> CONFIG_STM32_ADC1=y> >>>> CONFIG_STM32_DMA1=y> >>>> CONFIG_STM32_DMA2=y> >>>> CONFIG_STM32_DMACAPABLE=y> >>>> CONFIG_STM32_ETHMAC=y> >>>> CONFIG_STM32_I2C1=y> >>>> CONFIG_STM32_JTAG_SW_ENABLE=y> >>>> CONFIG_STM32_OTGFS=y> >>>> CONFIG_STM32_PHYADDR=0> >>>> CONFIG_STM32_PHYSR=31> >>>> CONFIG_STM32_PHYSR_100FD=0x0018> >>>> CONFIG_STM32_PHYSR_100HD=0x0008> >>>> CONFIG_STM32_PHYSR_10FD=0x0014> >>>> CONFIG_STM32_PHYSR_10HD=0x0004> >>>> CONFIG_STM32_PHYSR_ALTCONFIG=y> >>>> CONFIG_STM32_PHYSR_ALTMODE=0x001c> >>>> CONFIG_STM32_PWR=y> >>>> CONFIG_STM32_RMII_EXTCLK=y> >>>> CONFIG_STM32_SDIO=y> >>>> CONFIG_STM32_SPI1=y> >>>> CONFIG_STM32_USART1=y> >>>> CONFIG_STM32_USART2=y> >>>> CONFIG_STM32_USART3=y> >>>> CONFIG_STM32_USART6=y> >>>> CONFIG_SYSTEM_NSH=y> >>>> CONFIG_SYSTEM_PING=y> >>>> CONFIG_USART2_IFLOWCONTROL=y> >>>> CONFIG_USART2_OFLOWCONTROL=y> >>>> CONFIG_USART3_RS485=y> >>>> CONFIG_USART6_RXBUFSIZE=64> >>>> CONFIG_USART6_TXBUFSIZE=64> >>>> CONFIG_USBDEV=y> >>>> CONFIG_USER_ENTRYPOINT="nsh_main"> >>>>> >>>> I believe that there is something missing or wrong in my> >>>> configuration, but I couldn't find what it is.> >>>>> >>>> Can anybody give me some advice on how to solve this issue?> >>>>> >>>> Best regards,> >>>>> >>>> Flavio> >>>>> >>>>> >>>> --> >>>> Flavio de Castro Alves Filho> >>>>> >>>> flavio.alves@gmail.com> >>>> Twitter: http://twitter.com/#!/fraviofii> >>>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves> >>>> >>>> >>> --> >>> Flavio de Castro Alves Filho> >>>> >>> flavio.alves@gmail.com> >>> Twitter: http://twitter.com/#!/fraviofii> >>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves> >>>> >> >>>



-- 
Flavio de Castro Alves Filho

flavio.alves@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by spudaneco <sp...@gmail.com>.
This probably explains why you get no USB log.  How could you?  It is configured to go to the console (i.e., /dev/console) but there is no console device.Sent from my Galaxy
-------- Original message --------From: Flavio Castro Alves Filho <fl...@gmail.com> Date: 1/17/21  3:50 PM  (GMT-06:00) To: dev@nuttx.apache.org Subject: Re: Problem with USB CDC initialization on board based on STM32F4DISCO Em dom, 17 de jan de 2021 13:52, Gregory Nutt <sp...@gmail.com>escreveu:> I don't think that this combination will work:>> CONFIG_CDCACM_CONSOLE=y> CONFIG_CONSOLE_SYSLOG=y>> I think that the syslog console device would have to be available at> bootup. Normally a RAM log is is used to hold syslog data if a USB> console is used.>In my case, I am following the implementation from discovery board, wheresyslog is pointing to the uart and console on the USB.I will review if it was done correctly.Thank you for your remark.Best regardsFlavio> I might be wrong about that and this should not prevent the USB device> connecting.>> On 1/17/2021 9:10 AM, Flavio Castro Alves Filho wrote:> > Thank you very much for your fast response.> >> > I checked the boot calls and they are the same, regarding USB> initialization.> >> > I compared the include/nuttx/config.h files too ... at least regarding> > USB, I couldn't see anything critical.> >> > The development approach that I am working was exactly starting with> > stm32discovery board and increasing features. Maybe I have to restart,> > checking first the USB.> >> > Best regards,> >> > Flavio> >> > Em dom., 17 de jan. de 2021 às 11:39, Grr <ge...@gmail.com> escreveu:> >> What you can do is compare .config generated from that defconfig to> .config> >> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see> >> the differences. You can also compare include/nuttx/config.h from both> >> configs> >>> >> Another approach is to start from discovery config and do the> modifications> >> for your board. After you have it working, clone the config to a> different> >> board name. With "make savedefconfig" you can save your working> defconfig> >>> >> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<> >> flavio.alves@gmail.com>) escribió:> >>> >>> As an additional information, if I load the STM32F4DISCO on my board,> USB> >>> works.> >>>> >>> Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho> >>> <fl...@gmail.com> escreveu:> >>>> Hello,> >>>>> >>>> I am working to port NuttX on a board based on STM32F4DISCOVERY. The> >>>> microcontroller is the STM32F407VET6.> >>>>> >>>> USB CDC support is not initializing.> >>>>> >>>> When I plug the USB on the board, I have the following dmesg response> in> >>> Linux:> >>>> [517062.075048] usb usb1-port2: attempt power cycle> >>>> [517062.726922] usb 1-2: new full-speed USB device number 47 using> >>> xhci_hcd> >>>> [517062.727170] usb 1-2: Device not responding to setup address.> >>>> [517062.935148] usb 1-2: Device not responding to setup address.> >>>> [517063.142906] usb 1-2: device not accepting address 47, error -71> >>>> [517063.270916] usb 1-2: new full-speed USB device number 48 using> >>> xhci_hcd> >>>> [517063.271141] usb 1-2: Device not responding to setup address.> >>>> [517063.479134] usb 1-2: Device not responding to setup address.> >>>>> >>>> When I run stm32f4discovery:usbnsh on my discovery board, it works.> >>>>> >>>> I compared the defconfig from the base project and from mine and I> >>>> believe I have initialized everything that is related to the USB.> >>>>> >>>> Here is the defconfig for my board:> >>>>> >>>> #> >>>> # 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_FPU is not set> >>>> # CONFIG_MMCSD_MMCSUPPORT is not set> >>>> # CONFIG_MMCSD_SPI is not set> >>>> # CONFIG_NSH_ARGCAT is not set> >>>> # CONFIG_NSH_CMDOPT_HEXDUMP is not set> >>>> # CONFIG_NSH_CMDPARMS is not set> >>>> CONFIG_ADC=y> >>>> CONFIG_ANALOG=y> >>>> CONFIG_ARCH="arm"> >>>> CONFIG_ARCH_BOARD="phi-innovations"> >>>> CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y> >>>> CONFIG_ARCH_CHIP="stm32"> >>>> CONFIG_ARCH_CHIP_STM32=y> >>>> CONFIG_ARCH_CHIP_STM32F407VG=y> >>>> CONFIG_ARCH_STACKDUMP=y> >>>> CONFIG_ARMV7M_MEMCPY=y> >>>> CONFIG_BOARDCTL_RESET=y> >>>> CONFIG_BOARDCTL_UNIQUEID=y> >>>> CONFIG_BOARDCTL_USBDEVCTRL=y> >>>> CONFIG_BOARD_LOOPSPERMSEC=16717> >>>> CONFIG_BUILTIN=y> >>>> CONFIG_CDCACM=y> >>>> CONFIG_CDCACM_CONSOLE=y> >>>> CONFIG_CDCACM_RXBUFSIZE=256> >>>> CONFIG_CDCACM_TXBUFSIZE=256> >>>> CONFIG_CLOCK_MONOTONIC=y> >>>> CONFIG_CONSOLE_SYSLOG=y> >>>> CONFIG_DEBUG_ASSERTIONS=y> >>>> CONFIG_DEBUG_DMA=y> >>>> CONFIG_DEBUG_DMA_ERROR=y> >>>> CONFIG_DEBUG_DMA_INFO=y> >>>> CONFIG_DEBUG_DMA_WARN=y> >>>> CONFIG_DEBUG_ERROR=y> >>>> CONFIG_DEBUG_FEATURES=y> >>>> CONFIG_DEBUG_FS=y> >>>> CONFIG_DEBUG_FS_ERROR=y> >>>> CONFIG_DEBUG_FS_WARN=y> >>>> CONFIG_DEBUG_FULLOPT=y> >>>> CONFIG_DEBUG_HARDFAULT_ALERT=y> >>>> CONFIG_DEBUG_INFO=y> >>>> CONFIG_DEBUG_NET=y> >>>> CONFIG_DEBUG_NET_ERROR=y> >>>> CONFIG_DEBUG_NET_INFO=y> >>>> CONFIG_DEBUG_NET_WARN=y> >>>> CONFIG_DEBUG_RTC=y> >>>> CONFIG_DEBUG_RTC_ERROR=y> >>>> CONFIG_DEBUG_RTC_INFO=y> >>>> CONFIG_DEBUG_RTC_WARN=y> >>>> CONFIG_DEBUG_SYMBOLS=y> >>>> CONFIG_DEBUG_WARN=y> >>>> CONFIG_DEV_GPIO=y> >>>> CONFIG_ETH0_PHY_LAN8742A=y> >>>> CONFIG_EXAMPLES_PPPD=y> >>>> CONFIG_FAT_LCNAMES=y> >>>> CONFIG_FAT_LFN=y> >>>> CONFIG_FS_FAT=y> >>>> CONFIG_FS_PROCFS=y> >>>> CONFIG_FS_SMARTFS=y> >>>> CONFIG_HAVE_CXX=y> >>>> CONFIG_HAVE_CXXINITIALIZE=y> >>>> CONFIG_HEAP_COLORATION=y> >>>> CONFIG_IDLETHREAD_STACKSIZE=2048> >>>> CONFIG_INTELHEX_BINARY=y> >>>> CONFIG_IOEXPANDER=y> >>>> CONFIG_LIB_HOSTNAME="STM32F4-Discovery"> >>>> CONFIG_MAX_TASKS=16> >>>> CONFIG_MMCSD=y> >>>> CONFIG_MMCSD_MULTIBLOCK_DISABLE=y> >>>> CONFIG_MMCSD_SDIO=y> >>>> CONFIG_MTD=y> >>>> CONFIG_MTD_MX25L=y> >>>> CONFIG_MTD_SMART=y> >>>> CONFIG_MTD_SMART_FSCK=y> >>>> CONFIG_MX25L_SPIFREQUENCY=21000000> >>>> CONFIG_NET=y> >>>> CONFIG_NETDB_DNSCLIENT=y> >>>> CONFIG_NETINIT_DEBUG=y> >>>> CONFIG_NETINIT_DHCPC=y> >>>> CONFIG_NETINIT_DNS=y> >>>> CONFIG_NETINIT_DNSIPADDR=0x08080808> >>>> CONFIG_NETINIT_DRIPADDR=0x0a010101> >>>> CONFIG_NETINIT_NOMAC=y> >>>> CONFIG_NETINIT_THREAD=y> >>>> CONFIG_NETUTILS_DHCPC=y> >>>> CONFIG_NETUTILS_NETCAT=y> >>>> CONFIG_NETUTILS_PPPD_PAP=y> >>>> CONFIG_NET_ARP_DUMP=y> >>>> CONFIG_NET_ARP_SEND=y> >>>> CONFIG_NET_BROADCAST=y> >>>> CONFIG_NET_ETH_PKTSIZE=1294> >>>> CONFIG_NET_ICMP=y> >>>> CONFIG_NET_ICMP_SOCKET=y> >>>> CONFIG_NET_SOCKOPTS=y> >>>> CONFIG_NET_SOLINGER=y> >>>> CONFIG_NET_STATISTICS=y> >>>> CONFIG_NET_TCP=y> >>>> CONFIG_NET_TCPBACKLOG=y> >>>> CONFIG_NET_TCPURGDATA=y> >>>> CONFIG_NET_TCP_KEEPALIVE=y> >>>> CONFIG_NET_TCP_WRITE_BUFFERS=y> >>>> CONFIG_NET_UDP=y> >>>> CONFIG_NET_UDP_CHECKSUMS=y> >>>> CONFIG_NFILE_DESCRIPTORS=8> >>>> CONFIG_NSH_ARCHINIT=y> >>>> CONFIG_NSH_BUILTIN_APPS=y> >>>> CONFIG_NSH_DISABLE_LOSMART=y> >>>> CONFIG_NSH_FILEIOSIZE=512> >>>> CONFIG_NSH_LINELEN=64> >>>> CONFIG_NSH_PROMPT_STRING="nsh$ "> >>>> CONFIG_NSH_READLINE=y> >>>> CONFIG_PREALLOC_TIMERS=4> >>>> CONFIG_RAM_SIZE=114688> >>>> CONFIG_RAM_START=0x20000000> >>>> CONFIG_RAW_BINARY=y> >>>> CONFIG_RR_INTERVAL=200> >>>> CONFIG_RTC=y> >>>> CONFIG_RTC_EXTERNAL=y> >>>> CONFIG_RTC_PCF8563=y> >>>> CONFIG_SCHED_HPWORK=y> >>>> CONFIG_SCHED_HPWORKPRIORITY=192> >>>> CONFIG_SCHED_WAITPID=y> >>>> CONFIG_SDCLONE_DISABLE=y> >>>> CONFIG_STACK_COLORATION=y> >>>> CONFIG_START_DAY=13> >>>> CONFIG_START_MONTH=9> >>>> CONFIG_START_YEAR=2014> >>>> CONFIG_STM32F4DISBB=y> >>>> CONFIG_STM32_ADC1=y> >>>> CONFIG_STM32_DMA1=y> >>>> CONFIG_STM32_DMA2=y> >>>> CONFIG_STM32_DMACAPABLE=y> >>>> CONFIG_STM32_ETHMAC=y> >>>> CONFIG_STM32_I2C1=y> >>>> CONFIG_STM32_JTAG_SW_ENABLE=y> >>>> CONFIG_STM32_OTGFS=y> >>>> CONFIG_STM32_PHYADDR=0> >>>> CONFIG_STM32_PHYSR=31> >>>> CONFIG_STM32_PHYSR_100FD=0x0018> >>>> CONFIG_STM32_PHYSR_100HD=0x0008> >>>> CONFIG_STM32_PHYSR_10FD=0x0014> >>>> CONFIG_STM32_PHYSR_10HD=0x0004> >>>> CONFIG_STM32_PHYSR_ALTCONFIG=y> >>>> CONFIG_STM32_PHYSR_ALTMODE=0x001c> >>>> CONFIG_STM32_PWR=y> >>>> CONFIG_STM32_RMII_EXTCLK=y> >>>> CONFIG_STM32_SDIO=y> >>>> CONFIG_STM32_SPI1=y> >>>> CONFIG_STM32_USART1=y> >>>> CONFIG_STM32_USART2=y> >>>> CONFIG_STM32_USART3=y> >>>> CONFIG_STM32_USART6=y> >>>> CONFIG_SYSTEM_NSH=y> >>>> CONFIG_SYSTEM_PING=y> >>>> CONFIG_USART2_IFLOWCONTROL=y> >>>> CONFIG_USART2_OFLOWCONTROL=y> >>>> CONFIG_USART3_RS485=y> >>>> CONFIG_USART6_RXBUFSIZE=64> >>>> CONFIG_USART6_TXBUFSIZE=64> >>>> CONFIG_USBDEV=y> >>>> CONFIG_USER_ENTRYPOINT="nsh_main"> >>>>> >>>> I believe that there is something missing or wrong in my> >>>> configuration, but I couldn't find what it is.> >>>>> >>>> Can anybody give me some advice on how to solve this issue?> >>>>> >>>> Best regards,> >>>>> >>>> Flavio> >>>>> >>>>> >>>> --> >>>> Flavio de Castro Alves Filho> >>>>> >>>> flavio.alves@gmail.com> >>>> Twitter: http://twitter.com/#!/fraviofii> >>>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves> >>>> >>>> >>> --> >>> Flavio de Castro Alves Filho> >>>> >>> flavio.alves@gmail.com> >>> Twitter: http://twitter.com/#!/fraviofii> >>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves> >>>> >> >>>

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Flavio Castro Alves Filho <fl...@gmail.com>.
Em dom, 17 de jan de 2021 13:52, Gregory Nutt <sp...@gmail.com>
escreveu:

> I don't think that this combination will work:
>
> CONFIG_CDCACM_CONSOLE=y
> CONFIG_CONSOLE_SYSLOG=y
>
> I think that the syslog console device would have to be available at
> bootup. Normally a RAM log is is used to hold syslog data if a USB
> console is used.
>

In my case, I am following the implementation from discovery board, where
syslog is pointing to the uart and console on the USB.

I will review if it was done correctly.

Thank you for your remark.

Best regards

Flavio


> I might be wrong about that and this should not prevent the USB device
> connecting.
>
> On 1/17/2021 9:10 AM, Flavio Castro Alves Filho wrote:
> > Thank you very much for your fast response.
> >
> > I checked the boot calls and they are the same, regarding USB
> initialization.
> >
> > I compared the include/nuttx/config.h files too ... at least regarding
> > USB, I couldn't see anything critical.
> >
> > The development approach that I am working was exactly starting with
> > stm32discovery board and increasing features. Maybe I have to restart,
> > checking first the USB.
> >
> > Best regards,
> >
> > Flavio
> >
> > Em dom., 17 de jan. de 2021 às 11:39, Grr <ge...@gmail.com> escreveu:
> >> What you can do is compare .config generated from that defconfig to
> .config
> >> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
> >> the differences. You can also compare include/nuttx/config.h from both
> >> configs
> >>
> >> Another approach is to start from discovery config and do the
> modifications
> >> for your board. After you have it working, clone the config to a
> different
> >> board name. With "make savedefconfig" you can save your working
> defconfig
> >>
> >> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
> >> flavio.alves@gmail.com>) escribió:
> >>
> >>> As an additional information, if I load the STM32F4DISCO on my board,
> USB
> >>> works.
> >>>
> >>> Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
> >>> <fl...@gmail.com> escreveu:
> >>>> Hello,
> >>>>
> >>>> I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> >>>> microcontroller is the STM32F407VET6.
> >>>>
> >>>> USB CDC support is not initializing.
> >>>>
> >>>> When I plug the USB on the board, I have the following dmesg response
> in
> >>> Linux:
> >>>> [517062.075048] usb usb1-port2: attempt power cycle
> >>>> [517062.726922] usb 1-2: new full-speed USB device number 47 using
> >>> xhci_hcd
> >>>> [517062.727170] usb 1-2: Device not responding to setup address.
> >>>> [517062.935148] usb 1-2: Device not responding to setup address.
> >>>> [517063.142906] usb 1-2: device not accepting address 47, error -71
> >>>> [517063.270916] usb 1-2: new full-speed USB device number 48 using
> >>> xhci_hcd
> >>>> [517063.271141] usb 1-2: Device not responding to setup address.
> >>>> [517063.479134] usb 1-2: Device not responding to setup address.
> >>>>
> >>>> When I run stm32f4discovery:usbnsh on my discovery board, it works.
> >>>>
> >>>> I compared the defconfig from the base project and from mine and I
> >>>> believe I have initialized everything that is related to the USB.
> >>>>
> >>>> Here is the defconfig for my board:
> >>>>
> >>>> #
> >>>> # 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_FPU is not set
> >>>> # CONFIG_MMCSD_MMCSUPPORT is not set
> >>>> # CONFIG_MMCSD_SPI is not set
> >>>> # CONFIG_NSH_ARGCAT is not set
> >>>> # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> >>>> # CONFIG_NSH_CMDPARMS is not set
> >>>> CONFIG_ADC=y
> >>>> CONFIG_ANALOG=y
> >>>> CONFIG_ARCH="arm"
> >>>> CONFIG_ARCH_BOARD="phi-innovations"
> >>>> CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
> >>>> CONFIG_ARCH_CHIP="stm32"
> >>>> CONFIG_ARCH_CHIP_STM32=y
> >>>> CONFIG_ARCH_CHIP_STM32F407VG=y
> >>>> CONFIG_ARCH_STACKDUMP=y
> >>>> CONFIG_ARMV7M_MEMCPY=y
> >>>> CONFIG_BOARDCTL_RESET=y
> >>>> CONFIG_BOARDCTL_UNIQUEID=y
> >>>> CONFIG_BOARDCTL_USBDEVCTRL=y
> >>>> CONFIG_BOARD_LOOPSPERMSEC=16717
> >>>> CONFIG_BUILTIN=y
> >>>> CONFIG_CDCACM=y
> >>>> CONFIG_CDCACM_CONSOLE=y
> >>>> CONFIG_CDCACM_RXBUFSIZE=256
> >>>> CONFIG_CDCACM_TXBUFSIZE=256
> >>>> CONFIG_CLOCK_MONOTONIC=y
> >>>> CONFIG_CONSOLE_SYSLOG=y
> >>>> CONFIG_DEBUG_ASSERTIONS=y
> >>>> CONFIG_DEBUG_DMA=y
> >>>> CONFIG_DEBUG_DMA_ERROR=y
> >>>> CONFIG_DEBUG_DMA_INFO=y
> >>>> CONFIG_DEBUG_DMA_WARN=y
> >>>> CONFIG_DEBUG_ERROR=y
> >>>> CONFIG_DEBUG_FEATURES=y
> >>>> CONFIG_DEBUG_FS=y
> >>>> CONFIG_DEBUG_FS_ERROR=y
> >>>> CONFIG_DEBUG_FS_WARN=y
> >>>> CONFIG_DEBUG_FULLOPT=y
> >>>> CONFIG_DEBUG_HARDFAULT_ALERT=y
> >>>> CONFIG_DEBUG_INFO=y
> >>>> CONFIG_DEBUG_NET=y
> >>>> CONFIG_DEBUG_NET_ERROR=y
> >>>> CONFIG_DEBUG_NET_INFO=y
> >>>> CONFIG_DEBUG_NET_WARN=y
> >>>> CONFIG_DEBUG_RTC=y
> >>>> CONFIG_DEBUG_RTC_ERROR=y
> >>>> CONFIG_DEBUG_RTC_INFO=y
> >>>> CONFIG_DEBUG_RTC_WARN=y
> >>>> CONFIG_DEBUG_SYMBOLS=y
> >>>> CONFIG_DEBUG_WARN=y
> >>>> CONFIG_DEV_GPIO=y
> >>>> CONFIG_ETH0_PHY_LAN8742A=y
> >>>> CONFIG_EXAMPLES_PPPD=y
> >>>> CONFIG_FAT_LCNAMES=y
> >>>> CONFIG_FAT_LFN=y
> >>>> CONFIG_FS_FAT=y
> >>>> CONFIG_FS_PROCFS=y
> >>>> CONFIG_FS_SMARTFS=y
> >>>> CONFIG_HAVE_CXX=y
> >>>> CONFIG_HAVE_CXXINITIALIZE=y
> >>>> CONFIG_HEAP_COLORATION=y
> >>>> CONFIG_IDLETHREAD_STACKSIZE=2048
> >>>> CONFIG_INTELHEX_BINARY=y
> >>>> CONFIG_IOEXPANDER=y
> >>>> CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
> >>>> CONFIG_MAX_TASKS=16
> >>>> CONFIG_MMCSD=y
> >>>> CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
> >>>> CONFIG_MMCSD_SDIO=y
> >>>> CONFIG_MTD=y
> >>>> CONFIG_MTD_MX25L=y
> >>>> CONFIG_MTD_SMART=y
> >>>> CONFIG_MTD_SMART_FSCK=y
> >>>> CONFIG_MX25L_SPIFREQUENCY=21000000
> >>>> CONFIG_NET=y
> >>>> CONFIG_NETDB_DNSCLIENT=y
> >>>> CONFIG_NETINIT_DEBUG=y
> >>>> CONFIG_NETINIT_DHCPC=y
> >>>> CONFIG_NETINIT_DNS=y
> >>>> CONFIG_NETINIT_DNSIPADDR=0x08080808
> >>>> CONFIG_NETINIT_DRIPADDR=0x0a010101
> >>>> CONFIG_NETINIT_NOMAC=y
> >>>> CONFIG_NETINIT_THREAD=y
> >>>> CONFIG_NETUTILS_DHCPC=y
> >>>> CONFIG_NETUTILS_NETCAT=y
> >>>> CONFIG_NETUTILS_PPPD_PAP=y
> >>>> CONFIG_NET_ARP_DUMP=y
> >>>> CONFIG_NET_ARP_SEND=y
> >>>> CONFIG_NET_BROADCAST=y
> >>>> CONFIG_NET_ETH_PKTSIZE=1294
> >>>> CONFIG_NET_ICMP=y
> >>>> CONFIG_NET_ICMP_SOCKET=y
> >>>> CONFIG_NET_SOCKOPTS=y
> >>>> CONFIG_NET_SOLINGER=y
> >>>> CONFIG_NET_STATISTICS=y
> >>>> CONFIG_NET_TCP=y
> >>>> CONFIG_NET_TCPBACKLOG=y
> >>>> CONFIG_NET_TCPURGDATA=y
> >>>> CONFIG_NET_TCP_KEEPALIVE=y
> >>>> CONFIG_NET_TCP_WRITE_BUFFERS=y
> >>>> CONFIG_NET_UDP=y
> >>>> CONFIG_NET_UDP_CHECKSUMS=y
> >>>> CONFIG_NFILE_DESCRIPTORS=8
> >>>> CONFIG_NSH_ARCHINIT=y
> >>>> CONFIG_NSH_BUILTIN_APPS=y
> >>>> CONFIG_NSH_DISABLE_LOSMART=y
> >>>> CONFIG_NSH_FILEIOSIZE=512
> >>>> CONFIG_NSH_LINELEN=64
> >>>> CONFIG_NSH_PROMPT_STRING="nsh$ "
> >>>> CONFIG_NSH_READLINE=y
> >>>> CONFIG_PREALLOC_TIMERS=4
> >>>> CONFIG_RAM_SIZE=114688
> >>>> CONFIG_RAM_START=0x20000000
> >>>> CONFIG_RAW_BINARY=y
> >>>> CONFIG_RR_INTERVAL=200
> >>>> CONFIG_RTC=y
> >>>> CONFIG_RTC_EXTERNAL=y
> >>>> CONFIG_RTC_PCF8563=y
> >>>> CONFIG_SCHED_HPWORK=y
> >>>> CONFIG_SCHED_HPWORKPRIORITY=192
> >>>> CONFIG_SCHED_WAITPID=y
> >>>> CONFIG_SDCLONE_DISABLE=y
> >>>> CONFIG_STACK_COLORATION=y
> >>>> CONFIG_START_DAY=13
> >>>> CONFIG_START_MONTH=9
> >>>> CONFIG_START_YEAR=2014
> >>>> CONFIG_STM32F4DISBB=y
> >>>> CONFIG_STM32_ADC1=y
> >>>> CONFIG_STM32_DMA1=y
> >>>> CONFIG_STM32_DMA2=y
> >>>> CONFIG_STM32_DMACAPABLE=y
> >>>> CONFIG_STM32_ETHMAC=y
> >>>> CONFIG_STM32_I2C1=y
> >>>> CONFIG_STM32_JTAG_SW_ENABLE=y
> >>>> CONFIG_STM32_OTGFS=y
> >>>> CONFIG_STM32_PHYADDR=0
> >>>> CONFIG_STM32_PHYSR=31
> >>>> CONFIG_STM32_PHYSR_100FD=0x0018
> >>>> CONFIG_STM32_PHYSR_100HD=0x0008
> >>>> CONFIG_STM32_PHYSR_10FD=0x0014
> >>>> CONFIG_STM32_PHYSR_10HD=0x0004
> >>>> CONFIG_STM32_PHYSR_ALTCONFIG=y
> >>>> CONFIG_STM32_PHYSR_ALTMODE=0x001c
> >>>> CONFIG_STM32_PWR=y
> >>>> CONFIG_STM32_RMII_EXTCLK=y
> >>>> CONFIG_STM32_SDIO=y
> >>>> CONFIG_STM32_SPI1=y
> >>>> CONFIG_STM32_USART1=y
> >>>> CONFIG_STM32_USART2=y
> >>>> CONFIG_STM32_USART3=y
> >>>> CONFIG_STM32_USART6=y
> >>>> CONFIG_SYSTEM_NSH=y
> >>>> CONFIG_SYSTEM_PING=y
> >>>> CONFIG_USART2_IFLOWCONTROL=y
> >>>> CONFIG_USART2_OFLOWCONTROL=y
> >>>> CONFIG_USART3_RS485=y
> >>>> CONFIG_USART6_RXBUFSIZE=64
> >>>> CONFIG_USART6_TXBUFSIZE=64
> >>>> CONFIG_USBDEV=y
> >>>> CONFIG_USER_ENTRYPOINT="nsh_main"
> >>>>
> >>>> I believe that there is something missing or wrong in my
> >>>> configuration, but I couldn't find what it is.
> >>>>
> >>>> Can anybody give me some advice on how to solve this issue?
> >>>>
> >>>> Best regards,
> >>>>
> >>>> Flavio
> >>>>
> >>>>
> >>>> --
> >>>> Flavio de Castro Alves Filho
> >>>>
> >>>> flavio.alves@gmail.com
> >>>> Twitter: http://twitter.com/#!/fraviofii
> >>>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >>>
> >>>
> >>> --
> >>> Flavio de Castro Alves Filho
> >>>
> >>> flavio.alves@gmail.com
> >>> Twitter: http://twitter.com/#!/fraviofii
> >>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >>>
> >
> >
>
>

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Flavio Castro Alves Filho <fl...@gmail.com>.
Thank you,

I will look into it.

But now I found the cause of my problem: there is a conflict between
USB and USART3.

In my specific case, I intend to use USART3 as RS-485.

When I enable USART3, USB stops.

I checked the pins and everything is fine.

In addition, some leds (which I have set but not tested yet) turn on
and blink. I have no idea about what it could be.

Could you give me some insight about this usb-uart3 issue?

Best regards,

Flavio

Em seg., 18 de jan. de 2021 às 19:03, Gregory Nutt
<sp...@gmail.com> escreveu:
>
> Often, a RAM log is used with a USB console.  But a serial port works
> too.  There are many examples.  See
>
> $ find boards/ -name defconfig | xargs grep -l CDCACM_CONSOLE | xargs
> grep SYSLOG_DEVPATH
>
> On 1/18/2021 3:49 PM, Flavio Castro Alves Filho wrote:
> > Hello,
> >
> > Confirming: it is not working.
> >
> > I tried to see the syslog messages on an UART port while using
> > nutshell on usb but it didn't work.
> >
> > Best regards,
> >
> > Flavio
> >
> > Em dom., 17 de jan. de 2021 às 13:52, Gregory Nutt
> > <sp...@gmail.com> escreveu:
> >> I don't think that this combination will work:
> >>
> >> CONFIG_CDCACM_CONSOLE=y
> >> CONFIG_CONSOLE_SYSLOG=y
> >>
> >> I think that the syslog console device would have to be available at
> >> bootup. Normally a RAM log is is used to hold syslog data if a USB
> >> console is used.
> >>
> >> I might be wrong about that and this should not prevent the USB device
> >> connecting.
> >>
> >> On 1/17/2021 9:10 AM, Flavio Castro Alves Filho wrote:
> >>> Thank you very much for your fast response.
> >>>
> >>> I checked the boot calls and they are the same, regarding USB initialization.
> >>>
> >>> I compared the include/nuttx/config.h files too ... at least regarding
> >>> USB, I couldn't see anything critical.
> >>>
> >>> The development approach that I am working was exactly starting with
> >>> stm32discovery board and increasing features. Maybe I have to restart,
> >>> checking first the USB.
> >>>
> >>> Best regards,
> >>>
> >>> Flavio
> >>>
> >>> Em dom., 17 de jan. de 2021 às 11:39, Grr <ge...@gmail.com> escreveu:
> >>>> What you can do is compare .config generated from that defconfig to .config
> >>>> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
> >>>> the differences. You can also compare include/nuttx/config.h from both
> >>>> configs
> >>>>
> >>>> Another approach is to start from discovery config and do the modifications
> >>>> for your board. After you have it working, clone the config to a different
> >>>> board name. With "make savedefconfig" you can save your working defconfig
> >>>>
> >>>> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
> >>>> flavio.alves@gmail.com>) escribió:
> >>>>
> >>>>> As an additional information, if I load the STM32F4DISCO on my board, USB
> >>>>> works.
> >>>>>
> >>>>> Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
> >>>>> <fl...@gmail.com> escreveu:
> >>>>>> Hello,
> >>>>>>
> >>>>>> I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> >>>>>> microcontroller is the STM32F407VET6.
> >>>>>>
> >>>>>> USB CDC support is not initializing.
> >>>>>>
> >>>>>> When I plug the USB on the board, I have the following dmesg response in
> >>>>> Linux:
> >>>>>> [517062.075048] usb usb1-port2: attempt power cycle
> >>>>>> [517062.726922] usb 1-2: new full-speed USB device number 47 using
> >>>>> xhci_hcd
> >>>>>> [517062.727170] usb 1-2: Device not responding to setup address.
> >>>>>> [517062.935148] usb 1-2: Device not responding to setup address.
> >>>>>> [517063.142906] usb 1-2: device not accepting address 47, error -71
> >>>>>> [517063.270916] usb 1-2: new full-speed USB device number 48 using
> >>>>> xhci_hcd
> >>>>>> [517063.271141] usb 1-2: Device not responding to setup address.
> >>>>>> [517063.479134] usb 1-2: Device not responding to setup address.
> >>>>>>
> >>>>>> When I run stm32f4discovery:usbnsh on my discovery board, it works.
> >>>>>>
> >>>>>> I compared the defconfig from the base project and from mine and I
> >>>>>> believe I have initialized everything that is related to the USB.
> >>>>>>
> >>>>>> Here is the defconfig for my board:
> >>>>>>
> >>>>>> #
> >>>>>> # 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_FPU is not set
> >>>>>> # CONFIG_MMCSD_MMCSUPPORT is not set
> >>>>>> # CONFIG_MMCSD_SPI is not set
> >>>>>> # CONFIG_NSH_ARGCAT is not set
> >>>>>> # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> >>>>>> # CONFIG_NSH_CMDPARMS is not set
> >>>>>> CONFIG_ADC=y
> >>>>>> CONFIG_ANALOG=y
> >>>>>> CONFIG_ARCH="arm"
> >>>>>> CONFIG_ARCH_BOARD="phi-innovations"
> >>>>>> CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
> >>>>>> CONFIG_ARCH_CHIP="stm32"
> >>>>>> CONFIG_ARCH_CHIP_STM32=y
> >>>>>> CONFIG_ARCH_CHIP_STM32F407VG=y
> >>>>>> CONFIG_ARCH_STACKDUMP=y
> >>>>>> CONFIG_ARMV7M_MEMCPY=y
> >>>>>> CONFIG_BOARDCTL_RESET=y
> >>>>>> CONFIG_BOARDCTL_UNIQUEID=y
> >>>>>> CONFIG_BOARDCTL_USBDEVCTRL=y
> >>>>>> CONFIG_BOARD_LOOPSPERMSEC=16717
> >>>>>> CONFIG_BUILTIN=y
> >>>>>> CONFIG_CDCACM=y
> >>>>>> CONFIG_CDCACM_CONSOLE=y
> >>>>>> CONFIG_CDCACM_RXBUFSIZE=256
> >>>>>> CONFIG_CDCACM_TXBUFSIZE=256
> >>>>>> CONFIG_CLOCK_MONOTONIC=y
> >>>>>> CONFIG_CONSOLE_SYSLOG=y
> >>>>>> CONFIG_DEBUG_ASSERTIONS=y
> >>>>>> CONFIG_DEBUG_DMA=y
> >>>>>> CONFIG_DEBUG_DMA_ERROR=y
> >>>>>> CONFIG_DEBUG_DMA_INFO=y
> >>>>>> CONFIG_DEBUG_DMA_WARN=y
> >>>>>> CONFIG_DEBUG_ERROR=y
> >>>>>> CONFIG_DEBUG_FEATURES=y
> >>>>>> CONFIG_DEBUG_FS=y
> >>>>>> CONFIG_DEBUG_FS_ERROR=y
> >>>>>> CONFIG_DEBUG_FS_WARN=y
> >>>>>> CONFIG_DEBUG_FULLOPT=y
> >>>>>> CONFIG_DEBUG_HARDFAULT_ALERT=y
> >>>>>> CONFIG_DEBUG_INFO=y
> >>>>>> CONFIG_DEBUG_NET=y
> >>>>>> CONFIG_DEBUG_NET_ERROR=y
> >>>>>> CONFIG_DEBUG_NET_INFO=y
> >>>>>> CONFIG_DEBUG_NET_WARN=y
> >>>>>> CONFIG_DEBUG_RTC=y
> >>>>>> CONFIG_DEBUG_RTC_ERROR=y
> >>>>>> CONFIG_DEBUG_RTC_INFO=y
> >>>>>> CONFIG_DEBUG_RTC_WARN=y
> >>>>>> CONFIG_DEBUG_SYMBOLS=y
> >>>>>> CONFIG_DEBUG_WARN=y
> >>>>>> CONFIG_DEV_GPIO=y
> >>>>>> CONFIG_ETH0_PHY_LAN8742A=y
> >>>>>> CONFIG_EXAMPLES_PPPD=y
> >>>>>> CONFIG_FAT_LCNAMES=y
> >>>>>> CONFIG_FAT_LFN=y
> >>>>>> CONFIG_FS_FAT=y
> >>>>>> CONFIG_FS_PROCFS=y
> >>>>>> CONFIG_FS_SMARTFS=y
> >>>>>> CONFIG_HAVE_CXX=y
> >>>>>> CONFIG_HAVE_CXXINITIALIZE=y
> >>>>>> CONFIG_HEAP_COLORATION=y
> >>>>>> CONFIG_IDLETHREAD_STACKSIZE=2048
> >>>>>> CONFIG_INTELHEX_BINARY=y
> >>>>>> CONFIG_IOEXPANDER=y
> >>>>>> CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
> >>>>>> CONFIG_MAX_TASKS=16
> >>>>>> CONFIG_MMCSD=y
> >>>>>> CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
> >>>>>> CONFIG_MMCSD_SDIO=y
> >>>>>> CONFIG_MTD=y
> >>>>>> CONFIG_MTD_MX25L=y
> >>>>>> CONFIG_MTD_SMART=y
> >>>>>> CONFIG_MTD_SMART_FSCK=y
> >>>>>> CONFIG_MX25L_SPIFREQUENCY=21000000
> >>>>>> CONFIG_NET=y
> >>>>>> CONFIG_NETDB_DNSCLIENT=y
> >>>>>> CONFIG_NETINIT_DEBUG=y
> >>>>>> CONFIG_NETINIT_DHCPC=y
> >>>>>> CONFIG_NETINIT_DNS=y
> >>>>>> CONFIG_NETINIT_DNSIPADDR=0x08080808
> >>>>>> CONFIG_NETINIT_DRIPADDR=0x0a010101
> >>>>>> CONFIG_NETINIT_NOMAC=y
> >>>>>> CONFIG_NETINIT_THREAD=y
> >>>>>> CONFIG_NETUTILS_DHCPC=y
> >>>>>> CONFIG_NETUTILS_NETCAT=y
> >>>>>> CONFIG_NETUTILS_PPPD_PAP=y
> >>>>>> CONFIG_NET_ARP_DUMP=y
> >>>>>> CONFIG_NET_ARP_SEND=y
> >>>>>> CONFIG_NET_BROADCAST=y
> >>>>>> CONFIG_NET_ETH_PKTSIZE=1294
> >>>>>> CONFIG_NET_ICMP=y
> >>>>>> CONFIG_NET_ICMP_SOCKET=y
> >>>>>> CONFIG_NET_SOCKOPTS=y
> >>>>>> CONFIG_NET_SOLINGER=y
> >>>>>> CONFIG_NET_STATISTICS=y
> >>>>>> CONFIG_NET_TCP=y
> >>>>>> CONFIG_NET_TCPBACKLOG=y
> >>>>>> CONFIG_NET_TCPURGDATA=y
> >>>>>> CONFIG_NET_TCP_KEEPALIVE=y
> >>>>>> CONFIG_NET_TCP_WRITE_BUFFERS=y
> >>>>>> CONFIG_NET_UDP=y
> >>>>>> CONFIG_NET_UDP_CHECKSUMS=y
> >>>>>> CONFIG_NFILE_DESCRIPTORS=8
> >>>>>> CONFIG_NSH_ARCHINIT=y
> >>>>>> CONFIG_NSH_BUILTIN_APPS=y
> >>>>>> CONFIG_NSH_DISABLE_LOSMART=y
> >>>>>> CONFIG_NSH_FILEIOSIZE=512
> >>>>>> CONFIG_NSH_LINELEN=64
> >>>>>> CONFIG_NSH_PROMPT_STRING="nsh$ "
> >>>>>> CONFIG_NSH_READLINE=y
> >>>>>> CONFIG_PREALLOC_TIMERS=4
> >>>>>> CONFIG_RAM_SIZE=114688
> >>>>>> CONFIG_RAM_START=0x20000000
> >>>>>> CONFIG_RAW_BINARY=y
> >>>>>> CONFIG_RR_INTERVAL=200
> >>>>>> CONFIG_RTC=y
> >>>>>> CONFIG_RTC_EXTERNAL=y
> >>>>>> CONFIG_RTC_PCF8563=y
> >>>>>> CONFIG_SCHED_HPWORK=y
> >>>>>> CONFIG_SCHED_HPWORKPRIORITY=192
> >>>>>> CONFIG_SCHED_WAITPID=y
> >>>>>> CONFIG_SDCLONE_DISABLE=y
> >>>>>> CONFIG_STACK_COLORATION=y
> >>>>>> CONFIG_START_DAY=13
> >>>>>> CONFIG_START_MONTH=9
> >>>>>> CONFIG_START_YEAR=2014
> >>>>>> CONFIG_STM32F4DISBB=y
> >>>>>> CONFIG_STM32_ADC1=y
> >>>>>> CONFIG_STM32_DMA1=y
> >>>>>> CONFIG_STM32_DMA2=y
> >>>>>> CONFIG_STM32_DMACAPABLE=y
> >>>>>> CONFIG_STM32_ETHMAC=y
> >>>>>> CONFIG_STM32_I2C1=y
> >>>>>> CONFIG_STM32_JTAG_SW_ENABLE=y
> >>>>>> CONFIG_STM32_OTGFS=y
> >>>>>> CONFIG_STM32_PHYADDR=0
> >>>>>> CONFIG_STM32_PHYSR=31
> >>>>>> CONFIG_STM32_PHYSR_100FD=0x0018
> >>>>>> CONFIG_STM32_PHYSR_100HD=0x0008
> >>>>>> CONFIG_STM32_PHYSR_10FD=0x0014
> >>>>>> CONFIG_STM32_PHYSR_10HD=0x0004
> >>>>>> CONFIG_STM32_PHYSR_ALTCONFIG=y
> >>>>>> CONFIG_STM32_PHYSR_ALTMODE=0x001c
> >>>>>> CONFIG_STM32_PWR=y
> >>>>>> CONFIG_STM32_RMII_EXTCLK=y
> >>>>>> CONFIG_STM32_SDIO=y
> >>>>>> CONFIG_STM32_SPI1=y
> >>>>>> CONFIG_STM32_USART1=y
> >>>>>> CONFIG_STM32_USART2=y
> >>>>>> CONFIG_STM32_USART3=y
> >>>>>> CONFIG_STM32_USART6=y
> >>>>>> CONFIG_SYSTEM_NSH=y
> >>>>>> CONFIG_SYSTEM_PING=y
> >>>>>> CONFIG_USART2_IFLOWCONTROL=y
> >>>>>> CONFIG_USART2_OFLOWCONTROL=y
> >>>>>> CONFIG_USART3_RS485=y
> >>>>>> CONFIG_USART6_RXBUFSIZE=64
> >>>>>> CONFIG_USART6_TXBUFSIZE=64
> >>>>>> CONFIG_USBDEV=y
> >>>>>> CONFIG_USER_ENTRYPOINT="nsh_main"
> >>>>>>
> >>>>>> I believe that there is something missing or wrong in my
> >>>>>> configuration, but I couldn't find what it is.
> >>>>>>
> >>>>>> Can anybody give me some advice on how to solve this issue?
> >>>>>>
> >>>>>> Best regards,
> >>>>>>
> >>>>>> Flavio
> >>>>>>
> >>>>>>
> >>>>>> --
> >>>>>> Flavio de Castro Alves Filho
> >>>>>>
> >>>>>> flavio.alves@gmail.com
> >>>>>> Twitter: http://twitter.com/#!/fraviofii
> >>>>>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >>>>>
> >>>>> --
> >>>>> Flavio de Castro Alves Filho
> >>>>>
> >>>>> flavio.alves@gmail.com
> >>>>> Twitter: http://twitter.com/#!/fraviofii
> >>>>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >>>>>
> >>>
> >



-- 
Flavio de Castro Alves Filho

flavio.alves@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Gregory Nutt <sp...@gmail.com>.
Often, a RAM log is used with a USB console.  But a serial port works 
too.  There are many examples.  See

$ find boards/ -name defconfig | xargs grep -l CDCACM_CONSOLE | xargs 
grep SYSLOG_DEVPATH

On 1/18/2021 3:49 PM, Flavio Castro Alves Filho wrote:
> Hello,
>
> Confirming: it is not working.
>
> I tried to see the syslog messages on an UART port while using
> nutshell on usb but it didn't work.
>
> Best regards,
>
> Flavio
>
> Em dom., 17 de jan. de 2021 às 13:52, Gregory Nutt
> <sp...@gmail.com> escreveu:
>> I don't think that this combination will work:
>>
>> CONFIG_CDCACM_CONSOLE=y
>> CONFIG_CONSOLE_SYSLOG=y
>>
>> I think that the syslog console device would have to be available at
>> bootup. Normally a RAM log is is used to hold syslog data if a USB
>> console is used.
>>
>> I might be wrong about that and this should not prevent the USB device
>> connecting.
>>
>> On 1/17/2021 9:10 AM, Flavio Castro Alves Filho wrote:
>>> Thank you very much for your fast response.
>>>
>>> I checked the boot calls and they are the same, regarding USB initialization.
>>>
>>> I compared the include/nuttx/config.h files too ... at least regarding
>>> USB, I couldn't see anything critical.
>>>
>>> The development approach that I am working was exactly starting with
>>> stm32discovery board and increasing features. Maybe I have to restart,
>>> checking first the USB.
>>>
>>> Best regards,
>>>
>>> Flavio
>>>
>>> Em dom., 17 de jan. de 2021 às 11:39, Grr <ge...@gmail.com> escreveu:
>>>> What you can do is compare .config generated from that defconfig to .config
>>>> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
>>>> the differences. You can also compare include/nuttx/config.h from both
>>>> configs
>>>>
>>>> Another approach is to start from discovery config and do the modifications
>>>> for your board. After you have it working, clone the config to a different
>>>> board name. With "make savedefconfig" you can save your working defconfig
>>>>
>>>> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
>>>> flavio.alves@gmail.com>) escribió:
>>>>
>>>>> As an additional information, if I load the STM32F4DISCO on my board, USB
>>>>> works.
>>>>>
>>>>> Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
>>>>> <fl...@gmail.com> escreveu:
>>>>>> Hello,
>>>>>>
>>>>>> I am working to port NuttX on a board based on STM32F4DISCOVERY. The
>>>>>> microcontroller is the STM32F407VET6.
>>>>>>
>>>>>> USB CDC support is not initializing.
>>>>>>
>>>>>> When I plug the USB on the board, I have the following dmesg response in
>>>>> Linux:
>>>>>> [517062.075048] usb usb1-port2: attempt power cycle
>>>>>> [517062.726922] usb 1-2: new full-speed USB device number 47 using
>>>>> xhci_hcd
>>>>>> [517062.727170] usb 1-2: Device not responding to setup address.
>>>>>> [517062.935148] usb 1-2: Device not responding to setup address.
>>>>>> [517063.142906] usb 1-2: device not accepting address 47, error -71
>>>>>> [517063.270916] usb 1-2: new full-speed USB device number 48 using
>>>>> xhci_hcd
>>>>>> [517063.271141] usb 1-2: Device not responding to setup address.
>>>>>> [517063.479134] usb 1-2: Device not responding to setup address.
>>>>>>
>>>>>> When I run stm32f4discovery:usbnsh on my discovery board, it works.
>>>>>>
>>>>>> I compared the defconfig from the base project and from mine and I
>>>>>> believe I have initialized everything that is related to the USB.
>>>>>>
>>>>>> Here is the defconfig for my board:
>>>>>>
>>>>>> #
>>>>>> # 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_FPU is not set
>>>>>> # CONFIG_MMCSD_MMCSUPPORT is not set
>>>>>> # CONFIG_MMCSD_SPI is not set
>>>>>> # CONFIG_NSH_ARGCAT is not set
>>>>>> # CONFIG_NSH_CMDOPT_HEXDUMP is not set
>>>>>> # CONFIG_NSH_CMDPARMS is not set
>>>>>> CONFIG_ADC=y
>>>>>> CONFIG_ANALOG=y
>>>>>> CONFIG_ARCH="arm"
>>>>>> CONFIG_ARCH_BOARD="phi-innovations"
>>>>>> CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
>>>>>> CONFIG_ARCH_CHIP="stm32"
>>>>>> CONFIG_ARCH_CHIP_STM32=y
>>>>>> CONFIG_ARCH_CHIP_STM32F407VG=y
>>>>>> CONFIG_ARCH_STACKDUMP=y
>>>>>> CONFIG_ARMV7M_MEMCPY=y
>>>>>> CONFIG_BOARDCTL_RESET=y
>>>>>> CONFIG_BOARDCTL_UNIQUEID=y
>>>>>> CONFIG_BOARDCTL_USBDEVCTRL=y
>>>>>> CONFIG_BOARD_LOOPSPERMSEC=16717
>>>>>> CONFIG_BUILTIN=y
>>>>>> CONFIG_CDCACM=y
>>>>>> CONFIG_CDCACM_CONSOLE=y
>>>>>> CONFIG_CDCACM_RXBUFSIZE=256
>>>>>> CONFIG_CDCACM_TXBUFSIZE=256
>>>>>> CONFIG_CLOCK_MONOTONIC=y
>>>>>> CONFIG_CONSOLE_SYSLOG=y
>>>>>> CONFIG_DEBUG_ASSERTIONS=y
>>>>>> CONFIG_DEBUG_DMA=y
>>>>>> CONFIG_DEBUG_DMA_ERROR=y
>>>>>> CONFIG_DEBUG_DMA_INFO=y
>>>>>> CONFIG_DEBUG_DMA_WARN=y
>>>>>> CONFIG_DEBUG_ERROR=y
>>>>>> CONFIG_DEBUG_FEATURES=y
>>>>>> CONFIG_DEBUG_FS=y
>>>>>> CONFIG_DEBUG_FS_ERROR=y
>>>>>> CONFIG_DEBUG_FS_WARN=y
>>>>>> CONFIG_DEBUG_FULLOPT=y
>>>>>> CONFIG_DEBUG_HARDFAULT_ALERT=y
>>>>>> CONFIG_DEBUG_INFO=y
>>>>>> CONFIG_DEBUG_NET=y
>>>>>> CONFIG_DEBUG_NET_ERROR=y
>>>>>> CONFIG_DEBUG_NET_INFO=y
>>>>>> CONFIG_DEBUG_NET_WARN=y
>>>>>> CONFIG_DEBUG_RTC=y
>>>>>> CONFIG_DEBUG_RTC_ERROR=y
>>>>>> CONFIG_DEBUG_RTC_INFO=y
>>>>>> CONFIG_DEBUG_RTC_WARN=y
>>>>>> CONFIG_DEBUG_SYMBOLS=y
>>>>>> CONFIG_DEBUG_WARN=y
>>>>>> CONFIG_DEV_GPIO=y
>>>>>> CONFIG_ETH0_PHY_LAN8742A=y
>>>>>> CONFIG_EXAMPLES_PPPD=y
>>>>>> CONFIG_FAT_LCNAMES=y
>>>>>> CONFIG_FAT_LFN=y
>>>>>> CONFIG_FS_FAT=y
>>>>>> CONFIG_FS_PROCFS=y
>>>>>> CONFIG_FS_SMARTFS=y
>>>>>> CONFIG_HAVE_CXX=y
>>>>>> CONFIG_HAVE_CXXINITIALIZE=y
>>>>>> CONFIG_HEAP_COLORATION=y
>>>>>> CONFIG_IDLETHREAD_STACKSIZE=2048
>>>>>> CONFIG_INTELHEX_BINARY=y
>>>>>> CONFIG_IOEXPANDER=y
>>>>>> CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
>>>>>> CONFIG_MAX_TASKS=16
>>>>>> CONFIG_MMCSD=y
>>>>>> CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
>>>>>> CONFIG_MMCSD_SDIO=y
>>>>>> CONFIG_MTD=y
>>>>>> CONFIG_MTD_MX25L=y
>>>>>> CONFIG_MTD_SMART=y
>>>>>> CONFIG_MTD_SMART_FSCK=y
>>>>>> CONFIG_MX25L_SPIFREQUENCY=21000000
>>>>>> CONFIG_NET=y
>>>>>> CONFIG_NETDB_DNSCLIENT=y
>>>>>> CONFIG_NETINIT_DEBUG=y
>>>>>> CONFIG_NETINIT_DHCPC=y
>>>>>> CONFIG_NETINIT_DNS=y
>>>>>> CONFIG_NETINIT_DNSIPADDR=0x08080808
>>>>>> CONFIG_NETINIT_DRIPADDR=0x0a010101
>>>>>> CONFIG_NETINIT_NOMAC=y
>>>>>> CONFIG_NETINIT_THREAD=y
>>>>>> CONFIG_NETUTILS_DHCPC=y
>>>>>> CONFIG_NETUTILS_NETCAT=y
>>>>>> CONFIG_NETUTILS_PPPD_PAP=y
>>>>>> CONFIG_NET_ARP_DUMP=y
>>>>>> CONFIG_NET_ARP_SEND=y
>>>>>> CONFIG_NET_BROADCAST=y
>>>>>> CONFIG_NET_ETH_PKTSIZE=1294
>>>>>> CONFIG_NET_ICMP=y
>>>>>> CONFIG_NET_ICMP_SOCKET=y
>>>>>> CONFIG_NET_SOCKOPTS=y
>>>>>> CONFIG_NET_SOLINGER=y
>>>>>> CONFIG_NET_STATISTICS=y
>>>>>> CONFIG_NET_TCP=y
>>>>>> CONFIG_NET_TCPBACKLOG=y
>>>>>> CONFIG_NET_TCPURGDATA=y
>>>>>> CONFIG_NET_TCP_KEEPALIVE=y
>>>>>> CONFIG_NET_TCP_WRITE_BUFFERS=y
>>>>>> CONFIG_NET_UDP=y
>>>>>> CONFIG_NET_UDP_CHECKSUMS=y
>>>>>> CONFIG_NFILE_DESCRIPTORS=8
>>>>>> CONFIG_NSH_ARCHINIT=y
>>>>>> CONFIG_NSH_BUILTIN_APPS=y
>>>>>> CONFIG_NSH_DISABLE_LOSMART=y
>>>>>> CONFIG_NSH_FILEIOSIZE=512
>>>>>> CONFIG_NSH_LINELEN=64
>>>>>> CONFIG_NSH_PROMPT_STRING="nsh$ "
>>>>>> CONFIG_NSH_READLINE=y
>>>>>> CONFIG_PREALLOC_TIMERS=4
>>>>>> CONFIG_RAM_SIZE=114688
>>>>>> CONFIG_RAM_START=0x20000000
>>>>>> CONFIG_RAW_BINARY=y
>>>>>> CONFIG_RR_INTERVAL=200
>>>>>> CONFIG_RTC=y
>>>>>> CONFIG_RTC_EXTERNAL=y
>>>>>> CONFIG_RTC_PCF8563=y
>>>>>> CONFIG_SCHED_HPWORK=y
>>>>>> CONFIG_SCHED_HPWORKPRIORITY=192
>>>>>> CONFIG_SCHED_WAITPID=y
>>>>>> CONFIG_SDCLONE_DISABLE=y
>>>>>> CONFIG_STACK_COLORATION=y
>>>>>> CONFIG_START_DAY=13
>>>>>> CONFIG_START_MONTH=9
>>>>>> CONFIG_START_YEAR=2014
>>>>>> CONFIG_STM32F4DISBB=y
>>>>>> CONFIG_STM32_ADC1=y
>>>>>> CONFIG_STM32_DMA1=y
>>>>>> CONFIG_STM32_DMA2=y
>>>>>> CONFIG_STM32_DMACAPABLE=y
>>>>>> CONFIG_STM32_ETHMAC=y
>>>>>> CONFIG_STM32_I2C1=y
>>>>>> CONFIG_STM32_JTAG_SW_ENABLE=y
>>>>>> CONFIG_STM32_OTGFS=y
>>>>>> CONFIG_STM32_PHYADDR=0
>>>>>> CONFIG_STM32_PHYSR=31
>>>>>> CONFIG_STM32_PHYSR_100FD=0x0018
>>>>>> CONFIG_STM32_PHYSR_100HD=0x0008
>>>>>> CONFIG_STM32_PHYSR_10FD=0x0014
>>>>>> CONFIG_STM32_PHYSR_10HD=0x0004
>>>>>> CONFIG_STM32_PHYSR_ALTCONFIG=y
>>>>>> CONFIG_STM32_PHYSR_ALTMODE=0x001c
>>>>>> CONFIG_STM32_PWR=y
>>>>>> CONFIG_STM32_RMII_EXTCLK=y
>>>>>> CONFIG_STM32_SDIO=y
>>>>>> CONFIG_STM32_SPI1=y
>>>>>> CONFIG_STM32_USART1=y
>>>>>> CONFIG_STM32_USART2=y
>>>>>> CONFIG_STM32_USART3=y
>>>>>> CONFIG_STM32_USART6=y
>>>>>> CONFIG_SYSTEM_NSH=y
>>>>>> CONFIG_SYSTEM_PING=y
>>>>>> CONFIG_USART2_IFLOWCONTROL=y
>>>>>> CONFIG_USART2_OFLOWCONTROL=y
>>>>>> CONFIG_USART3_RS485=y
>>>>>> CONFIG_USART6_RXBUFSIZE=64
>>>>>> CONFIG_USART6_TXBUFSIZE=64
>>>>>> CONFIG_USBDEV=y
>>>>>> CONFIG_USER_ENTRYPOINT="nsh_main"
>>>>>>
>>>>>> I believe that there is something missing or wrong in my
>>>>>> configuration, but I couldn't find what it is.
>>>>>>
>>>>>> Can anybody give me some advice on how to solve this issue?
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> Flavio
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Flavio de Castro Alves Filho
>>>>>>
>>>>>> flavio.alves@gmail.com
>>>>>> Twitter: http://twitter.com/#!/fraviofii
>>>>>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>>>>>
>>>>> --
>>>>> Flavio de Castro Alves Filho
>>>>>
>>>>> flavio.alves@gmail.com
>>>>> Twitter: http://twitter.com/#!/fraviofii
>>>>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>>>>>
>>>
>

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Flavio Castro Alves Filho <fl...@gmail.com>.
Hello,

Confirming: it is not working.

I tried to see the syslog messages on an UART port while using
nutshell on usb but it didn't work.

Best regards,

Flavio

Em dom., 17 de jan. de 2021 às 13:52, Gregory Nutt
<sp...@gmail.com> escreveu:
>
> I don't think that this combination will work:
>
> CONFIG_CDCACM_CONSOLE=y
> CONFIG_CONSOLE_SYSLOG=y
>
> I think that the syslog console device would have to be available at
> bootup. Normally a RAM log is is used to hold syslog data if a USB
> console is used.
>
> I might be wrong about that and this should not prevent the USB device
> connecting.
>
> On 1/17/2021 9:10 AM, Flavio Castro Alves Filho wrote:
> > Thank you very much for your fast response.
> >
> > I checked the boot calls and they are the same, regarding USB initialization.
> >
> > I compared the include/nuttx/config.h files too ... at least regarding
> > USB, I couldn't see anything critical.
> >
> > The development approach that I am working was exactly starting with
> > stm32discovery board and increasing features. Maybe I have to restart,
> > checking first the USB.
> >
> > Best regards,
> >
> > Flavio
> >
> > Em dom., 17 de jan. de 2021 às 11:39, Grr <ge...@gmail.com> escreveu:
> >> What you can do is compare .config generated from that defconfig to .config
> >> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
> >> the differences. You can also compare include/nuttx/config.h from both
> >> configs
> >>
> >> Another approach is to start from discovery config and do the modifications
> >> for your board. After you have it working, clone the config to a different
> >> board name. With "make savedefconfig" you can save your working defconfig
> >>
> >> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
> >> flavio.alves@gmail.com>) escribió:
> >>
> >>> As an additional information, if I load the STM32F4DISCO on my board, USB
> >>> works.
> >>>
> >>> Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
> >>> <fl...@gmail.com> escreveu:
> >>>> Hello,
> >>>>
> >>>> I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> >>>> microcontroller is the STM32F407VET6.
> >>>>
> >>>> USB CDC support is not initializing.
> >>>>
> >>>> When I plug the USB on the board, I have the following dmesg response in
> >>> Linux:
> >>>> [517062.075048] usb usb1-port2: attempt power cycle
> >>>> [517062.726922] usb 1-2: new full-speed USB device number 47 using
> >>> xhci_hcd
> >>>> [517062.727170] usb 1-2: Device not responding to setup address.
> >>>> [517062.935148] usb 1-2: Device not responding to setup address.
> >>>> [517063.142906] usb 1-2: device not accepting address 47, error -71
> >>>> [517063.270916] usb 1-2: new full-speed USB device number 48 using
> >>> xhci_hcd
> >>>> [517063.271141] usb 1-2: Device not responding to setup address.
> >>>> [517063.479134] usb 1-2: Device not responding to setup address.
> >>>>
> >>>> When I run stm32f4discovery:usbnsh on my discovery board, it works.
> >>>>
> >>>> I compared the defconfig from the base project and from mine and I
> >>>> believe I have initialized everything that is related to the USB.
> >>>>
> >>>> Here is the defconfig for my board:
> >>>>
> >>>> #
> >>>> # 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_FPU is not set
> >>>> # CONFIG_MMCSD_MMCSUPPORT is not set
> >>>> # CONFIG_MMCSD_SPI is not set
> >>>> # CONFIG_NSH_ARGCAT is not set
> >>>> # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> >>>> # CONFIG_NSH_CMDPARMS is not set
> >>>> CONFIG_ADC=y
> >>>> CONFIG_ANALOG=y
> >>>> CONFIG_ARCH="arm"
> >>>> CONFIG_ARCH_BOARD="phi-innovations"
> >>>> CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
> >>>> CONFIG_ARCH_CHIP="stm32"
> >>>> CONFIG_ARCH_CHIP_STM32=y
> >>>> CONFIG_ARCH_CHIP_STM32F407VG=y
> >>>> CONFIG_ARCH_STACKDUMP=y
> >>>> CONFIG_ARMV7M_MEMCPY=y
> >>>> CONFIG_BOARDCTL_RESET=y
> >>>> CONFIG_BOARDCTL_UNIQUEID=y
> >>>> CONFIG_BOARDCTL_USBDEVCTRL=y
> >>>> CONFIG_BOARD_LOOPSPERMSEC=16717
> >>>> CONFIG_BUILTIN=y
> >>>> CONFIG_CDCACM=y
> >>>> CONFIG_CDCACM_CONSOLE=y
> >>>> CONFIG_CDCACM_RXBUFSIZE=256
> >>>> CONFIG_CDCACM_TXBUFSIZE=256
> >>>> CONFIG_CLOCK_MONOTONIC=y
> >>>> CONFIG_CONSOLE_SYSLOG=y
> >>>> CONFIG_DEBUG_ASSERTIONS=y
> >>>> CONFIG_DEBUG_DMA=y
> >>>> CONFIG_DEBUG_DMA_ERROR=y
> >>>> CONFIG_DEBUG_DMA_INFO=y
> >>>> CONFIG_DEBUG_DMA_WARN=y
> >>>> CONFIG_DEBUG_ERROR=y
> >>>> CONFIG_DEBUG_FEATURES=y
> >>>> CONFIG_DEBUG_FS=y
> >>>> CONFIG_DEBUG_FS_ERROR=y
> >>>> CONFIG_DEBUG_FS_WARN=y
> >>>> CONFIG_DEBUG_FULLOPT=y
> >>>> CONFIG_DEBUG_HARDFAULT_ALERT=y
> >>>> CONFIG_DEBUG_INFO=y
> >>>> CONFIG_DEBUG_NET=y
> >>>> CONFIG_DEBUG_NET_ERROR=y
> >>>> CONFIG_DEBUG_NET_INFO=y
> >>>> CONFIG_DEBUG_NET_WARN=y
> >>>> CONFIG_DEBUG_RTC=y
> >>>> CONFIG_DEBUG_RTC_ERROR=y
> >>>> CONFIG_DEBUG_RTC_INFO=y
> >>>> CONFIG_DEBUG_RTC_WARN=y
> >>>> CONFIG_DEBUG_SYMBOLS=y
> >>>> CONFIG_DEBUG_WARN=y
> >>>> CONFIG_DEV_GPIO=y
> >>>> CONFIG_ETH0_PHY_LAN8742A=y
> >>>> CONFIG_EXAMPLES_PPPD=y
> >>>> CONFIG_FAT_LCNAMES=y
> >>>> CONFIG_FAT_LFN=y
> >>>> CONFIG_FS_FAT=y
> >>>> CONFIG_FS_PROCFS=y
> >>>> CONFIG_FS_SMARTFS=y
> >>>> CONFIG_HAVE_CXX=y
> >>>> CONFIG_HAVE_CXXINITIALIZE=y
> >>>> CONFIG_HEAP_COLORATION=y
> >>>> CONFIG_IDLETHREAD_STACKSIZE=2048
> >>>> CONFIG_INTELHEX_BINARY=y
> >>>> CONFIG_IOEXPANDER=y
> >>>> CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
> >>>> CONFIG_MAX_TASKS=16
> >>>> CONFIG_MMCSD=y
> >>>> CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
> >>>> CONFIG_MMCSD_SDIO=y
> >>>> CONFIG_MTD=y
> >>>> CONFIG_MTD_MX25L=y
> >>>> CONFIG_MTD_SMART=y
> >>>> CONFIG_MTD_SMART_FSCK=y
> >>>> CONFIG_MX25L_SPIFREQUENCY=21000000
> >>>> CONFIG_NET=y
> >>>> CONFIG_NETDB_DNSCLIENT=y
> >>>> CONFIG_NETINIT_DEBUG=y
> >>>> CONFIG_NETINIT_DHCPC=y
> >>>> CONFIG_NETINIT_DNS=y
> >>>> CONFIG_NETINIT_DNSIPADDR=0x08080808
> >>>> CONFIG_NETINIT_DRIPADDR=0x0a010101
> >>>> CONFIG_NETINIT_NOMAC=y
> >>>> CONFIG_NETINIT_THREAD=y
> >>>> CONFIG_NETUTILS_DHCPC=y
> >>>> CONFIG_NETUTILS_NETCAT=y
> >>>> CONFIG_NETUTILS_PPPD_PAP=y
> >>>> CONFIG_NET_ARP_DUMP=y
> >>>> CONFIG_NET_ARP_SEND=y
> >>>> CONFIG_NET_BROADCAST=y
> >>>> CONFIG_NET_ETH_PKTSIZE=1294
> >>>> CONFIG_NET_ICMP=y
> >>>> CONFIG_NET_ICMP_SOCKET=y
> >>>> CONFIG_NET_SOCKOPTS=y
> >>>> CONFIG_NET_SOLINGER=y
> >>>> CONFIG_NET_STATISTICS=y
> >>>> CONFIG_NET_TCP=y
> >>>> CONFIG_NET_TCPBACKLOG=y
> >>>> CONFIG_NET_TCPURGDATA=y
> >>>> CONFIG_NET_TCP_KEEPALIVE=y
> >>>> CONFIG_NET_TCP_WRITE_BUFFERS=y
> >>>> CONFIG_NET_UDP=y
> >>>> CONFIG_NET_UDP_CHECKSUMS=y
> >>>> CONFIG_NFILE_DESCRIPTORS=8
> >>>> CONFIG_NSH_ARCHINIT=y
> >>>> CONFIG_NSH_BUILTIN_APPS=y
> >>>> CONFIG_NSH_DISABLE_LOSMART=y
> >>>> CONFIG_NSH_FILEIOSIZE=512
> >>>> CONFIG_NSH_LINELEN=64
> >>>> CONFIG_NSH_PROMPT_STRING="nsh$ "
> >>>> CONFIG_NSH_READLINE=y
> >>>> CONFIG_PREALLOC_TIMERS=4
> >>>> CONFIG_RAM_SIZE=114688
> >>>> CONFIG_RAM_START=0x20000000
> >>>> CONFIG_RAW_BINARY=y
> >>>> CONFIG_RR_INTERVAL=200
> >>>> CONFIG_RTC=y
> >>>> CONFIG_RTC_EXTERNAL=y
> >>>> CONFIG_RTC_PCF8563=y
> >>>> CONFIG_SCHED_HPWORK=y
> >>>> CONFIG_SCHED_HPWORKPRIORITY=192
> >>>> CONFIG_SCHED_WAITPID=y
> >>>> CONFIG_SDCLONE_DISABLE=y
> >>>> CONFIG_STACK_COLORATION=y
> >>>> CONFIG_START_DAY=13
> >>>> CONFIG_START_MONTH=9
> >>>> CONFIG_START_YEAR=2014
> >>>> CONFIG_STM32F4DISBB=y
> >>>> CONFIG_STM32_ADC1=y
> >>>> CONFIG_STM32_DMA1=y
> >>>> CONFIG_STM32_DMA2=y
> >>>> CONFIG_STM32_DMACAPABLE=y
> >>>> CONFIG_STM32_ETHMAC=y
> >>>> CONFIG_STM32_I2C1=y
> >>>> CONFIG_STM32_JTAG_SW_ENABLE=y
> >>>> CONFIG_STM32_OTGFS=y
> >>>> CONFIG_STM32_PHYADDR=0
> >>>> CONFIG_STM32_PHYSR=31
> >>>> CONFIG_STM32_PHYSR_100FD=0x0018
> >>>> CONFIG_STM32_PHYSR_100HD=0x0008
> >>>> CONFIG_STM32_PHYSR_10FD=0x0014
> >>>> CONFIG_STM32_PHYSR_10HD=0x0004
> >>>> CONFIG_STM32_PHYSR_ALTCONFIG=y
> >>>> CONFIG_STM32_PHYSR_ALTMODE=0x001c
> >>>> CONFIG_STM32_PWR=y
> >>>> CONFIG_STM32_RMII_EXTCLK=y
> >>>> CONFIG_STM32_SDIO=y
> >>>> CONFIG_STM32_SPI1=y
> >>>> CONFIG_STM32_USART1=y
> >>>> CONFIG_STM32_USART2=y
> >>>> CONFIG_STM32_USART3=y
> >>>> CONFIG_STM32_USART6=y
> >>>> CONFIG_SYSTEM_NSH=y
> >>>> CONFIG_SYSTEM_PING=y
> >>>> CONFIG_USART2_IFLOWCONTROL=y
> >>>> CONFIG_USART2_OFLOWCONTROL=y
> >>>> CONFIG_USART3_RS485=y
> >>>> CONFIG_USART6_RXBUFSIZE=64
> >>>> CONFIG_USART6_TXBUFSIZE=64
> >>>> CONFIG_USBDEV=y
> >>>> CONFIG_USER_ENTRYPOINT="nsh_main"
> >>>>
> >>>> I believe that there is something missing or wrong in my
> >>>> configuration, but I couldn't find what it is.
> >>>>
> >>>> Can anybody give me some advice on how to solve this issue?
> >>>>
> >>>> Best regards,
> >>>>
> >>>> Flavio
> >>>>
> >>>>
> >>>> --
> >>>> Flavio de Castro Alves Filho
> >>>>
> >>>> flavio.alves@gmail.com
> >>>> Twitter: http://twitter.com/#!/fraviofii
> >>>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >>>
> >>>
> >>> --
> >>> Flavio de Castro Alves Filho
> >>>
> >>> flavio.alves@gmail.com
> >>> Twitter: http://twitter.com/#!/fraviofii
> >>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >>>
> >
> >
>


-- 
Flavio de Castro Alves Filho

flavio.alves@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Gregory Nutt <sp...@gmail.com>.
I don't think that this combination will work:

CONFIG_CDCACM_CONSOLE=y
CONFIG_CONSOLE_SYSLOG=y

I think that the syslog console device would have to be available at 
bootup. Normally a RAM log is is used to hold syslog data if a USB 
console is used.

I might be wrong about that and this should not prevent the USB device 
connecting.

On 1/17/2021 9:10 AM, Flavio Castro Alves Filho wrote:
> Thank you very much for your fast response.
>
> I checked the boot calls and they are the same, regarding USB initialization.
>
> I compared the include/nuttx/config.h files too ... at least regarding
> USB, I couldn't see anything critical.
>
> The development approach that I am working was exactly starting with
> stm32discovery board and increasing features. Maybe I have to restart,
> checking first the USB.
>
> Best regards,
>
> Flavio
>
> Em dom., 17 de jan. de 2021 às 11:39, Grr <ge...@gmail.com> escreveu:
>> What you can do is compare .config generated from that defconfig to .config
>> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
>> the differences. You can also compare include/nuttx/config.h from both
>> configs
>>
>> Another approach is to start from discovery config and do the modifications
>> for your board. After you have it working, clone the config to a different
>> board name. With "make savedefconfig" you can save your working defconfig
>>
>> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
>> flavio.alves@gmail.com>) escribió:
>>
>>> As an additional information, if I load the STM32F4DISCO on my board, USB
>>> works.
>>>
>>> Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
>>> <fl...@gmail.com> escreveu:
>>>> Hello,
>>>>
>>>> I am working to port NuttX on a board based on STM32F4DISCOVERY. The
>>>> microcontroller is the STM32F407VET6.
>>>>
>>>> USB CDC support is not initializing.
>>>>
>>>> When I plug the USB on the board, I have the following dmesg response in
>>> Linux:
>>>> [517062.075048] usb usb1-port2: attempt power cycle
>>>> [517062.726922] usb 1-2: new full-speed USB device number 47 using
>>> xhci_hcd
>>>> [517062.727170] usb 1-2: Device not responding to setup address.
>>>> [517062.935148] usb 1-2: Device not responding to setup address.
>>>> [517063.142906] usb 1-2: device not accepting address 47, error -71
>>>> [517063.270916] usb 1-2: new full-speed USB device number 48 using
>>> xhci_hcd
>>>> [517063.271141] usb 1-2: Device not responding to setup address.
>>>> [517063.479134] usb 1-2: Device not responding to setup address.
>>>>
>>>> When I run stm32f4discovery:usbnsh on my discovery board, it works.
>>>>
>>>> I compared the defconfig from the base project and from mine and I
>>>> believe I have initialized everything that is related to the USB.
>>>>
>>>> Here is the defconfig for my board:
>>>>
>>>> #
>>>> # 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_FPU is not set
>>>> # CONFIG_MMCSD_MMCSUPPORT is not set
>>>> # CONFIG_MMCSD_SPI is not set
>>>> # CONFIG_NSH_ARGCAT is not set
>>>> # CONFIG_NSH_CMDOPT_HEXDUMP is not set
>>>> # CONFIG_NSH_CMDPARMS is not set
>>>> CONFIG_ADC=y
>>>> CONFIG_ANALOG=y
>>>> CONFIG_ARCH="arm"
>>>> CONFIG_ARCH_BOARD="phi-innovations"
>>>> CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
>>>> CONFIG_ARCH_CHIP="stm32"
>>>> CONFIG_ARCH_CHIP_STM32=y
>>>> CONFIG_ARCH_CHIP_STM32F407VG=y
>>>> CONFIG_ARCH_STACKDUMP=y
>>>> CONFIG_ARMV7M_MEMCPY=y
>>>> CONFIG_BOARDCTL_RESET=y
>>>> CONFIG_BOARDCTL_UNIQUEID=y
>>>> CONFIG_BOARDCTL_USBDEVCTRL=y
>>>> CONFIG_BOARD_LOOPSPERMSEC=16717
>>>> CONFIG_BUILTIN=y
>>>> CONFIG_CDCACM=y
>>>> CONFIG_CDCACM_CONSOLE=y
>>>> CONFIG_CDCACM_RXBUFSIZE=256
>>>> CONFIG_CDCACM_TXBUFSIZE=256
>>>> CONFIG_CLOCK_MONOTONIC=y
>>>> CONFIG_CONSOLE_SYSLOG=y
>>>> CONFIG_DEBUG_ASSERTIONS=y
>>>> CONFIG_DEBUG_DMA=y
>>>> CONFIG_DEBUG_DMA_ERROR=y
>>>> CONFIG_DEBUG_DMA_INFO=y
>>>> CONFIG_DEBUG_DMA_WARN=y
>>>> CONFIG_DEBUG_ERROR=y
>>>> CONFIG_DEBUG_FEATURES=y
>>>> CONFIG_DEBUG_FS=y
>>>> CONFIG_DEBUG_FS_ERROR=y
>>>> CONFIG_DEBUG_FS_WARN=y
>>>> CONFIG_DEBUG_FULLOPT=y
>>>> CONFIG_DEBUG_HARDFAULT_ALERT=y
>>>> CONFIG_DEBUG_INFO=y
>>>> CONFIG_DEBUG_NET=y
>>>> CONFIG_DEBUG_NET_ERROR=y
>>>> CONFIG_DEBUG_NET_INFO=y
>>>> CONFIG_DEBUG_NET_WARN=y
>>>> CONFIG_DEBUG_RTC=y
>>>> CONFIG_DEBUG_RTC_ERROR=y
>>>> CONFIG_DEBUG_RTC_INFO=y
>>>> CONFIG_DEBUG_RTC_WARN=y
>>>> CONFIG_DEBUG_SYMBOLS=y
>>>> CONFIG_DEBUG_WARN=y
>>>> CONFIG_DEV_GPIO=y
>>>> CONFIG_ETH0_PHY_LAN8742A=y
>>>> CONFIG_EXAMPLES_PPPD=y
>>>> CONFIG_FAT_LCNAMES=y
>>>> CONFIG_FAT_LFN=y
>>>> CONFIG_FS_FAT=y
>>>> CONFIG_FS_PROCFS=y
>>>> CONFIG_FS_SMARTFS=y
>>>> CONFIG_HAVE_CXX=y
>>>> CONFIG_HAVE_CXXINITIALIZE=y
>>>> CONFIG_HEAP_COLORATION=y
>>>> CONFIG_IDLETHREAD_STACKSIZE=2048
>>>> CONFIG_INTELHEX_BINARY=y
>>>> CONFIG_IOEXPANDER=y
>>>> CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
>>>> CONFIG_MAX_TASKS=16
>>>> CONFIG_MMCSD=y
>>>> CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
>>>> CONFIG_MMCSD_SDIO=y
>>>> CONFIG_MTD=y
>>>> CONFIG_MTD_MX25L=y
>>>> CONFIG_MTD_SMART=y
>>>> CONFIG_MTD_SMART_FSCK=y
>>>> CONFIG_MX25L_SPIFREQUENCY=21000000
>>>> CONFIG_NET=y
>>>> CONFIG_NETDB_DNSCLIENT=y
>>>> CONFIG_NETINIT_DEBUG=y
>>>> CONFIG_NETINIT_DHCPC=y
>>>> CONFIG_NETINIT_DNS=y
>>>> CONFIG_NETINIT_DNSIPADDR=0x08080808
>>>> CONFIG_NETINIT_DRIPADDR=0x0a010101
>>>> CONFIG_NETINIT_NOMAC=y
>>>> CONFIG_NETINIT_THREAD=y
>>>> CONFIG_NETUTILS_DHCPC=y
>>>> CONFIG_NETUTILS_NETCAT=y
>>>> CONFIG_NETUTILS_PPPD_PAP=y
>>>> CONFIG_NET_ARP_DUMP=y
>>>> CONFIG_NET_ARP_SEND=y
>>>> CONFIG_NET_BROADCAST=y
>>>> CONFIG_NET_ETH_PKTSIZE=1294
>>>> CONFIG_NET_ICMP=y
>>>> CONFIG_NET_ICMP_SOCKET=y
>>>> CONFIG_NET_SOCKOPTS=y
>>>> CONFIG_NET_SOLINGER=y
>>>> CONFIG_NET_STATISTICS=y
>>>> CONFIG_NET_TCP=y
>>>> CONFIG_NET_TCPBACKLOG=y
>>>> CONFIG_NET_TCPURGDATA=y
>>>> CONFIG_NET_TCP_KEEPALIVE=y
>>>> CONFIG_NET_TCP_WRITE_BUFFERS=y
>>>> CONFIG_NET_UDP=y
>>>> CONFIG_NET_UDP_CHECKSUMS=y
>>>> CONFIG_NFILE_DESCRIPTORS=8
>>>> CONFIG_NSH_ARCHINIT=y
>>>> CONFIG_NSH_BUILTIN_APPS=y
>>>> CONFIG_NSH_DISABLE_LOSMART=y
>>>> CONFIG_NSH_FILEIOSIZE=512
>>>> CONFIG_NSH_LINELEN=64
>>>> CONFIG_NSH_PROMPT_STRING="nsh$ "
>>>> CONFIG_NSH_READLINE=y
>>>> CONFIG_PREALLOC_TIMERS=4
>>>> CONFIG_RAM_SIZE=114688
>>>> CONFIG_RAM_START=0x20000000
>>>> CONFIG_RAW_BINARY=y
>>>> CONFIG_RR_INTERVAL=200
>>>> CONFIG_RTC=y
>>>> CONFIG_RTC_EXTERNAL=y
>>>> CONFIG_RTC_PCF8563=y
>>>> CONFIG_SCHED_HPWORK=y
>>>> CONFIG_SCHED_HPWORKPRIORITY=192
>>>> CONFIG_SCHED_WAITPID=y
>>>> CONFIG_SDCLONE_DISABLE=y
>>>> CONFIG_STACK_COLORATION=y
>>>> CONFIG_START_DAY=13
>>>> CONFIG_START_MONTH=9
>>>> CONFIG_START_YEAR=2014
>>>> CONFIG_STM32F4DISBB=y
>>>> CONFIG_STM32_ADC1=y
>>>> CONFIG_STM32_DMA1=y
>>>> CONFIG_STM32_DMA2=y
>>>> CONFIG_STM32_DMACAPABLE=y
>>>> CONFIG_STM32_ETHMAC=y
>>>> CONFIG_STM32_I2C1=y
>>>> CONFIG_STM32_JTAG_SW_ENABLE=y
>>>> CONFIG_STM32_OTGFS=y
>>>> CONFIG_STM32_PHYADDR=0
>>>> CONFIG_STM32_PHYSR=31
>>>> CONFIG_STM32_PHYSR_100FD=0x0018
>>>> CONFIG_STM32_PHYSR_100HD=0x0008
>>>> CONFIG_STM32_PHYSR_10FD=0x0014
>>>> CONFIG_STM32_PHYSR_10HD=0x0004
>>>> CONFIG_STM32_PHYSR_ALTCONFIG=y
>>>> CONFIG_STM32_PHYSR_ALTMODE=0x001c
>>>> CONFIG_STM32_PWR=y
>>>> CONFIG_STM32_RMII_EXTCLK=y
>>>> CONFIG_STM32_SDIO=y
>>>> CONFIG_STM32_SPI1=y
>>>> CONFIG_STM32_USART1=y
>>>> CONFIG_STM32_USART2=y
>>>> CONFIG_STM32_USART3=y
>>>> CONFIG_STM32_USART6=y
>>>> CONFIG_SYSTEM_NSH=y
>>>> CONFIG_SYSTEM_PING=y
>>>> CONFIG_USART2_IFLOWCONTROL=y
>>>> CONFIG_USART2_OFLOWCONTROL=y
>>>> CONFIG_USART3_RS485=y
>>>> CONFIG_USART6_RXBUFSIZE=64
>>>> CONFIG_USART6_TXBUFSIZE=64
>>>> CONFIG_USBDEV=y
>>>> CONFIG_USER_ENTRYPOINT="nsh_main"
>>>>
>>>> I believe that there is something missing or wrong in my
>>>> configuration, but I couldn't find what it is.
>>>>
>>>> Can anybody give me some advice on how to solve this issue?
>>>>
>>>> Best regards,
>>>>
>>>> Flavio
>>>>
>>>>
>>>> --
>>>> Flavio de Castro Alves Filho
>>>>
>>>> flavio.alves@gmail.com
>>>> Twitter: http://twitter.com/#!/fraviofii
>>>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>>>
>>>
>>> --
>>> Flavio de Castro Alves Filho
>>>
>>> flavio.alves@gmail.com
>>> Twitter: http://twitter.com/#!/fraviofii
>>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>>>
>
>


Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Flavio Castro Alves Filho <fl...@gmail.com>.
What I realized is that there is no USB log message showing.

I checked the options on USB monitor to show initialization messages but
got no messages. :-(

Best regards,

Flavio

Em dom, 17 de jan de 2021 14:08, Alan Carvalho de Assis <ac...@gmail.com>
escreveu:

> Hi Flávio,
>
> Other file to compare is the System.map, it will give you some hints
> about which functions are missing in your board. Then you can
> investigate why the function is missing.
>
> Maybe it is just an #ifdef that is not entering because you forgot the
> rename the board's name.
>
> Try to do it and let's us know if you see some difference.
>
> BR,
>
> Alan
>
> On 1/17/21, Flavio Castro Alves Filho <fl...@gmail.com> wrote:
> > Thank you very much for your fast response.
> >
> > I checked the boot calls and they are the same, regarding USB
> > initialization.
> >
> > I compared the include/nuttx/config.h files too ... at least regarding
> > USB, I couldn't see anything critical.
> >
> > The development approach that I am working was exactly starting with
> > stm32discovery board and increasing features. Maybe I have to restart,
> > checking first the USB.
> >
> > Best regards,
> >
> > Flavio
> >
> > Em dom., 17 de jan. de 2021 às 11:39, Grr <ge...@gmail.com> escreveu:
> >>
> >> What you can do is compare .config generated from that defconfig to
> >> .config
> >> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
> >> the differences. You can also compare include/nuttx/config.h from both
> >> configs
> >>
> >> Another approach is to start from discovery config and do the
> >> modifications
> >> for your board. After you have it working, clone the config to a
> >> different
> >> board name. With "make savedefconfig" you can save your working
> defconfig
> >>
> >> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
> >> flavio.alves@gmail.com>) escribió:
> >>
> >> > As an additional information, if I load the STM32F4DISCO on my board,
> >> > USB
> >> > works.
> >> >
> >> > Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
> >> > <fl...@gmail.com> escreveu:
> >> > >
> >> > > Hello,
> >> > >
> >> > > I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> >> > > microcontroller is the STM32F407VET6.
> >> > >
> >> > > USB CDC support is not initializing.
> >> > >
> >> > > When I plug the USB on the board, I have the following dmesg
> response
> >> > > in
> >> > Linux:
> >> > >
> >> > > [517062.075048] usb usb1-port2: attempt power cycle
> >> > > [517062.726922] usb 1-2: new full-speed USB device number 47 using
> >> > xhci_hcd
> >> > > [517062.727170] usb 1-2: Device not responding to setup address.
> >> > > [517062.935148] usb 1-2: Device not responding to setup address.
> >> > > [517063.142906] usb 1-2: device not accepting address 47, error -71
> >> > > [517063.270916] usb 1-2: new full-speed USB device number 48 using
> >> > xhci_hcd
> >> > > [517063.271141] usb 1-2: Device not responding to setup address.
> >> > > [517063.479134] usb 1-2: Device not responding to setup address.
> >> > >
> >> > > When I run stm32f4discovery:usbnsh on my discovery board, it works.
> >> > >
> >> > > I compared the defconfig from the base project and from mine and I
> >> > > believe I have initialized everything that is related to the USB.
> >> > >
> >> > > Here is the defconfig for my board:
> >> > >
> >> > > #
> >> > > # 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_FPU is not set
> >> > > # CONFIG_MMCSD_MMCSUPPORT is not set
> >> > > # CONFIG_MMCSD_SPI is not set
> >> > > # CONFIG_NSH_ARGCAT is not set
> >> > > # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> >> > > # CONFIG_NSH_CMDPARMS is not set
> >> > > CONFIG_ADC=y
> >> > > CONFIG_ANALOG=y
> >> > > CONFIG_ARCH="arm"
> >> > > CONFIG_ARCH_BOARD="phi-innovations"
> >> > > CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
> >> > > CONFIG_ARCH_CHIP="stm32"
> >> > > CONFIG_ARCH_CHIP_STM32=y
> >> > > CONFIG_ARCH_CHIP_STM32F407VG=y
> >> > > CONFIG_ARCH_STACKDUMP=y
> >> > > CONFIG_ARMV7M_MEMCPY=y
> >> > > CONFIG_BOARDCTL_RESET=y
> >> > > CONFIG_BOARDCTL_UNIQUEID=y
> >> > > CONFIG_BOARDCTL_USBDEVCTRL=y
> >> > > CONFIG_BOARD_LOOPSPERMSEC=16717
> >> > > CONFIG_BUILTIN=y
> >> > > CONFIG_CDCACM=y
> >> > > CONFIG_CDCACM_CONSOLE=y
> >> > > CONFIG_CDCACM_RXBUFSIZE=256
> >> > > CONFIG_CDCACM_TXBUFSIZE=256
> >> > > CONFIG_CLOCK_MONOTONIC=y
> >> > > CONFIG_CONSOLE_SYSLOG=y
> >> > > CONFIG_DEBUG_ASSERTIONS=y
> >> > > CONFIG_DEBUG_DMA=y
> >> > > CONFIG_DEBUG_DMA_ERROR=y
> >> > > CONFIG_DEBUG_DMA_INFO=y
> >> > > CONFIG_DEBUG_DMA_WARN=y
> >> > > CONFIG_DEBUG_ERROR=y
> >> > > CONFIG_DEBUG_FEATURES=y
> >> > > CONFIG_DEBUG_FS=y
> >> > > CONFIG_DEBUG_FS_ERROR=y
> >> > > CONFIG_DEBUG_FS_WARN=y
> >> > > CONFIG_DEBUG_FULLOPT=y
> >> > > CONFIG_DEBUG_HARDFAULT_ALERT=y
> >> > > CONFIG_DEBUG_INFO=y
> >> > > CONFIG_DEBUG_NET=y
> >> > > CONFIG_DEBUG_NET_ERROR=y
> >> > > CONFIG_DEBUG_NET_INFO=y
> >> > > CONFIG_DEBUG_NET_WARN=y
> >> > > CONFIG_DEBUG_RTC=y
> >> > > CONFIG_DEBUG_RTC_ERROR=y
> >> > > CONFIG_DEBUG_RTC_INFO=y
> >> > > CONFIG_DEBUG_RTC_WARN=y
> >> > > CONFIG_DEBUG_SYMBOLS=y
> >> > > CONFIG_DEBUG_WARN=y
> >> > > CONFIG_DEV_GPIO=y
> >> > > CONFIG_ETH0_PHY_LAN8742A=y
> >> > > CONFIG_EXAMPLES_PPPD=y
> >> > > CONFIG_FAT_LCNAMES=y
> >> > > CONFIG_FAT_LFN=y
> >> > > CONFIG_FS_FAT=y
> >> > > CONFIG_FS_PROCFS=y
> >> > > CONFIG_FS_SMARTFS=y
> >> > > CONFIG_HAVE_CXX=y
> >> > > CONFIG_HAVE_CXXINITIALIZE=y
> >> > > CONFIG_HEAP_COLORATION=y
> >> > > CONFIG_IDLETHREAD_STACKSIZE=2048
> >> > > CONFIG_INTELHEX_BINARY=y
> >> > > CONFIG_IOEXPANDER=y
> >> > > CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
> >> > > CONFIG_MAX_TASKS=16
> >> > > CONFIG_MMCSD=y
> >> > > CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
> >> > > CONFIG_MMCSD_SDIO=y
> >> > > CONFIG_MTD=y
> >> > > CONFIG_MTD_MX25L=y
> >> > > CONFIG_MTD_SMART=y
> >> > > CONFIG_MTD_SMART_FSCK=y
> >> > > CONFIG_MX25L_SPIFREQUENCY=21000000
> >> > > CONFIG_NET=y
> >> > > CONFIG_NETDB_DNSCLIENT=y
> >> > > CONFIG_NETINIT_DEBUG=y
> >> > > CONFIG_NETINIT_DHCPC=y
> >> > > CONFIG_NETINIT_DNS=y
> >> > > CONFIG_NETINIT_DNSIPADDR=0x08080808
> >> > > CONFIG_NETINIT_DRIPADDR=0x0a010101
> >> > > CONFIG_NETINIT_NOMAC=y
> >> > > CONFIG_NETINIT_THREAD=y
> >> > > CONFIG_NETUTILS_DHCPC=y
> >> > > CONFIG_NETUTILS_NETCAT=y
> >> > > CONFIG_NETUTILS_PPPD_PAP=y
> >> > > CONFIG_NET_ARP_DUMP=y
> >> > > CONFIG_NET_ARP_SEND=y
> >> > > CONFIG_NET_BROADCAST=y
> >> > > CONFIG_NET_ETH_PKTSIZE=1294
> >> > > CONFIG_NET_ICMP=y
> >> > > CONFIG_NET_ICMP_SOCKET=y
> >> > > CONFIG_NET_SOCKOPTS=y
> >> > > CONFIG_NET_SOLINGER=y
> >> > > CONFIG_NET_STATISTICS=y
> >> > > CONFIG_NET_TCP=y
> >> > > CONFIG_NET_TCPBACKLOG=y
> >> > > CONFIG_NET_TCPURGDATA=y
> >> > > CONFIG_NET_TCP_KEEPALIVE=y
> >> > > CONFIG_NET_TCP_WRITE_BUFFERS=y
> >> > > CONFIG_NET_UDP=y
> >> > > CONFIG_NET_UDP_CHECKSUMS=y
> >> > > CONFIG_NFILE_DESCRIPTORS=8
> >> > > CONFIG_NSH_ARCHINIT=y
> >> > > CONFIG_NSH_BUILTIN_APPS=y
> >> > > CONFIG_NSH_DISABLE_LOSMART=y
> >> > > CONFIG_NSH_FILEIOSIZE=512
> >> > > CONFIG_NSH_LINELEN=64
> >> > > CONFIG_NSH_PROMPT_STRING="nsh$ "
> >> > > CONFIG_NSH_READLINE=y
> >> > > CONFIG_PREALLOC_TIMERS=4
> >> > > CONFIG_RAM_SIZE=114688
> >> > > CONFIG_RAM_START=0x20000000
> >> > > CONFIG_RAW_BINARY=y
> >> > > CONFIG_RR_INTERVAL=200
> >> > > CONFIG_RTC=y
> >> > > CONFIG_RTC_EXTERNAL=y
> >> > > CONFIG_RTC_PCF8563=y
> >> > > CONFIG_SCHED_HPWORK=y
> >> > > CONFIG_SCHED_HPWORKPRIORITY=192
> >> > > CONFIG_SCHED_WAITPID=y
> >> > > CONFIG_SDCLONE_DISABLE=y
> >> > > CONFIG_STACK_COLORATION=y
> >> > > CONFIG_START_DAY=13
> >> > > CONFIG_START_MONTH=9
> >> > > CONFIG_START_YEAR=2014
> >> > > CONFIG_STM32F4DISBB=y
> >> > > CONFIG_STM32_ADC1=y
> >> > > CONFIG_STM32_DMA1=y
> >> > > CONFIG_STM32_DMA2=y
> >> > > CONFIG_STM32_DMACAPABLE=y
> >> > > CONFIG_STM32_ETHMAC=y
> >> > > CONFIG_STM32_I2C1=y
> >> > > CONFIG_STM32_JTAG_SW_ENABLE=y
> >> > > CONFIG_STM32_OTGFS=y
> >> > > CONFIG_STM32_PHYADDR=0
> >> > > CONFIG_STM32_PHYSR=31
> >> > > CONFIG_STM32_PHYSR_100FD=0x0018
> >> > > CONFIG_STM32_PHYSR_100HD=0x0008
> >> > > CONFIG_STM32_PHYSR_10FD=0x0014
> >> > > CONFIG_STM32_PHYSR_10HD=0x0004
> >> > > CONFIG_STM32_PHYSR_ALTCONFIG=y
> >> > > CONFIG_STM32_PHYSR_ALTMODE=0x001c
> >> > > CONFIG_STM32_PWR=y
> >> > > CONFIG_STM32_RMII_EXTCLK=y
> >> > > CONFIG_STM32_SDIO=y
> >> > > CONFIG_STM32_SPI1=y
> >> > > CONFIG_STM32_USART1=y
> >> > > CONFIG_STM32_USART2=y
> >> > > CONFIG_STM32_USART3=y
> >> > > CONFIG_STM32_USART6=y
> >> > > CONFIG_SYSTEM_NSH=y
> >> > > CONFIG_SYSTEM_PING=y
> >> > > CONFIG_USART2_IFLOWCONTROL=y
> >> > > CONFIG_USART2_OFLOWCONTROL=y
> >> > > CONFIG_USART3_RS485=y
> >> > > CONFIG_USART6_RXBUFSIZE=64
> >> > > CONFIG_USART6_TXBUFSIZE=64
> >> > > CONFIG_USBDEV=y
> >> > > CONFIG_USER_ENTRYPOINT="nsh_main"
> >> > >
> >> > > I believe that there is something missing or wrong in my
> >> > > configuration, but I couldn't find what it is.
> >> > >
> >> > > Can anybody give me some advice on how to solve this issue?
> >> > >
> >> > > Best regards,
> >> > >
> >> > > Flavio
> >> > >
> >> > >
> >> > > --
> >> > > Flavio de Castro Alves Filho
> >> > >
> >> > > flavio.alves@gmail.com
> >> > > Twitter: http://twitter.com/#!/fraviofii
> >> > > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >> >
> >> >
> >> >
> >> > --
> >> > Flavio de Castro Alves Filho
> >> >
> >> > flavio.alves@gmail.com
> >> > Twitter: http://twitter.com/#!/fraviofii
> >> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >> >
> >
> >
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.alves@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >
>

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
Hi Flávio,

Other file to compare is the System.map, it will give you some hints
about which functions are missing in your board. Then you can
investigate why the function is missing.

Maybe it is just an #ifdef that is not entering because you forgot the
rename the board's name.

Try to do it and let's us know if you see some difference.

BR,

Alan

On 1/17/21, Flavio Castro Alves Filho <fl...@gmail.com> wrote:
> Thank you very much for your fast response.
>
> I checked the boot calls and they are the same, regarding USB
> initialization.
>
> I compared the include/nuttx/config.h files too ... at least regarding
> USB, I couldn't see anything critical.
>
> The development approach that I am working was exactly starting with
> stm32discovery board and increasing features. Maybe I have to restart,
> checking first the USB.
>
> Best regards,
>
> Flavio
>
> Em dom., 17 de jan. de 2021 às 11:39, Grr <ge...@gmail.com> escreveu:
>>
>> What you can do is compare .config generated from that defconfig to
>> .config
>> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
>> the differences. You can also compare include/nuttx/config.h from both
>> configs
>>
>> Another approach is to start from discovery config and do the
>> modifications
>> for your board. After you have it working, clone the config to a
>> different
>> board name. With "make savedefconfig" you can save your working defconfig
>>
>> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
>> flavio.alves@gmail.com>) escribió:
>>
>> > As an additional information, if I load the STM32F4DISCO on my board,
>> > USB
>> > works.
>> >
>> > Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
>> > <fl...@gmail.com> escreveu:
>> > >
>> > > Hello,
>> > >
>> > > I am working to port NuttX on a board based on STM32F4DISCOVERY. The
>> > > microcontroller is the STM32F407VET6.
>> > >
>> > > USB CDC support is not initializing.
>> > >
>> > > When I plug the USB on the board, I have the following dmesg response
>> > > in
>> > Linux:
>> > >
>> > > [517062.075048] usb usb1-port2: attempt power cycle
>> > > [517062.726922] usb 1-2: new full-speed USB device number 47 using
>> > xhci_hcd
>> > > [517062.727170] usb 1-2: Device not responding to setup address.
>> > > [517062.935148] usb 1-2: Device not responding to setup address.
>> > > [517063.142906] usb 1-2: device not accepting address 47, error -71
>> > > [517063.270916] usb 1-2: new full-speed USB device number 48 using
>> > xhci_hcd
>> > > [517063.271141] usb 1-2: Device not responding to setup address.
>> > > [517063.479134] usb 1-2: Device not responding to setup address.
>> > >
>> > > When I run stm32f4discovery:usbnsh on my discovery board, it works.
>> > >
>> > > I compared the defconfig from the base project and from mine and I
>> > > believe I have initialized everything that is related to the USB.
>> > >
>> > > Here is the defconfig for my board:
>> > >
>> > > #
>> > > # 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_FPU is not set
>> > > # CONFIG_MMCSD_MMCSUPPORT is not set
>> > > # CONFIG_MMCSD_SPI is not set
>> > > # CONFIG_NSH_ARGCAT is not set
>> > > # CONFIG_NSH_CMDOPT_HEXDUMP is not set
>> > > # CONFIG_NSH_CMDPARMS is not set
>> > > CONFIG_ADC=y
>> > > CONFIG_ANALOG=y
>> > > CONFIG_ARCH="arm"
>> > > CONFIG_ARCH_BOARD="phi-innovations"
>> > > CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
>> > > CONFIG_ARCH_CHIP="stm32"
>> > > CONFIG_ARCH_CHIP_STM32=y
>> > > CONFIG_ARCH_CHIP_STM32F407VG=y
>> > > CONFIG_ARCH_STACKDUMP=y
>> > > CONFIG_ARMV7M_MEMCPY=y
>> > > CONFIG_BOARDCTL_RESET=y
>> > > CONFIG_BOARDCTL_UNIQUEID=y
>> > > CONFIG_BOARDCTL_USBDEVCTRL=y
>> > > CONFIG_BOARD_LOOPSPERMSEC=16717
>> > > CONFIG_BUILTIN=y
>> > > CONFIG_CDCACM=y
>> > > CONFIG_CDCACM_CONSOLE=y
>> > > CONFIG_CDCACM_RXBUFSIZE=256
>> > > CONFIG_CDCACM_TXBUFSIZE=256
>> > > CONFIG_CLOCK_MONOTONIC=y
>> > > CONFIG_CONSOLE_SYSLOG=y
>> > > CONFIG_DEBUG_ASSERTIONS=y
>> > > CONFIG_DEBUG_DMA=y
>> > > CONFIG_DEBUG_DMA_ERROR=y
>> > > CONFIG_DEBUG_DMA_INFO=y
>> > > CONFIG_DEBUG_DMA_WARN=y
>> > > CONFIG_DEBUG_ERROR=y
>> > > CONFIG_DEBUG_FEATURES=y
>> > > CONFIG_DEBUG_FS=y
>> > > CONFIG_DEBUG_FS_ERROR=y
>> > > CONFIG_DEBUG_FS_WARN=y
>> > > CONFIG_DEBUG_FULLOPT=y
>> > > CONFIG_DEBUG_HARDFAULT_ALERT=y
>> > > CONFIG_DEBUG_INFO=y
>> > > CONFIG_DEBUG_NET=y
>> > > CONFIG_DEBUG_NET_ERROR=y
>> > > CONFIG_DEBUG_NET_INFO=y
>> > > CONFIG_DEBUG_NET_WARN=y
>> > > CONFIG_DEBUG_RTC=y
>> > > CONFIG_DEBUG_RTC_ERROR=y
>> > > CONFIG_DEBUG_RTC_INFO=y
>> > > CONFIG_DEBUG_RTC_WARN=y
>> > > CONFIG_DEBUG_SYMBOLS=y
>> > > CONFIG_DEBUG_WARN=y
>> > > CONFIG_DEV_GPIO=y
>> > > CONFIG_ETH0_PHY_LAN8742A=y
>> > > CONFIG_EXAMPLES_PPPD=y
>> > > CONFIG_FAT_LCNAMES=y
>> > > CONFIG_FAT_LFN=y
>> > > CONFIG_FS_FAT=y
>> > > CONFIG_FS_PROCFS=y
>> > > CONFIG_FS_SMARTFS=y
>> > > CONFIG_HAVE_CXX=y
>> > > CONFIG_HAVE_CXXINITIALIZE=y
>> > > CONFIG_HEAP_COLORATION=y
>> > > CONFIG_IDLETHREAD_STACKSIZE=2048
>> > > CONFIG_INTELHEX_BINARY=y
>> > > CONFIG_IOEXPANDER=y
>> > > CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
>> > > CONFIG_MAX_TASKS=16
>> > > CONFIG_MMCSD=y
>> > > CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
>> > > CONFIG_MMCSD_SDIO=y
>> > > CONFIG_MTD=y
>> > > CONFIG_MTD_MX25L=y
>> > > CONFIG_MTD_SMART=y
>> > > CONFIG_MTD_SMART_FSCK=y
>> > > CONFIG_MX25L_SPIFREQUENCY=21000000
>> > > CONFIG_NET=y
>> > > CONFIG_NETDB_DNSCLIENT=y
>> > > CONFIG_NETINIT_DEBUG=y
>> > > CONFIG_NETINIT_DHCPC=y
>> > > CONFIG_NETINIT_DNS=y
>> > > CONFIG_NETINIT_DNSIPADDR=0x08080808
>> > > CONFIG_NETINIT_DRIPADDR=0x0a010101
>> > > CONFIG_NETINIT_NOMAC=y
>> > > CONFIG_NETINIT_THREAD=y
>> > > CONFIG_NETUTILS_DHCPC=y
>> > > CONFIG_NETUTILS_NETCAT=y
>> > > CONFIG_NETUTILS_PPPD_PAP=y
>> > > CONFIG_NET_ARP_DUMP=y
>> > > CONFIG_NET_ARP_SEND=y
>> > > CONFIG_NET_BROADCAST=y
>> > > CONFIG_NET_ETH_PKTSIZE=1294
>> > > CONFIG_NET_ICMP=y
>> > > CONFIG_NET_ICMP_SOCKET=y
>> > > CONFIG_NET_SOCKOPTS=y
>> > > CONFIG_NET_SOLINGER=y
>> > > CONFIG_NET_STATISTICS=y
>> > > CONFIG_NET_TCP=y
>> > > CONFIG_NET_TCPBACKLOG=y
>> > > CONFIG_NET_TCPURGDATA=y
>> > > CONFIG_NET_TCP_KEEPALIVE=y
>> > > CONFIG_NET_TCP_WRITE_BUFFERS=y
>> > > CONFIG_NET_UDP=y
>> > > CONFIG_NET_UDP_CHECKSUMS=y
>> > > CONFIG_NFILE_DESCRIPTORS=8
>> > > CONFIG_NSH_ARCHINIT=y
>> > > CONFIG_NSH_BUILTIN_APPS=y
>> > > CONFIG_NSH_DISABLE_LOSMART=y
>> > > CONFIG_NSH_FILEIOSIZE=512
>> > > CONFIG_NSH_LINELEN=64
>> > > CONFIG_NSH_PROMPT_STRING="nsh$ "
>> > > CONFIG_NSH_READLINE=y
>> > > CONFIG_PREALLOC_TIMERS=4
>> > > CONFIG_RAM_SIZE=114688
>> > > CONFIG_RAM_START=0x20000000
>> > > CONFIG_RAW_BINARY=y
>> > > CONFIG_RR_INTERVAL=200
>> > > CONFIG_RTC=y
>> > > CONFIG_RTC_EXTERNAL=y
>> > > CONFIG_RTC_PCF8563=y
>> > > CONFIG_SCHED_HPWORK=y
>> > > CONFIG_SCHED_HPWORKPRIORITY=192
>> > > CONFIG_SCHED_WAITPID=y
>> > > CONFIG_SDCLONE_DISABLE=y
>> > > CONFIG_STACK_COLORATION=y
>> > > CONFIG_START_DAY=13
>> > > CONFIG_START_MONTH=9
>> > > CONFIG_START_YEAR=2014
>> > > CONFIG_STM32F4DISBB=y
>> > > CONFIG_STM32_ADC1=y
>> > > CONFIG_STM32_DMA1=y
>> > > CONFIG_STM32_DMA2=y
>> > > CONFIG_STM32_DMACAPABLE=y
>> > > CONFIG_STM32_ETHMAC=y
>> > > CONFIG_STM32_I2C1=y
>> > > CONFIG_STM32_JTAG_SW_ENABLE=y
>> > > CONFIG_STM32_OTGFS=y
>> > > CONFIG_STM32_PHYADDR=0
>> > > CONFIG_STM32_PHYSR=31
>> > > CONFIG_STM32_PHYSR_100FD=0x0018
>> > > CONFIG_STM32_PHYSR_100HD=0x0008
>> > > CONFIG_STM32_PHYSR_10FD=0x0014
>> > > CONFIG_STM32_PHYSR_10HD=0x0004
>> > > CONFIG_STM32_PHYSR_ALTCONFIG=y
>> > > CONFIG_STM32_PHYSR_ALTMODE=0x001c
>> > > CONFIG_STM32_PWR=y
>> > > CONFIG_STM32_RMII_EXTCLK=y
>> > > CONFIG_STM32_SDIO=y
>> > > CONFIG_STM32_SPI1=y
>> > > CONFIG_STM32_USART1=y
>> > > CONFIG_STM32_USART2=y
>> > > CONFIG_STM32_USART3=y
>> > > CONFIG_STM32_USART6=y
>> > > CONFIG_SYSTEM_NSH=y
>> > > CONFIG_SYSTEM_PING=y
>> > > CONFIG_USART2_IFLOWCONTROL=y
>> > > CONFIG_USART2_OFLOWCONTROL=y
>> > > CONFIG_USART3_RS485=y
>> > > CONFIG_USART6_RXBUFSIZE=64
>> > > CONFIG_USART6_TXBUFSIZE=64
>> > > CONFIG_USBDEV=y
>> > > CONFIG_USER_ENTRYPOINT="nsh_main"
>> > >
>> > > I believe that there is something missing or wrong in my
>> > > configuration, but I couldn't find what it is.
>> > >
>> > > Can anybody give me some advice on how to solve this issue?
>> > >
>> > > Best regards,
>> > >
>> > > Flavio
>> > >
>> > >
>> > > --
>> > > Flavio de Castro Alves Filho
>> > >
>> > > flavio.alves@gmail.com
>> > > Twitter: http://twitter.com/#!/fraviofii
>> > > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>> >
>> >
>> >
>> > --
>> > Flavio de Castro Alves Filho
>> >
>> > flavio.alves@gmail.com
>> > Twitter: http://twitter.com/#!/fraviofii
>> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>> >
>
>
>
> --
> Flavio de Castro Alves Filho
>
> flavio.alves@gmail.com
> Twitter: http://twitter.com/#!/fraviofii
> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Flavio Castro Alves Filho <fl...@gmail.com>.
Thank you very much for your fast response.

I checked the boot calls and they are the same, regarding USB initialization.

I compared the include/nuttx/config.h files too ... at least regarding
USB, I couldn't see anything critical.

The development approach that I am working was exactly starting with
stm32discovery board and increasing features. Maybe I have to restart,
checking first the USB.

Best regards,

Flavio

Em dom., 17 de jan. de 2021 às 11:39, Grr <ge...@gmail.com> escreveu:
>
> What you can do is compare .config generated from that defconfig to .config
> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
> the differences. You can also compare include/nuttx/config.h from both
> configs
>
> Another approach is to start from discovery config and do the modifications
> for your board. After you have it working, clone the config to a different
> board name. With "make savedefconfig" you can save your working defconfig
>
> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
> flavio.alves@gmail.com>) escribió:
>
> > As an additional information, if I load the STM32F4DISCO on my board, USB
> > works.
> >
> > Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
> > <fl...@gmail.com> escreveu:
> > >
> > > Hello,
> > >
> > > I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> > > microcontroller is the STM32F407VET6.
> > >
> > > USB CDC support is not initializing.
> > >
> > > When I plug the USB on the board, I have the following dmesg response in
> > Linux:
> > >
> > > [517062.075048] usb usb1-port2: attempt power cycle
> > > [517062.726922] usb 1-2: new full-speed USB device number 47 using
> > xhci_hcd
> > > [517062.727170] usb 1-2: Device not responding to setup address.
> > > [517062.935148] usb 1-2: Device not responding to setup address.
> > > [517063.142906] usb 1-2: device not accepting address 47, error -71
> > > [517063.270916] usb 1-2: new full-speed USB device number 48 using
> > xhci_hcd
> > > [517063.271141] usb 1-2: Device not responding to setup address.
> > > [517063.479134] usb 1-2: Device not responding to setup address.
> > >
> > > When I run stm32f4discovery:usbnsh on my discovery board, it works.
> > >
> > > I compared the defconfig from the base project and from mine and I
> > > believe I have initialized everything that is related to the USB.
> > >
> > > Here is the defconfig for my board:
> > >
> > > #
> > > # 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_FPU is not set
> > > # CONFIG_MMCSD_MMCSUPPORT is not set
> > > # CONFIG_MMCSD_SPI is not set
> > > # CONFIG_NSH_ARGCAT is not set
> > > # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> > > # CONFIG_NSH_CMDPARMS is not set
> > > CONFIG_ADC=y
> > > CONFIG_ANALOG=y
> > > CONFIG_ARCH="arm"
> > > CONFIG_ARCH_BOARD="phi-innovations"
> > > CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
> > > CONFIG_ARCH_CHIP="stm32"
> > > CONFIG_ARCH_CHIP_STM32=y
> > > CONFIG_ARCH_CHIP_STM32F407VG=y
> > > CONFIG_ARCH_STACKDUMP=y
> > > CONFIG_ARMV7M_MEMCPY=y
> > > CONFIG_BOARDCTL_RESET=y
> > > CONFIG_BOARDCTL_UNIQUEID=y
> > > CONFIG_BOARDCTL_USBDEVCTRL=y
> > > CONFIG_BOARD_LOOPSPERMSEC=16717
> > > CONFIG_BUILTIN=y
> > > CONFIG_CDCACM=y
> > > CONFIG_CDCACM_CONSOLE=y
> > > CONFIG_CDCACM_RXBUFSIZE=256
> > > CONFIG_CDCACM_TXBUFSIZE=256
> > > CONFIG_CLOCK_MONOTONIC=y
> > > CONFIG_CONSOLE_SYSLOG=y
> > > CONFIG_DEBUG_ASSERTIONS=y
> > > CONFIG_DEBUG_DMA=y
> > > CONFIG_DEBUG_DMA_ERROR=y
> > > CONFIG_DEBUG_DMA_INFO=y
> > > CONFIG_DEBUG_DMA_WARN=y
> > > CONFIG_DEBUG_ERROR=y
> > > CONFIG_DEBUG_FEATURES=y
> > > CONFIG_DEBUG_FS=y
> > > CONFIG_DEBUG_FS_ERROR=y
> > > CONFIG_DEBUG_FS_WARN=y
> > > CONFIG_DEBUG_FULLOPT=y
> > > CONFIG_DEBUG_HARDFAULT_ALERT=y
> > > CONFIG_DEBUG_INFO=y
> > > CONFIG_DEBUG_NET=y
> > > CONFIG_DEBUG_NET_ERROR=y
> > > CONFIG_DEBUG_NET_INFO=y
> > > CONFIG_DEBUG_NET_WARN=y
> > > CONFIG_DEBUG_RTC=y
> > > CONFIG_DEBUG_RTC_ERROR=y
> > > CONFIG_DEBUG_RTC_INFO=y
> > > CONFIG_DEBUG_RTC_WARN=y
> > > CONFIG_DEBUG_SYMBOLS=y
> > > CONFIG_DEBUG_WARN=y
> > > CONFIG_DEV_GPIO=y
> > > CONFIG_ETH0_PHY_LAN8742A=y
> > > CONFIG_EXAMPLES_PPPD=y
> > > CONFIG_FAT_LCNAMES=y
> > > CONFIG_FAT_LFN=y
> > > CONFIG_FS_FAT=y
> > > CONFIG_FS_PROCFS=y
> > > CONFIG_FS_SMARTFS=y
> > > CONFIG_HAVE_CXX=y
> > > CONFIG_HAVE_CXXINITIALIZE=y
> > > CONFIG_HEAP_COLORATION=y
> > > CONFIG_IDLETHREAD_STACKSIZE=2048
> > > CONFIG_INTELHEX_BINARY=y
> > > CONFIG_IOEXPANDER=y
> > > CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
> > > CONFIG_MAX_TASKS=16
> > > CONFIG_MMCSD=y
> > > CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
> > > CONFIG_MMCSD_SDIO=y
> > > CONFIG_MTD=y
> > > CONFIG_MTD_MX25L=y
> > > CONFIG_MTD_SMART=y
> > > CONFIG_MTD_SMART_FSCK=y
> > > CONFIG_MX25L_SPIFREQUENCY=21000000
> > > CONFIG_NET=y
> > > CONFIG_NETDB_DNSCLIENT=y
> > > CONFIG_NETINIT_DEBUG=y
> > > CONFIG_NETINIT_DHCPC=y
> > > CONFIG_NETINIT_DNS=y
> > > CONFIG_NETINIT_DNSIPADDR=0x08080808
> > > CONFIG_NETINIT_DRIPADDR=0x0a010101
> > > CONFIG_NETINIT_NOMAC=y
> > > CONFIG_NETINIT_THREAD=y
> > > CONFIG_NETUTILS_DHCPC=y
> > > CONFIG_NETUTILS_NETCAT=y
> > > CONFIG_NETUTILS_PPPD_PAP=y
> > > CONFIG_NET_ARP_DUMP=y
> > > CONFIG_NET_ARP_SEND=y
> > > CONFIG_NET_BROADCAST=y
> > > CONFIG_NET_ETH_PKTSIZE=1294
> > > CONFIG_NET_ICMP=y
> > > CONFIG_NET_ICMP_SOCKET=y
> > > CONFIG_NET_SOCKOPTS=y
> > > CONFIG_NET_SOLINGER=y
> > > CONFIG_NET_STATISTICS=y
> > > CONFIG_NET_TCP=y
> > > CONFIG_NET_TCPBACKLOG=y
> > > CONFIG_NET_TCPURGDATA=y
> > > CONFIG_NET_TCP_KEEPALIVE=y
> > > CONFIG_NET_TCP_WRITE_BUFFERS=y
> > > CONFIG_NET_UDP=y
> > > CONFIG_NET_UDP_CHECKSUMS=y
> > > CONFIG_NFILE_DESCRIPTORS=8
> > > CONFIG_NSH_ARCHINIT=y
> > > CONFIG_NSH_BUILTIN_APPS=y
> > > CONFIG_NSH_DISABLE_LOSMART=y
> > > CONFIG_NSH_FILEIOSIZE=512
> > > CONFIG_NSH_LINELEN=64
> > > CONFIG_NSH_PROMPT_STRING="nsh$ "
> > > CONFIG_NSH_READLINE=y
> > > CONFIG_PREALLOC_TIMERS=4
> > > CONFIG_RAM_SIZE=114688
> > > CONFIG_RAM_START=0x20000000
> > > CONFIG_RAW_BINARY=y
> > > CONFIG_RR_INTERVAL=200
> > > CONFIG_RTC=y
> > > CONFIG_RTC_EXTERNAL=y
> > > CONFIG_RTC_PCF8563=y
> > > CONFIG_SCHED_HPWORK=y
> > > CONFIG_SCHED_HPWORKPRIORITY=192
> > > CONFIG_SCHED_WAITPID=y
> > > CONFIG_SDCLONE_DISABLE=y
> > > CONFIG_STACK_COLORATION=y
> > > CONFIG_START_DAY=13
> > > CONFIG_START_MONTH=9
> > > CONFIG_START_YEAR=2014
> > > CONFIG_STM32F4DISBB=y
> > > CONFIG_STM32_ADC1=y
> > > CONFIG_STM32_DMA1=y
> > > CONFIG_STM32_DMA2=y
> > > CONFIG_STM32_DMACAPABLE=y
> > > CONFIG_STM32_ETHMAC=y
> > > CONFIG_STM32_I2C1=y
> > > CONFIG_STM32_JTAG_SW_ENABLE=y
> > > CONFIG_STM32_OTGFS=y
> > > CONFIG_STM32_PHYADDR=0
> > > CONFIG_STM32_PHYSR=31
> > > CONFIG_STM32_PHYSR_100FD=0x0018
> > > CONFIG_STM32_PHYSR_100HD=0x0008
> > > CONFIG_STM32_PHYSR_10FD=0x0014
> > > CONFIG_STM32_PHYSR_10HD=0x0004
> > > CONFIG_STM32_PHYSR_ALTCONFIG=y
> > > CONFIG_STM32_PHYSR_ALTMODE=0x001c
> > > CONFIG_STM32_PWR=y
> > > CONFIG_STM32_RMII_EXTCLK=y
> > > CONFIG_STM32_SDIO=y
> > > CONFIG_STM32_SPI1=y
> > > CONFIG_STM32_USART1=y
> > > CONFIG_STM32_USART2=y
> > > CONFIG_STM32_USART3=y
> > > CONFIG_STM32_USART6=y
> > > CONFIG_SYSTEM_NSH=y
> > > CONFIG_SYSTEM_PING=y
> > > CONFIG_USART2_IFLOWCONTROL=y
> > > CONFIG_USART2_OFLOWCONTROL=y
> > > CONFIG_USART3_RS485=y
> > > CONFIG_USART6_RXBUFSIZE=64
> > > CONFIG_USART6_TXBUFSIZE=64
> > > CONFIG_USBDEV=y
> > > CONFIG_USER_ENTRYPOINT="nsh_main"
> > >
> > > I believe that there is something missing or wrong in my
> > > configuration, but I couldn't find what it is.
> > >
> > > Can anybody give me some advice on how to solve this issue?
> > >
> > > Best regards,
> > >
> > > Flavio
> > >
> > >
> > > --
> > > Flavio de Castro Alves Filho
> > >
> > > flavio.alves@gmail.com
> > > Twitter: http://twitter.com/#!/fraviofii
> > > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >
> >
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.alves@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >



-- 
Flavio de Castro Alves Filho

flavio.alves@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Grr <ge...@gmail.com>.
What you can do is compare .config generated from that defconfig to .config
generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
the differences. You can also compare include/nuttx/config.h from both
configs

Another approach is to start from discovery config and do the modifications
for your board. After you have it working, clone the config to a different
board name. With "make savedefconfig" you can save your working defconfig

El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
flavio.alves@gmail.com>) escribió:

> As an additional information, if I load the STM32F4DISCO on my board, USB
> works.
>
> Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
> <fl...@gmail.com> escreveu:
> >
> > Hello,
> >
> > I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> > microcontroller is the STM32F407VET6.
> >
> > USB CDC support is not initializing.
> >
> > When I plug the USB on the board, I have the following dmesg response in
> Linux:
> >
> > [517062.075048] usb usb1-port2: attempt power cycle
> > [517062.726922] usb 1-2: new full-speed USB device number 47 using
> xhci_hcd
> > [517062.727170] usb 1-2: Device not responding to setup address.
> > [517062.935148] usb 1-2: Device not responding to setup address.
> > [517063.142906] usb 1-2: device not accepting address 47, error -71
> > [517063.270916] usb 1-2: new full-speed USB device number 48 using
> xhci_hcd
> > [517063.271141] usb 1-2: Device not responding to setup address.
> > [517063.479134] usb 1-2: Device not responding to setup address.
> >
> > When I run stm32f4discovery:usbnsh on my discovery board, it works.
> >
> > I compared the defconfig from the base project and from mine and I
> > believe I have initialized everything that is related to the USB.
> >
> > Here is the defconfig for my board:
> >
> > #
> > # 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_FPU is not set
> > # CONFIG_MMCSD_MMCSUPPORT is not set
> > # CONFIG_MMCSD_SPI is not set
> > # CONFIG_NSH_ARGCAT is not set
> > # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> > # CONFIG_NSH_CMDPARMS is not set
> > CONFIG_ADC=y
> > CONFIG_ANALOG=y
> > CONFIG_ARCH="arm"
> > CONFIG_ARCH_BOARD="phi-innovations"
> > CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
> > CONFIG_ARCH_CHIP="stm32"
> > CONFIG_ARCH_CHIP_STM32=y
> > CONFIG_ARCH_CHIP_STM32F407VG=y
> > CONFIG_ARCH_STACKDUMP=y
> > CONFIG_ARMV7M_MEMCPY=y
> > CONFIG_BOARDCTL_RESET=y
> > CONFIG_BOARDCTL_UNIQUEID=y
> > CONFIG_BOARDCTL_USBDEVCTRL=y
> > CONFIG_BOARD_LOOPSPERMSEC=16717
> > CONFIG_BUILTIN=y
> > CONFIG_CDCACM=y
> > CONFIG_CDCACM_CONSOLE=y
> > CONFIG_CDCACM_RXBUFSIZE=256
> > CONFIG_CDCACM_TXBUFSIZE=256
> > CONFIG_CLOCK_MONOTONIC=y
> > CONFIG_CONSOLE_SYSLOG=y
> > CONFIG_DEBUG_ASSERTIONS=y
> > CONFIG_DEBUG_DMA=y
> > CONFIG_DEBUG_DMA_ERROR=y
> > CONFIG_DEBUG_DMA_INFO=y
> > CONFIG_DEBUG_DMA_WARN=y
> > CONFIG_DEBUG_ERROR=y
> > CONFIG_DEBUG_FEATURES=y
> > CONFIG_DEBUG_FS=y
> > CONFIG_DEBUG_FS_ERROR=y
> > CONFIG_DEBUG_FS_WARN=y
> > CONFIG_DEBUG_FULLOPT=y
> > CONFIG_DEBUG_HARDFAULT_ALERT=y
> > CONFIG_DEBUG_INFO=y
> > CONFIG_DEBUG_NET=y
> > CONFIG_DEBUG_NET_ERROR=y
> > CONFIG_DEBUG_NET_INFO=y
> > CONFIG_DEBUG_NET_WARN=y
> > CONFIG_DEBUG_RTC=y
> > CONFIG_DEBUG_RTC_ERROR=y
> > CONFIG_DEBUG_RTC_INFO=y
> > CONFIG_DEBUG_RTC_WARN=y
> > CONFIG_DEBUG_SYMBOLS=y
> > CONFIG_DEBUG_WARN=y
> > CONFIG_DEV_GPIO=y
> > CONFIG_ETH0_PHY_LAN8742A=y
> > CONFIG_EXAMPLES_PPPD=y
> > CONFIG_FAT_LCNAMES=y
> > CONFIG_FAT_LFN=y
> > CONFIG_FS_FAT=y
> > CONFIG_FS_PROCFS=y
> > CONFIG_FS_SMARTFS=y
> > CONFIG_HAVE_CXX=y
> > CONFIG_HAVE_CXXINITIALIZE=y
> > CONFIG_HEAP_COLORATION=y
> > CONFIG_IDLETHREAD_STACKSIZE=2048
> > CONFIG_INTELHEX_BINARY=y
> > CONFIG_IOEXPANDER=y
> > CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
> > CONFIG_MAX_TASKS=16
> > CONFIG_MMCSD=y
> > CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
> > CONFIG_MMCSD_SDIO=y
> > CONFIG_MTD=y
> > CONFIG_MTD_MX25L=y
> > CONFIG_MTD_SMART=y
> > CONFIG_MTD_SMART_FSCK=y
> > CONFIG_MX25L_SPIFREQUENCY=21000000
> > CONFIG_NET=y
> > CONFIG_NETDB_DNSCLIENT=y
> > CONFIG_NETINIT_DEBUG=y
> > CONFIG_NETINIT_DHCPC=y
> > CONFIG_NETINIT_DNS=y
> > CONFIG_NETINIT_DNSIPADDR=0x08080808
> > CONFIG_NETINIT_DRIPADDR=0x0a010101
> > CONFIG_NETINIT_NOMAC=y
> > CONFIG_NETINIT_THREAD=y
> > CONFIG_NETUTILS_DHCPC=y
> > CONFIG_NETUTILS_NETCAT=y
> > CONFIG_NETUTILS_PPPD_PAP=y
> > CONFIG_NET_ARP_DUMP=y
> > CONFIG_NET_ARP_SEND=y
> > CONFIG_NET_BROADCAST=y
> > CONFIG_NET_ETH_PKTSIZE=1294
> > CONFIG_NET_ICMP=y
> > CONFIG_NET_ICMP_SOCKET=y
> > CONFIG_NET_SOCKOPTS=y
> > CONFIG_NET_SOLINGER=y
> > CONFIG_NET_STATISTICS=y
> > CONFIG_NET_TCP=y
> > CONFIG_NET_TCPBACKLOG=y
> > CONFIG_NET_TCPURGDATA=y
> > CONFIG_NET_TCP_KEEPALIVE=y
> > CONFIG_NET_TCP_WRITE_BUFFERS=y
> > CONFIG_NET_UDP=y
> > CONFIG_NET_UDP_CHECKSUMS=y
> > CONFIG_NFILE_DESCRIPTORS=8
> > CONFIG_NSH_ARCHINIT=y
> > CONFIG_NSH_BUILTIN_APPS=y
> > CONFIG_NSH_DISABLE_LOSMART=y
> > CONFIG_NSH_FILEIOSIZE=512
> > CONFIG_NSH_LINELEN=64
> > CONFIG_NSH_PROMPT_STRING="nsh$ "
> > CONFIG_NSH_READLINE=y
> > CONFIG_PREALLOC_TIMERS=4
> > CONFIG_RAM_SIZE=114688
> > CONFIG_RAM_START=0x20000000
> > CONFIG_RAW_BINARY=y
> > CONFIG_RR_INTERVAL=200
> > CONFIG_RTC=y
> > CONFIG_RTC_EXTERNAL=y
> > CONFIG_RTC_PCF8563=y
> > CONFIG_SCHED_HPWORK=y
> > CONFIG_SCHED_HPWORKPRIORITY=192
> > CONFIG_SCHED_WAITPID=y
> > CONFIG_SDCLONE_DISABLE=y
> > CONFIG_STACK_COLORATION=y
> > CONFIG_START_DAY=13
> > CONFIG_START_MONTH=9
> > CONFIG_START_YEAR=2014
> > CONFIG_STM32F4DISBB=y
> > CONFIG_STM32_ADC1=y
> > CONFIG_STM32_DMA1=y
> > CONFIG_STM32_DMA2=y
> > CONFIG_STM32_DMACAPABLE=y
> > CONFIG_STM32_ETHMAC=y
> > CONFIG_STM32_I2C1=y
> > CONFIG_STM32_JTAG_SW_ENABLE=y
> > CONFIG_STM32_OTGFS=y
> > CONFIG_STM32_PHYADDR=0
> > CONFIG_STM32_PHYSR=31
> > CONFIG_STM32_PHYSR_100FD=0x0018
> > CONFIG_STM32_PHYSR_100HD=0x0008
> > CONFIG_STM32_PHYSR_10FD=0x0014
> > CONFIG_STM32_PHYSR_10HD=0x0004
> > CONFIG_STM32_PHYSR_ALTCONFIG=y
> > CONFIG_STM32_PHYSR_ALTMODE=0x001c
> > CONFIG_STM32_PWR=y
> > CONFIG_STM32_RMII_EXTCLK=y
> > CONFIG_STM32_SDIO=y
> > CONFIG_STM32_SPI1=y
> > CONFIG_STM32_USART1=y
> > CONFIG_STM32_USART2=y
> > CONFIG_STM32_USART3=y
> > CONFIG_STM32_USART6=y
> > CONFIG_SYSTEM_NSH=y
> > CONFIG_SYSTEM_PING=y
> > CONFIG_USART2_IFLOWCONTROL=y
> > CONFIG_USART2_OFLOWCONTROL=y
> > CONFIG_USART3_RS485=y
> > CONFIG_USART6_RXBUFSIZE=64
> > CONFIG_USART6_TXBUFSIZE=64
> > CONFIG_USBDEV=y
> > CONFIG_USER_ENTRYPOINT="nsh_main"
> >
> > I believe that there is something missing or wrong in my
> > configuration, but I couldn't find what it is.
> >
> > Can anybody give me some advice on how to solve this issue?
> >
> > Best regards,
> >
> > Flavio
> >
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.alves@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>
>
>
> --
> Flavio de Castro Alves Filho
>
> flavio.alves@gmail.com
> Twitter: http://twitter.com/#!/fraviofii
> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Flavio Castro Alves Filho <fl...@gmail.com>.
As an additional information, if I load the STM32F4DISCO on my board, USB works.

Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
<fl...@gmail.com> escreveu:
>
> Hello,
>
> I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> microcontroller is the STM32F407VET6.
>
> USB CDC support is not initializing.
>
> When I plug the USB on the board, I have the following dmesg response in Linux:
>
> [517062.075048] usb usb1-port2: attempt power cycle
> [517062.726922] usb 1-2: new full-speed USB device number 47 using xhci_hcd
> [517062.727170] usb 1-2: Device not responding to setup address.
> [517062.935148] usb 1-2: Device not responding to setup address.
> [517063.142906] usb 1-2: device not accepting address 47, error -71
> [517063.270916] usb 1-2: new full-speed USB device number 48 using xhci_hcd
> [517063.271141] usb 1-2: Device not responding to setup address.
> [517063.479134] usb 1-2: Device not responding to setup address.
>
> When I run stm32f4discovery:usbnsh on my discovery board, it works.
>
> I compared the defconfig from the base project and from mine and I
> believe I have initialized everything that is related to the USB.
>
> Here is the defconfig for my board:
>
> #
> # 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_FPU is not set
> # CONFIG_MMCSD_MMCSUPPORT is not set
> # CONFIG_MMCSD_SPI is not set
> # CONFIG_NSH_ARGCAT is not set
> # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> # CONFIG_NSH_CMDPARMS is not set
> CONFIG_ADC=y
> CONFIG_ANALOG=y
> CONFIG_ARCH="arm"
> CONFIG_ARCH_BOARD="phi-innovations"
> CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
> CONFIG_ARCH_CHIP="stm32"
> CONFIG_ARCH_CHIP_STM32=y
> CONFIG_ARCH_CHIP_STM32F407VG=y
> CONFIG_ARCH_STACKDUMP=y
> CONFIG_ARMV7M_MEMCPY=y
> CONFIG_BOARDCTL_RESET=y
> CONFIG_BOARDCTL_UNIQUEID=y
> CONFIG_BOARDCTL_USBDEVCTRL=y
> CONFIG_BOARD_LOOPSPERMSEC=16717
> CONFIG_BUILTIN=y
> CONFIG_CDCACM=y
> CONFIG_CDCACM_CONSOLE=y
> CONFIG_CDCACM_RXBUFSIZE=256
> CONFIG_CDCACM_TXBUFSIZE=256
> CONFIG_CLOCK_MONOTONIC=y
> CONFIG_CONSOLE_SYSLOG=y
> CONFIG_DEBUG_ASSERTIONS=y
> CONFIG_DEBUG_DMA=y
> CONFIG_DEBUG_DMA_ERROR=y
> CONFIG_DEBUG_DMA_INFO=y
> CONFIG_DEBUG_DMA_WARN=y
> CONFIG_DEBUG_ERROR=y
> CONFIG_DEBUG_FEATURES=y
> CONFIG_DEBUG_FS=y
> CONFIG_DEBUG_FS_ERROR=y
> CONFIG_DEBUG_FS_WARN=y
> CONFIG_DEBUG_FULLOPT=y
> CONFIG_DEBUG_HARDFAULT_ALERT=y
> CONFIG_DEBUG_INFO=y
> CONFIG_DEBUG_NET=y
> CONFIG_DEBUG_NET_ERROR=y
> CONFIG_DEBUG_NET_INFO=y
> CONFIG_DEBUG_NET_WARN=y
> CONFIG_DEBUG_RTC=y
> CONFIG_DEBUG_RTC_ERROR=y
> CONFIG_DEBUG_RTC_INFO=y
> CONFIG_DEBUG_RTC_WARN=y
> CONFIG_DEBUG_SYMBOLS=y
> CONFIG_DEBUG_WARN=y
> CONFIG_DEV_GPIO=y
> CONFIG_ETH0_PHY_LAN8742A=y
> CONFIG_EXAMPLES_PPPD=y
> CONFIG_FAT_LCNAMES=y
> CONFIG_FAT_LFN=y
> CONFIG_FS_FAT=y
> CONFIG_FS_PROCFS=y
> CONFIG_FS_SMARTFS=y
> CONFIG_HAVE_CXX=y
> CONFIG_HAVE_CXXINITIALIZE=y
> CONFIG_HEAP_COLORATION=y
> CONFIG_IDLETHREAD_STACKSIZE=2048
> CONFIG_INTELHEX_BINARY=y
> CONFIG_IOEXPANDER=y
> CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
> CONFIG_MAX_TASKS=16
> CONFIG_MMCSD=y
> CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
> CONFIG_MMCSD_SDIO=y
> CONFIG_MTD=y
> CONFIG_MTD_MX25L=y
> CONFIG_MTD_SMART=y
> CONFIG_MTD_SMART_FSCK=y
> CONFIG_MX25L_SPIFREQUENCY=21000000
> CONFIG_NET=y
> CONFIG_NETDB_DNSCLIENT=y
> CONFIG_NETINIT_DEBUG=y
> CONFIG_NETINIT_DHCPC=y
> CONFIG_NETINIT_DNS=y
> CONFIG_NETINIT_DNSIPADDR=0x08080808
> CONFIG_NETINIT_DRIPADDR=0x0a010101
> CONFIG_NETINIT_NOMAC=y
> CONFIG_NETINIT_THREAD=y
> CONFIG_NETUTILS_DHCPC=y
> CONFIG_NETUTILS_NETCAT=y
> CONFIG_NETUTILS_PPPD_PAP=y
> CONFIG_NET_ARP_DUMP=y
> CONFIG_NET_ARP_SEND=y
> CONFIG_NET_BROADCAST=y
> CONFIG_NET_ETH_PKTSIZE=1294
> CONFIG_NET_ICMP=y
> CONFIG_NET_ICMP_SOCKET=y
> CONFIG_NET_SOCKOPTS=y
> CONFIG_NET_SOLINGER=y
> CONFIG_NET_STATISTICS=y
> CONFIG_NET_TCP=y
> CONFIG_NET_TCPBACKLOG=y
> CONFIG_NET_TCPURGDATA=y
> CONFIG_NET_TCP_KEEPALIVE=y
> CONFIG_NET_TCP_WRITE_BUFFERS=y
> CONFIG_NET_UDP=y
> CONFIG_NET_UDP_CHECKSUMS=y
> CONFIG_NFILE_DESCRIPTORS=8
> CONFIG_NSH_ARCHINIT=y
> CONFIG_NSH_BUILTIN_APPS=y
> CONFIG_NSH_DISABLE_LOSMART=y
> CONFIG_NSH_FILEIOSIZE=512
> CONFIG_NSH_LINELEN=64
> CONFIG_NSH_PROMPT_STRING="nsh$ "
> CONFIG_NSH_READLINE=y
> CONFIG_PREALLOC_TIMERS=4
> CONFIG_RAM_SIZE=114688
> CONFIG_RAM_START=0x20000000
> CONFIG_RAW_BINARY=y
> CONFIG_RR_INTERVAL=200
> CONFIG_RTC=y
> CONFIG_RTC_EXTERNAL=y
> CONFIG_RTC_PCF8563=y
> CONFIG_SCHED_HPWORK=y
> CONFIG_SCHED_HPWORKPRIORITY=192
> CONFIG_SCHED_WAITPID=y
> CONFIG_SDCLONE_DISABLE=y
> CONFIG_STACK_COLORATION=y
> CONFIG_START_DAY=13
> CONFIG_START_MONTH=9
> CONFIG_START_YEAR=2014
> CONFIG_STM32F4DISBB=y
> CONFIG_STM32_ADC1=y
> CONFIG_STM32_DMA1=y
> CONFIG_STM32_DMA2=y
> CONFIG_STM32_DMACAPABLE=y
> CONFIG_STM32_ETHMAC=y
> CONFIG_STM32_I2C1=y
> CONFIG_STM32_JTAG_SW_ENABLE=y
> CONFIG_STM32_OTGFS=y
> CONFIG_STM32_PHYADDR=0
> CONFIG_STM32_PHYSR=31
> CONFIG_STM32_PHYSR_100FD=0x0018
> CONFIG_STM32_PHYSR_100HD=0x0008
> CONFIG_STM32_PHYSR_10FD=0x0014
> CONFIG_STM32_PHYSR_10HD=0x0004
> CONFIG_STM32_PHYSR_ALTCONFIG=y
> CONFIG_STM32_PHYSR_ALTMODE=0x001c
> CONFIG_STM32_PWR=y
> CONFIG_STM32_RMII_EXTCLK=y
> CONFIG_STM32_SDIO=y
> CONFIG_STM32_SPI1=y
> CONFIG_STM32_USART1=y
> CONFIG_STM32_USART2=y
> CONFIG_STM32_USART3=y
> CONFIG_STM32_USART6=y
> CONFIG_SYSTEM_NSH=y
> CONFIG_SYSTEM_PING=y
> CONFIG_USART2_IFLOWCONTROL=y
> CONFIG_USART2_OFLOWCONTROL=y
> CONFIG_USART3_RS485=y
> CONFIG_USART6_RXBUFSIZE=64
> CONFIG_USART6_TXBUFSIZE=64
> CONFIG_USBDEV=y
> CONFIG_USER_ENTRYPOINT="nsh_main"
>
> I believe that there is something missing or wrong in my
> configuration, but I couldn't find what it is.
>
> Can anybody give me some advice on how to solve this issue?
>
> Best regards,
>
> Flavio
>
>
> --
> Flavio de Castro Alves Filho
>
> flavio.alves@gmail.com
> Twitter: http://twitter.com/#!/fraviofii
> LinkedIn profile: www.linkedin.com/in/flaviocastroalves



-- 
Flavio de Castro Alves Filho

flavio.alves@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

Posted by Nathan Hartman <ha...@gmail.com>.
On Sun, Jan 17, 2021 at 8:43 AM Flavio Castro Alves Filho <
flavio.alves@gmail.com> wrote:

> Hello,
>
> I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> microcontroller is the STM32F407VET6.
>
> USB CDC support is not initializing.
>
> When I plug the USB on the board, I have the following dmesg response in
> Linux:
>
> [517062.075048] usb usb1-port2: attempt power cycle
> [517062.726922] usb 1-2: new full-speed USB device number 47 using xhci_hcd
> [517062.727170] usb 1-2: Device not responding to setup address.
> [517062.935148] usb 1-2: Device not responding to setup address.
> [517063.142906] usb 1-2: device not accepting address 47, error -71
> [517063.270916] usb 1-2: new full-speed USB device number 48 using xhci_hcd
> [517063.271141] usb 1-2: Device not responding to setup address.
> [517063.479134] usb 1-2: Device not responding to setup address.
>
> When I run stm32f4discovery:usbnsh on my discovery board, it works.
>
> I compared the defconfig from the base project and from mine and I
> believe I have initialized everything that is related to the USB.


Also try checking the board init code of
stm32f4discovery:usbnsh and see if there are any driver initialization
calls that you forgot to do in your board?

Nathan