USB CDC on TWR-K60F120M and TWR-SER2 Board won't send certain values.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB CDC on TWR-K60F120M and TWR-SER2 Board won't send certain values.

Jump to solution
748 Views
terencet
Contributor III

I have been trying to get my TWR-K60F120M to work as a virtual com device with my windows xp machine.

After having some trouble getting things working bare metal I switched to using MQX 4 and have got it running and sending messages to Hyper Terminal.

I have modified the example program to simply send out a count from 0 to 0xFF which works fine if I'm just sending one byte but when I try to send a longer message (a uint_32) it stops on certain values these values change depending on the length of the message to be sent.

Has anyone encountered similar problems or might know what the cause could be?

here is how I altered the code in the main TestApp_Init loop.

while (TRUE)

{

     USB_CDC_Periodic_Task();  

       

     if((start_app == TRUE) && (start_transactions == TRUE) && (g_send_finished == TRUE))

     {

          lError = USB_Class_CDC_Send_Data(g_app_handle, DIC_BULK_IN_ENDPOINT, (unsigned char *)(&lTestData), sizeof(lTestData));

          if (!lError && !(sizeof(lTestData) % DIC_BULK_IN_ENDP_PACKET_SIZE))

          {

               lError = USB_Class_CDC_Send_Data(g_app_handle, DIC_BULK_IN_ENDPOINT, NULL, 0);

          }

          g_send_finished = FALSE;

          if(lTestData == 0xFF)

          {

               lTestData = 0;

          }

          else

          {

               lTestData++;

          }

     }

}

g_send_finished is set when USB_Notif_Callback is called with USB_APP_SEND_COMPLETE.

0 Kudos
1 Solution
424 Views
terencet
Contributor III

Turns out it wasn't a software error but was due to the positioning of the boards in the tower.

https://community.freescale.com/message/350162#350162

The question linked above had a similar problem and the solution was to move the boards closer together (before they were at the top and bottom of the tower) in the top two slots.

View solution in original post

0 Kudos
1 Reply
425 Views
terencet
Contributor III

Turns out it wasn't a software error but was due to the positioning of the boards in the tower.

https://community.freescale.com/message/350162#350162

The question linked above had a similar problem and the solution was to move the boards closer together (before they were at the top and bottom of the tower) in the top two slots.

0 Kudos