STM32F103 LibUsb

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F103 LibUsb

Post by Giovanni »

You should single step in ASM through that switch/case and see what happens exactly.

Giovanni
goahunter
Posts: 29
Joined: Thu Aug 16, 2012 10:59 pm

Re: STM32F103 LibUsb

Post by goahunter »

Ok so to fix the problem, the following line of code was changed to directly use the LLD

Code: Select all

      /* Initiate next receive */
       usbPrepareReceive(usbp, EP_OUT, receiveBuf, 62);
       chSysLockFromIsr();
       usbStartReceiveI(usbp, EP_OUT);
       chSysUnlockFromIsr();

to

Code: Select all

usb_lld_read_packet_buffer(usbp, ep, receiveBuf, 62);
      usb_lld_start_out(usbp, ep);
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F103 LibUsb

Post by Giovanni »

Hi,

That looks more like a workaround than a solution, low level functions are not meant to be called directly. It is possible that some error condition prevents the high level functions to call the low level but you should address the reason not just bypass the check.

Giovanni
Post Reply