Page 1 of 2

ChibiOS 3.0.0 and serial over usb

Posted: Mon Oct 13, 2014 11:36 pm
by kamil
I'm trying to use virtual com port on the stm32f405rg with ChibiOS 3.0.0 (master branch in the git). As an example I use ARMCM4-STM32F407-LWIP-FATFS-USB from the demos folder, but It seems that this example is for oldest version of ChibiOS and virtual com port doesn't work.

So I want to ask:
Does virtual com port working in ChibiOS 3.0.0?
If it's working, is there an example?

Re: ChibiOS 3.0.0 and serial over usb

Posted: Tue Oct 14, 2014 6:47 am
by vambwodonk
Does virtual com port working in ChibiOS 3.0.0?

yes,
If it's working, is there an example?

I used usbcfg on demo project RT-STM32F407-DISCOVERY-MEMS,

Re: ChibiOS 3.0.0 and serial over usb

Posted: Tue Oct 14, 2014 1:53 pm
by kamil
vambwodonk wrote:
Does virtual com port working in ChibiOS 3.0.0?

yes,
If it's working, is there an example?

I used usbcfg on demo project RT-STM32F407-DISCOVERY-MEMS,


Thank you for answer, I've tried to make like in the example, but windows doesn't see virtual com port.
I've even tried to run RT-STM32F407-DISCOVERY-MEMS example, but it isn't work. Maybe because I use Keil, and I don't include files correctly.

Where is maybe an mistake? And maybe has someone virtual com port Keil project?

Re: ChibiOS 3.0.0 and serial over usb

Posted: Tue Oct 14, 2014 1:55 pm
by Giovanni
The code emulates an "ST Virtual Com Port".

I think this is the driver you need: http://www.st.com/web/en/catalog/tools/ ... pe=keyword

Giovanni

Re: ChibiOS 3.0.0 and serial over usb

Posted: Tue Oct 14, 2014 9:31 pm
by kamil
Giovanni wrote:The code emulates an "ST Virtual Com Port".

I think this is the driver you need: http://www.st.com/web/en/catalog/tools/ ... pe=keyword

Giovanni


Thanks for answer, but I've already installed this driver. Windows doesn't see board neither as com port nor even unknown device. There isn't any reaction, when connect board to the usb port.

Before I use stm's library and it worked in my board. Here is my project: http://zaripov.net/vcp_test.rar, maybe it will help (I tried to use 2.6.6 but it doesn't work anyway).

Re: ChibiOS 3.0.0 and serial over usb

Posted: Tue Oct 14, 2014 9:36 pm
by Giovanni
Probably your problem is the correct setup of board files, the drivers work perfectly on a variety of boards already. If you get no enumeration response from windows then probably there is a problem with the pullup resistor on DP, even just the resistor should trigger the enumeration process.

Giovanni

Re: ChibiOS 3.0.0 and serial over usb

Posted: Tue Oct 14, 2014 11:51 pm
by kamil
Giovanni wrote:Probably your problem is the correct setup of board files, the drivers work perfectly on a variety of boards already. If you get no enumeration response from windows then probably there is a problem with the pullup resistor on DP, even just the resistor should trigger the enumeration process.

Giovanni

Thanks for fast reply. Yes, I think you right - problem on the board files. But the pin configuration I thing is correct - i compare register values with the working example of virtual com port. But when I check RCC registers I found out that OTGFSEN bit in the AHB2ENR register or OTGHSEN in the AHB1ENR desn't set after driver initialization. I think that it is problem.

Re: ChibiOS 3.0.0 and serial over usb

Posted: Wed Oct 15, 2014 12:50 am
by kamil
Or maybe some one has an keil project for stm32f4 with virtual com port? I think it will be very good.

Re: ChibiOS 3.0.0 and serial over usb

Posted: Wed Oct 15, 2014 4:18 am
by vambwodonk
which board are you used for? If is STM32F4-Discovery must worked like a charm,
Lately i used some custom board STM32F407, and have some trouble with USB-CDC. After some search in google i found this topic, viewtopic.php?f=2&t=936
Yeah i Forgot to connect VBUS in my HW design :D , Then i disable detect VBUS in the usb_lld.h

Code: Select all

#define usb_lld_connect_bus(usbp) ((usbp)->otg->GCCFG |= GCCFG_VBUSBSEN )
#define usb_lld_disconnect_bus(usbp) ((usbp)->otg->GCCFG &= ~GCCFG_VBUSBSEN)


changed to,

Code: Select all

#define usb_lld_connect_bus(usbp) ((usbp)->otg->GCCFG |= GCCFG_NOVBUSSENS)
#define usb_lld_disconnect_bus(usbp) ((usbp)->otg->GCCFG &= ~GCCFG_NOVBUSSENS)


My USB-CDC can enumerated without sensing VBUS, :D

Arif,

Re: ChibiOS 3.0.0 and serial over usb

Posted: Wed Oct 15, 2014 12:18 pm
by kamil
vambwodonk wrote:which board are you used for? If is STM32F4-Discovery must worked like a charm,
Lately i used some custom board STM32F407, and have some trouble with USB-CDC. After some search in google i found this topic, viewtopic.php?f=2&t=936
Yeah i Forgot to connect VBUS in my HW design :D , Then i disable detect VBUS in the usb_lld.h

Code: Select all

#define usb_lld_connect_bus(usbp) ((usbp)->otg->GCCFG |= GCCFG_VBUSBSEN )
#define usb_lld_disconnect_bus(usbp) ((usbp)->otg->GCCFG &= ~GCCFG_VBUSBSEN)


changed to,

Code: Select all

#define usb_lld_connect_bus(usbp) ((usbp)->otg->GCCFG |= GCCFG_NOVBUSSENS)
#define usb_lld_disconnect_bus(usbp) ((usbp)->otg->GCCFG &= ~GCCFG_NOVBUSSENS)


My USB-CDC can enumerated without sensing VBUS, :D

Arif,


My board is core 407i: http://www.wvshare.com/product/Core407I.htm

Thank you for you answer. You was right. In my board I forgot to connect vbus to the PA9. If I connect VBUS to the PA9, the board is detected by windows, but only after about 30 seconds and as unknown device (device descriptor request failed). First I think that problem in usb cable or in drivers: I faced with such behavior before. But I try several cables and windows versions, but problem is exist. What else can I miss?