ChibiOS 3.0.0 and serial over usb

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

kamil
Posts: 15
Joined: Mon Oct 13, 2014 10:32 pm

ChibiOS 3.0.0 and serial over usb

Post 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?
vambwodonk
Posts: 15
Joined: Tue Oct 14, 2014 5:36 am

Re: ChibiOS 3.0.0 and serial over usb

Post 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,
kamil
Posts: 15
Joined: Mon Oct 13, 2014 10:32 pm

Re: ChibiOS 3.0.0 and serial over usb

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS 3.0.0 and serial over usb

Post 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
kamil
Posts: 15
Joined: Mon Oct 13, 2014 10:32 pm

Re: ChibiOS 3.0.0 and serial over usb

Post 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).
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ChibiOS 3.0.0 and serial over usb

Post 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
kamil
Posts: 15
Joined: Mon Oct 13, 2014 10:32 pm

Re: ChibiOS 3.0.0 and serial over usb

Post 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.
kamil
Posts: 15
Joined: Mon Oct 13, 2014 10:32 pm

Re: ChibiOS 3.0.0 and serial over usb

Post by kamil »

Or maybe some one has an keil project for stm32f4 with virtual com port? I think it will be very good.
vambwodonk
Posts: 15
Joined: Tue Oct 14, 2014 5:36 am

Re: ChibiOS 3.0.0 and serial over usb

Post 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,
kamil
Posts: 15
Joined: Mon Oct 13, 2014 10:32 pm

Re: ChibiOS 3.0.0 and serial over usb

Post 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?
Post Reply