Page 1 of 1

USB serial parameters?

Posted: Sat Mar 02, 2013 11:53 pm
by russian
What is the connection configuration of the USB virtual serial?

I have compiled the 407_discovery_mems demo, Windows does see a Virtual Com port, I've installed the driver - still, I do not see anything when I connect to the COM port with putty. I've tried 38400-8-N-1, 57600 and 115200

I'm shaking the board as crazy & hitting the user button - but still nothing in the console :( Same console worked with the USART dongle

Re: USB serial parameters?

Posted: Sun Mar 03, 2013 7:41 am
by Giovanni
The communication parameters are irrelevant, you should see a shell on the com port. Press enter to get a prompt or you will see nothing.

Giovanni

Re: USB serial parameters?

Posted: Sun Mar 03, 2013 11:37 am
by Tectu
I just tried both, the F4-DISCOVERY as well as the F4-DISCOVERY-MEMS demo yesterday myself and I couldn't get a VCOM port on my linux machine as well. Before I did that, I updated to the latest master of the ChibiOS/RT repository. Other demos like the OLIMEX_E407 did work very well in the past.


~ Tectu

Re: USB serial parameters?

Posted: Sun Mar 03, 2013 1:32 pm
by Giovanni
I tested F4-DISCOVERY-MEMS, it works on Win-XP. I cannot test on Linux but it is unlikely to be a driver issue, it appears to be host OS related.

Giovanni

Re: USB serial parameters?

Posted: Sun Mar 03, 2013 2:25 pm
by russian
OMG, I am really bad! I've hit enter and now I do see the shell!

Re: USB serial parameters?

Posted: Sun Mar 03, 2013 5:25 pm
by russian
This USB serial seems to be quite fragile?

1) I have modified the demo to print a hello message right after 'SDU1.config->usbp->state == USB_ACTIVE' check - but the channel is not ready as is. By the way I have not seen the stock 'ChibiOS/RT Shell' message till I have inserted a 6 (!!!) seconds delay. Bad, but I can live with that

2) I cannot re-connect to the USB serial if I hit the 'reset' button on the dev board (again, it's stm32f4discovery).
So, my action sequence:
a) I launch my .bat file to upload fresh binary, it also does MCU reset. the com port disappears and re-appears in the Device Manager
b) i connect to COM21 via putty, 6 seconds later I see my welcome message (no enter is needed)
c) I hit the 'reset' button on the dev board. the com port disappears and re-appears in the Device Manager, but my attempts to connect to it via putty fail with a 'failed to connect' message
d) I unplug and re-plug the microusb cable and get the shell running
That makes this unusable for me :(

I use WinXP & Chibi 2.5.1

Re: USB serial parameters?

Posted: Sun Mar 03, 2013 6:09 pm
by Giovanni
It is not matter of fragility. The problem is that there is no way to know if the host is ready for receiving data after enumeration. UAB_ACTIVE only tells you that the device has been enumerated but not that an application is ready on the other side to receive data.

You may wait for the host side to send a message through the port before beginning.

Giovanni

Re: USB serial parameters?

Posted: Sun Mar 03, 2013 6:22 pm
by russian
What about the inability to connect via the USB after I hit reset button on the board without unplugging the cable?

Re: USB serial parameters?

Posted: Sun Mar 03, 2013 6:29 pm
by Giovanni
It works here, after a reset the discovery-mems demo is removed as a device and re-enumerated after one second. There is specific code in the main:

Code: Select all

  /*
   * Activates the USB driver and then the USB bus pull-up on D+.
   * Note, a delay is inserted in order to not have to disconnect the cable
   * after a reset.
   */
  usbDisconnectBus(serusbcfg.usbp);
  chThdSleepMilliseconds(1000);
  usbStart(serusbcfg.usbp, &usbcfg);
  usbConnectBus(serusbcfg.usbp);


Not sure about the cause of your problem.

Giovanni