Skip to main content
adeyneko
Associate
August 6, 2009
Question

ST32_USB-FS-Virtual com loop back test - FAIL ?

  • August 6, 2009
  • 2 replies
  • 711 views
Posted on August 06, 2009 at 16:30

ST32_USB-FS-Virtual com loop back test - FAIL ?

    This topic has been closed for replies.

    2 replies

    adeyneko
    adeynekoAuthor
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:19

    Gentleman,

    I found some problems with accuracy of ST32 USB Virtual com implementation.

    I hope I am wrong , but I can not find the reasonable explanation of my problem.

    Plz, help me with this ….

    Initially, I had an practical tack to transfer data from preferential device , which I designing to PC for visualization. I must transfer 1000 packets of data (each packet is 50 bytes) at 38400 speed.

    Each packets is a set of characters ( line of text ) and I can easy verify the accuracy of data transmission just screen of any PC data terminal. For testing proposes all packets have the same data, therefore in case of success I must see 1000 identical lines of texts.

    I checked the data stream with a scope : I had approximately 15 mS of transmission time for each packet and 10 mS for a pause between the packets. The transmitter is also confirm with packets transmission with the CTS signal .

    In the beginning , I connected the transmitter of the packets to PC by “off the shelf�? Serial_to_USB cable (Prolific) and check the accuracy of transmitted data on the screen of data terminal( “bray_terminal�? ).

    In this configuration of hardware , I had no problem at all – I can see on my screen 1000 lines of identical text :

    --------8<----------------------

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    --------8<----------------------

    After this I decided to transfer the same data to PC terminal by regular USB cable , but over ST32 Virtual Com Port.

    I programed the Olimex H103 board with the latest ST Virtual Com Port firmware. I got the source code from UM0424 and compiled it with IAR 5.30.

    Olimex ST32-H103 board is not matching the source hardware exactly and I did small modification

    in source code :

    /*

    #define USB_DISCONNECT GPIOD

    #define USB_DISCONNECT_PIN GPIO_Pin_9

    #define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOD

    */

    #define USB_DISCONNECT GPIOC

    #define USB_DISCONNECT_PIN GPIO_Pin_11

    #define RCC_APB2Periph_GPIO_DISCONNECT RCC_APB2Periph_GPIOC

    After this I programed the H103 flash and added 7 centimeters ( it is around 3 inches ) jumper wire from output of RS232 transmitter ( 3,3 V ) to input RX pin of UART1 on ST32-H103 board ( pin 7 , header 1 ) . For sure the fat wire for ground was connected too.

    Suggested Virtual COM port driver for Vista was installed .

    Same terminal software again.

    This is my result trough ST32 virtual com port :

    --------8<----------------------

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !A555,1,1,,A,fOoNLrK8`KMOwQfFAliCPMnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    !AI555,1,1,,A,fOoNLrKM8`KMOwQfFAliCP:MnA0U,0*6B

    --------8<----------------------

    Us you can see some characters is missing . Approximately 30 % of packets is garbage – this result is not adaptable. Initially I was under impression that a have a problem with hardware.

    I did a double check and did not find any trouble.

    Finally, I decided to run a loop back test for both hardware configuration.

    I found in the Internet the loop back test with was created by Luciano:

    http://www.mcselec.com/index.php?option=com_content&task=view&id=165&Itemid=57

    I tested the Prolific cable with loop back jumper and this cable pass the test at any com speed.

    After this I placed short jumper between pin 4 and pin 7 of header at ST32H103 board and ran the same test again for ST32H103 board .

    Unfortunately , the test fail at any com speed.

    Is somebody have the reasonable explanation of this results ?

    Can somebody repeat the test on different hardware ? ( you must place just a single jumper wire )

    Thanks for you cooperation.

    Alex.

    adeyneko
    adeynekoAuthor
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:19

    Problem solved.

    In the attached file the source code from Olimex web site with was adapted for H103 board.

    Now it is working and pass the feedback test.

    I Hope it will help to somebody.

    Regards,

    Alex