STM32F2 USB Driver

Comments

18 comments

  • Avatar
    satoh syota

    CorssWorks 2.1.2 and STM32_F105-07_F2xx_USB-Host-Device_Lib_V2.0.0 and STM32F207IG combination is possible ?

    Anyone tried same condition ?

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    Did you try changing the stack size? Does the enumeration code need to be built with optimisation enabled to run fast enough to prevent timeout?

    0
    Comment actions Permalink
  • Avatar
    satoh syota

    Thanks for the reply, Mr Michael.

     

    I already increased the stack size that is too small with default setting (Heap,Stack -> 8192bytes),

    and tried the all settings of optimisation (None,Level1,2,3), but can not improve.

     

    It can not receive any packet at uint32_t USB_OTG_USBH_handle_rx_qlvl_ISR procedure as I mentioned before.

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    Did you rename the interrupt handler in the startup code using a C preprocessor definition?

    0
    Comment actions Permalink
  • Avatar
    satoh syota

    I didn't  rename them but interrupt handlers seems to be called properly.

    Nevertheless, rename is needed ?

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    There isn't an interrupt handler of the name

    USB_OTG_USBH_handle_rx_qlvl_ISR

    in STM32_Startup.s or are you using different startup code?

    0
    Comment actions Permalink
  • Avatar
    satoh syota

    USB_OTG_USBH_handle_rx_qlvl_ISR

    This is function but not interrupt handler.

    This function is called from the interrupt handler.

     

    I use STM32_Startup.s that is not modified.

    0
    Comment actions Permalink
  • Avatar
    satoh syota

    I would like to use CrossWorks, but I have to decide whether STMicro's USB Library can be used or not.

    I appreciate very much when you test it.

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    I recall doing something in this area - which software are you using?

    0
    Comment actions Permalink
  • Avatar
    satoh syota

    I use CrossWorks for ARM 2.1.2 with STM32_F105-07_F2xx_USB-Host-Device_Lib_V2.0.0.

    Project is USB_Host_Examples.

    0
    Comment actions Permalink
  • Avatar
    satoh syota

    I can not solve this yet.

    Was there any progress , Mr. Michael ?

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    Could you attach the .hzp file you have made and I'll take it from there.

    Regards

    Michael

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    I've built the application.

    I reproduced your original report with the Host Demo and a memory stick.

    I changed the stack size to be 1024 and then that behaviour disappeared i.e. it seems to be working, but I'm not sure what the application should do. The main part of the LCD display is black - should something be displayed?

    Regards

    Michael

    0
    Comment actions Permalink
  • Avatar
    satoh syota

    Thanks a lot for your testing !

     

    We have to make a trick when showing the LCD display.

    There is a 'PUTCHAR_PROTOTYPE' function in the lcd_log.c file (\Utilities\STM32_EVAL\Common\) that display the one character to LCD.

    We have to "override" instead of the standard function '__io_putchar(int ch)'. This is writtern in the lcd_log.h.

    But I can't do it, then give up the LCD display.

     

    More importantly, " it semms to be working" ?

    There is a function in the usb_hcd_int.c

     

    static uint32_t USB_OTG_USBH_handle_rx_qlvl_ISR (USB_OTG_CORE_HANDLE *pdev)

    {

    .....

    switch (grxsts.b.pktsts)
    {
    case GRXSTS_PKTSTS_IN:
    /* Read the data into the host buffer. */
    if ((grxsts.b.bcnt > 0) && (pdev->host.hc[channelnum].xfer_buff != (void *)0))
    {

       v v v v v  Break point here v v v v v
       USB_OTG_ReadPacket(pdev, pdev->host.hc[channelnum].xfer_buff, grxsts.b.bcnt);

       ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 

    .....

    }

     

    Setting the break point showing above, then start the debugging and insert the USB memory at the OTG connector,

    but NEVER HIT the break point.

    While IAR environment ,setting the same break point, start debugging , insert the USB memory,

    HIT the break point.

    It seems that CrossWorks can not receive the USB packet.

     

    Best Regards

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    Looks like the eabi compiler is needed for this application.

    Use "Tools | Options | Building" and set  "Default GCC Target" to  be "arm-unknown-eabi".

    Regards

    Michael

    0
    Comment actions Permalink
  • Avatar
    satoh syota

    Thanks for the very important information.

    CrossWorks can receive USB packet by your last advice !!!

    # Would you tell us why you think that "eabi" needed , if you don't mind.

     

    Thank you very much , Mr Michael.

     

    Best Regards

    0
    Comment actions Permalink
  • Avatar
    Michael Johnson

    The bitfield/struct field access differs.

    OABI doesn't worry about accessing aligned byte/short fields with byte/short instructions.

    0
    Comment actions Permalink
  • Avatar
    Dirk Handzic

    I am trying to use the STM32_USB-Host-Device-Lib_V2.1.0, but I dont find a proper way to compile it using Crossworks 2.2.1. There are always errors about missing files or unknown definitions i e __IO.

    Any help appreciated!

    0
    Comment actions Permalink

Please sign in to leave a comment.