Chibios-master/ testhal/Stm32f30x/USB-CDC not working
Moderator: RoccoMarco
-
manish2789
- Posts: 1
- Joined: Wed Jun 04, 2014 8:48 am
Chibios-master/ testhal/Stm32f30x/USB-CDC not working
Hello I am Manish Baing just started to learn ChibiOS .I am working on virtual COM port for STm32f3 discovery under linux platform using arm-none-eabi toolchain.I have tried ST-USB library ,compiled it but /dev/ttyACM0 device not generated .I have compiled Chibios project on the path chibios-master/testhal/STM32F30x/USB_CDC I suceesfully loaded the code into STM32f3 and red led blinks after few seconds.But /dev/ttyACM0 device not created .so what all things I need to change in above project..? or please give link of virtual com port for USB CDC with chibios for stm32f3 dicovery verified code.
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Chibios-master/ testhal/Stm32f30x/USB-CDC not working
Not sure, it works here but I am testing on Win7, probably it is something related to your Linux setup.
Giovanni
Giovanni
Re: Chibios-master/ testhal/Stm32f30x/USB-CDC not working
i'm on arch linux wth latest 3.14 kernel and everything work just fine.
Stupid question: did you connected the "user" USB port? What if you step into code? what lsusb and dmesg say?
here the code i use (please note sensor may not work due misconfgured register, solved yesterday but forgot to pull): https://github.com/MauroMombelli/testChibiOsStm32F3
Stupid question: did you connected the "user" USB port? What if you step into code? what lsusb and dmesg say?
here the code i use (please note sensor may not work due misconfgured register, solved yesterday but forgot to pull): https://github.com/MauroMombelli/testChibiOsStm32F3
Re: Chibios-master/ testhal/Stm32f30x/USB-CDC not working
USB-CDC works ok for me using the STM32F3 Discovery board.
I used it succesfully on the F3 Gizmo
http://r6500.blogspot.com.es/2014/04/presenting-f3-gizmo.html
You can check my code if you please at GitHub:
https://github.com/R6500/STM32F3_Gizmo
This is not directly the test-hal program but it should be similar.
I have just connected the Gizmo to a Linux computer and it works ok using screen on ttyACM0
In any case running the the CDC is sometimes tricky.
When developing with the debugger I usually disconnect the USB cable and connect it only when the program has started.
If the cable is connected when the program starts sometimes I have USB initialization problems.
If the board is connected out using the CDC connection (before the develompement phase) I usually get no problem.
Best regards
Vicente
I used it succesfully on the F3 Gizmo
http://r6500.blogspot.com.es/2014/04/presenting-f3-gizmo.html
You can check my code if you please at GitHub:
https://github.com/R6500/STM32F3_Gizmo
This is not directly the test-hal program but it should be similar.
I have just connected the Gizmo to a Linux computer and it works ok using screen on ttyACM0
In any case running the the CDC is sometimes tricky.
When developing with the debugger I usually disconnect the USB cable and connect it only when the program has started.
If the cable is connected when the program starts sometimes I have USB initialization problems.
If the board is connected out using the CDC connection (before the develompement phase) I usually get no problem.
Best regards
Vicente
Re: Chibios-master/ testhal/Stm32f30x/USB-CDC not working
@vincente, try with a usb_disconnect, a delay of some second(s), and then the code to connect. That shoud solve the board reset issue.
Re: Chibios-master/ testhal/Stm32f30x/USB-CDC not working
Thank's lesto.
I used to use the disconnect and delay method but was only one or two seconds and I could not get a reliable enough start on the STM32F4 Discovery board. On the other hand, the STM32F3 Discovery seems to be more reliable restarting the USB CDC while debugging.
I would try again with longer delays to see if it helps.
Another problem I face debugging while using USB-CDC is that every time you restart you need to open a new connection with the serial terminal. It's quite a pain as I need to close the connection, restart the program and open again from the terminal.
That's why when developing for serial communication I use a normal TTL serial channel and a FTDI cable that keeps the connection open between restarts. That makes the debugging easier.
Best regards
Vicente
I used to use the disconnect and delay method but was only one or two seconds and I could not get a reliable enough start on the STM32F4 Discovery board. On the other hand, the STM32F3 Discovery seems to be more reliable restarting the USB CDC while debugging.
I would try again with longer delays to see if it helps.
Another problem I face debugging while using USB-CDC is that every time you restart you need to open a new connection with the serial terminal. It's quite a pain as I need to close the connection, restart the program and open again from the terminal.
That's why when developing for serial communication I use a normal TTL serial channel and a FTDI cable that keeps the connection open between restarts. That makes the debugging easier.
Best regards
Vicente
Re: Chibios-master/ testhal/Stm32f30x/USB-CDC not working
and if you keep the tty* (or COM*) open it will spawn with the next free number.. i think that this cannot be easily done, if you are not a "usb driver insider".
sorry you should usbDisconnectBus() and usbStop(),if that still does not work i have no idea
sorry you should usbDisconnectBus() and usbStop(),if that still does not work i have no idea
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Chibios-master/ testhal/Stm32f30x/USB-CDC not working
If I remember well the F3 discovery has no control on the pullup so connect/disconnect have no effect.
Giovanni
Giovanni
Re: Chibios-master/ testhal/Stm32f30x/USB-CDC not working
F3 after resetseems fine, F4 is the problem, maybe on them it has effect