Page 1 of 1

USB CDC on Olimexino STM32 (Maple)

Posted: Wed Apr 09, 2014 11:04 am
by Kenneth E.
I'm trying to get the USB CDC working on the Olimexino board. I'm not using any Maple bootloader stuff, the board is hooked up to a j-link lite.

I can get the USB interface started, and Windows registers the virtual COM port including the ChibiOS name. So I think this indicates that there is communication both ways.

I've set a breakpoint on the sduDataReceived, and the debugger breaks correctly when entering characters on the windows terminal connected to the virtual COM port.

Trying to write to the USB serial device stalls the OS inside the chOQWriteTimeout on this line:
if (qwait((GenericQueue *)oqp, time) != Q_OK) {

I'm using the latest ChibiStudio 2.6.3, and made a customized board.h for Olimexino.

Any suggestions in how to fix this?

Re: USB CDC on Olimexino STM32 (Maple)

Posted: Wed Apr 09, 2014 11:19 am
by Giovanni
Hi,

It is probably a stack overflow or a similar problem, try enabling the debug options in chconf.h and see if something is caught.

Giovanni

Re: USB CDC on Olimexino STM32 (Maple)

Posted: Wed Apr 09, 2014 11:44 am
by Kenneth E.
Great - I've enabled debugging, hopefully this will also allow me to figure out the instabilities I get from time to time.

What is port_halt(). I sometimes get this upon initialization?

7 port_halt() chcore.c:50 0x08000212
6 chDbgPanic() chdebug.c:274 0x08000996
5 chSchGoSleepS() chschd.c:128 0x08000cc2
4 chSchGoSleepTimeoutS() chschd.c:197 0x08000dbe
3 chThdSleep() chthreads.c:297 0x0800131e
2 InitializeUSB() usb_cdc.c:341 0x0801367a
1 main() main.c:473 0x080140e6

Re: USB CDC on Olimexino STM32 (Maple)

Posted: Wed Apr 09, 2014 12:24 pm
by Giovanni
port_halt() is what is called when an error is defected, inspect dbg_panic_msg for an error message. Probably that is "stack overflow".

Giovanni

Re: USB CDC on Olimexino STM32 (Maple)

Posted: Wed Apr 09, 2014 12:36 pm
by Kenneth E.
Got it working now - my bad :-)