Weird USB behavior on Linux

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

Moderator: RoccoMarco

Post Reply
zamek
Posts: 14
Joined: Sat Mar 23, 2013 6:39 pm

Weird USB behavior on Linux

Post by zamek »

Hi All,

After a board reset, there is an approximately 30s timeout, during the port is (/dev/ttyACM0) is exist, but I cannot connect it. The gtkterm said: device or resource is busy. After 30s, I can connect it and everything is ok.

I use: Linux zamek 4.2.0-1-686-pae #1 SMP Debian 4.2.6-1 (2015-11-10) i686 GNU/Linux

and Chibios head from https://github.com/mabl/ChibiOS

here is the output of dmesg:
[ 5995.440081] usb 1-1: new full-speed USB device number 5 using uhci_hcd
[ 5995.613357] usb 1-1: New USB device found, idVendor=0483, idProduct=5740
[ 5995.613364] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5995.613368] usb 1-1: Product: ChibiOS/RT Virtual COM Port
[ 5995.613371] usb 1-1: Manufacturer: STMicroelectronics
[ 5995.613374] usb 1-1: SerialNumber: 310
[ 5995.617777] cdc_acm 1-1:1.0: ttyACM0: USB ACM device

I tried to increase/decrease the usb delay

Code: Select all

void connectConsole(void) {
    shellInit();
    sduObjectInit(&SDU1);
    sduStart(&SDU1, &serusbcfg);
    usbDisconnectBus(serusbcfg.usbp);
    chThdSleepMilliseconds(1000);                 //<----------- 10-2000 ms
    usbStart(serusbcfg.usbp, &usbcfg);
    usbConnectBus(serusbcfg.usbp);
}


but it couldn't helps.

Is there anybody, who has this weird behavior on Linux?

thx
Zamek
zamek
Posts: 14
Joined: Sat Mar 23, 2013 6:39 pm

Re: Weird USB behavior on Linux

Post by zamek »

I found the problem,

There was an installed Modem Manager, which checks every serial ports after connect, whether is it a modem?

apt-get purge modem-manager can solve the problem.

Zamek
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Weird USB behavior on Linux

Post by Giovanni »

Glad you found the problem :)

Giovanni
Post Reply