Skip to main content
gmotta
Associate II
May 28, 2014
Question

STM32F427ZI USB

  • May 28, 2014
  • 5 replies
  • 1113 views
Posted on May 28, 2014 at 20:27

Hello again Gentlemen!

I would like to download some sample code to help me to program the USB peripheral to use it as a Virtual COM port. I guess on the PC side I have to install the ST Micro Virtual COM port driver, right?!

If believe that ST has sample code for this but I could not find it.

Thanks,

Gil

#lmgtfy:-stm32-resources
    This topic has been closed for replies.

    5 replies

    Tesla DeLorean
    Guru
    May 28, 2014
    Posted on May 28, 2014 at 20:52

    http://www.st.com/web/en/catalog/tools/PF257882

    Red DOWNLOAD button, bottom of page.
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    gmotta
    gmottaAuthor
    Associate II
    May 29, 2014
    Posted on May 29, 2014 at 23:46

    I downloaded the code and I was able to build it without error. I see the LEDs working fine and I see Win 7 recognizes my board as a VCP and assigned COM17 to it. I can open port 17 with Putty.

    Now I'm trying to figure out how to send data from the board to Putty but it is not working.

    In app.c I have the following code in the main loop every 3 seconds:

            USART_SendData(EVAL_COM1, 'U');

            USART_SendData(EVAL_COM1, 'S');

            USART_SendData(EVAL_COM1, 'B');

            USART_SendData(EVAL_COM1, '\r');

            USART_SendData(EVAL_COM1, '\n');

    Nothing on Putty not even garbage. Would you be able to help out?

    I set a breakpoint inside of EVAL_COM_IRQHandler and the processor never landed there.

    Thanks much,

    Gil

    Tesla DeLorean
    Guru
    May 29, 2014
    Posted on May 30, 2014 at 00:33

    You must spin on the USART status waiting for TXE, you can't keep jamming the SendData

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    gmotta
    gmottaAuthor
    Associate II
    May 30, 2014
    Posted on May 30, 2014 at 03:00

    Thanks for your help, maybe I was not clear about what I was trying to do. The sample code you pointed to me is designed to work as a bridge between the uart on the eval board and the USB Host.

    I was actually trying to send something to the host from within the code itself like a debug trace.

    so I found out to transmit to the host you need to do the following:

      APP_Rx_Buffer[APP_Rx_ptr_in] = character;

      APP_Rx_ptr_in++;

    Now I'm seeing my debug traces on Putty!

    I appreciate your help, you saved me many days of work!

    gmotta
    gmottaAuthor
    Associate II
    May 30, 2014
    Posted on May 30, 2014 at 03:00

    Cheers!