Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

MSP430F5659: Issues with MSP430F5659 USB CDC and MSC Interface

Part Number: MSP430F5659
Other Parts Discussed in Thread: MSP430F5529

Tool/software:

Hello everyone,

I’m currently working on a project with a PCB featuring the MSP430F5659 microcontroller. I’ve successfully set up a USB interface that utilizes both CDC (Communication Device Class) and MSC (Mass Storage Class) for a microSD card.

While everything works well as long as the microSD card is in the socket, I encounter issues as soon as I remove it. The CDC communication continues to function for a while, but eventually, I lose the ability to communicate altogether.

I’ve noticed that the interrupt vector USB_UBM_VECTOR is still being called regularly. However, it does not respond when I send data from the host. In the end, the endpoint for receiving is triggered once, but I no longer receive any bCDC_DataReceived_event.

Has anyone experienced similar issues or have insights on how to resolve this? Any help or suggestions would be greatly appreciated!

Thanks in advance!

  • Hi Stefan,

    Have you try the demo code for MSC individually? You can add your external microSD card access code based on that and try to do the test.

  • Hi Gary,

    I wanted to share some insights regarding my experience with the TI example "CHM1_term2HidDemo_2LUN" for my controller and board. Actually, I only had to adjust the pins for the SD card and connect my power supply correctly.

    I also modified the example to use a single Logical Unit Number (LUN) and removed the HID functionality, focusing solely on the CDC communication. Overall, the CDC data transmission works well as long as the SD card is seated in the socket. However, I encounter the same issues when the card is removed.

    One thing I've noticed is that before these problems arise, the USB_UMB_VECTOR is triggered multiple times, which seems to correlate with the issues I'm facing.As far as I can see, the USBCDC_sendDataAndWaitTillDone function then returns an error

    If you have any insights or suggestions, I’d really appreciate your input!

    Regards

    Stefan

  • I do see we have demo code M2_SDCardReader, have you test such demo before? That should be closer with your using case.

  • Hi Gary,
    thanks for the answer. I can test the M2_SDCardReader example. That should not be a problem. But what good does it do me? I have the problem that sooner or later I will no longer be able to communicate via the CDC interface if there is no SD card in the socket. In an example without communication, the problem will not occur.

  • I have now briefly adapted and tested the example. It works well for me. When the card is inserted, it is also displayed in Windows after a few seconds and Explorer opens the drive. When I remove it, the empty drive is displayed. However, I have changed this behavior with the Composite_multipleInterfaces example.

  • That seems good, I think you can add the CDC based on this demo that maybe better to debug based on your original project.

  • Hi Gary,
    I have added the CDC part. Now I have exactly the same problem as with my original firmware. When I remove the SD card from the socket I can still send a few commands and receive a response (currently I return the receive with a prefix). But at some point I no longer receive a response.
    What I have noticed is that closing and opening the port on the PC causes the data transmission to catch again. Sometimes I also get replies directly after opening the port, i.e. the echoes of the last transmissions (yes, several). Sometimes, however, I only get a response when I send a command after opening the port.

    I have taken a recording of the interface here with Serial Port Monitor

    [00:561] Written data (COM16) 
        49 6e 66 6f 09 44 65 76 69 63 65 0d 0a            Info.Device..    
    [00:010] Read data (COM16) 
        52 78 32 54 58 3a 20 49 6e 66 6f 09 44 65 76 69   Rx2TX: Info.Devi 
        63 65 0d 0a                                       ce..             
    [00:525] Written data (COM16) 
        49 6e 66 6f 09 44 65 76 69 63 65 0d 0a            Info.Device..    
    [00:040] Read data (COM16) 
        52 78 32 54 58 3a 20 49 6e 66 6f 09 44 65 76 69   Rx2TX: Info.Devi 
        63 65 0d 0a                                       ce..             
    [00:650] Written data (COM16) 
        49 6e 66 6f 09 44 65 76 69 63 65 0d 0a            Info.Device..    
    [00:564] Written data (COM16) 
        49 6e 66 6f 09 44 65 76 69 63 65 0d 0a            Info.Device..    
    [00:859] Written data (COM16) 
        49 6e 66 6f 09 53 65 74 74 69 6e 67 73 0d 0a      Info.Settings..  
    [00:801] Written data (COM16) 
        49 6e 66 6f 09 53 65 74 74 69 6e 67 73 0d 0a      Info.Settings..  
    [00:645] Written data (COM16) 
        49 6e 66 6f 09 53 65 74 74 69 6e 67 73 0d 0a 49   Info.Settings..I 
        6e 66 6f 09 53 65 74 74 69 6e 67 73 0d 0a 49 6e   nfo.Settings..In 
        66 6f 09 53 65 74 74 69 6e 67 73 0d 0a 49 6e 66   fo.Settings..Inf 
        6f 09 53 65 74 74 69 6e 67 73 0d 0a               o.Settings..     
    [02:099] - Close port COM16 
     
    [00:679] - Open port COM16 (C:\Program Files (x86)\MicroRidge Systems\ComTestSerial\ComTestSerial.exe) 
     
    [00:044] Read data (COM16) 
        52 78 32 54 58 3a 20 49 6e 66 6f 09 44 65 76 69   Rx2TX: Info.Devi 
        63 65 0d 0a 52 78 32 54 58 3a 20 49 6e 66 6f 09   ce..Rx2TX: Info. 
        44 65 76 69 63 65 0d 0a 52 78 32 54 58 3a 20 49   Device..Rx2TX: I 
        6e 66 6f 09 53 65 74 74 69 6e 67 73 0d 0a         nfo.Settings..   

    First you see a few write and read operations on the port. Then there are only write operations and after closing and opening the port, the data from the controller arrives at the PC.

    Can you possibly test this issue on the old white MSP-EXP430F5529 board ? There is a different controller on it, but in principle it is the same. Unfortunately I can't buy it anywhere anymore.

    Stefan

  • Do you do the test during debug mode? If so that may cause some issue when you stop the code. Do you test it in free run mode?

    I do have a MSP-EXP430F5529 Experimenter's Board, when I download the demo code M2_SDCardReader it running well and the sd card showed on the PC with no issue.

  • The M2_SDCardReader code is not the problem. The problem is when I add a CDC interface and there is no SD card in the socket. Then the communication breaks down after a while. Attached is my code project for the MSP430F5659. 

    M2_CDC_Example.zip

    The adjustment for the MSP430F5529 should be the pins for the SPI of the SD card. So change the pins for UCB1 from port8 to port4

  • Hi Stefan,

    I am very busy this week, will try it at end of this week or early next week. Sorry about it.

  • Hi Stefan,

    I have modify the your code that change the SPI port to part 4 as below

    And change the P9.2 and P9.3 test out to P7.2 and P7.3 due to the F5529 do not have P9.2 and P9.3 pins.

    Then I can build the project, and download it into the MSP-EXP430F5529 board, but how do I monitor the signals correctly to know which is works well and what is not?

  • Please try to send data via the CDC interface for a few minutes. After sending CRLF, the text in front of it is echoed with the prefix "Rx2TX: ".

    As long as the SD card is in the socket, I get a reliable response. If I remove the SD card, it works fine for a while, but then I no longer receive any responses. When I disconnect and reconnect the port in my PC software, I get data again. Sometimes even several responses from the PC's buffer

    I hope you have the same problem.

  • Could you share the GUI you used for the CDC data send?

  • I'm using ComTestSerial from MicroRidge. It is easy to use and I can define commands on buttons. 

    https://www.microridge.com/technical-support/software/

    But I have the same problem when I work with self-written software (RAD Studio)

  • Hi Stefan,

    Sorry for the late response, due to our company PC can't install such software. May I just use a UART debug tool like putty to send data with the CDC COM port? If it can work, what kind of data need to send? Any UART setting need to be setting, like baud rate and so on?

  • Hi Gary,

    The late reply is not a problem. Unfortunately I have not been able to work on this project either.

    I have just tested the problem with Putty. Here, too, I had the problem that after a few seconds I got no more answers when the SD card was removed.

    These are the UART settings I am using:

    These are also the settings I usually use.

  • OK, what's kind of data need to send to reproduce this issue? 

  • The data does not matter for this test project. I simply send ASCII characters and receive the characters back with the prefix “Rx2TX: ”. 

        

    Not very good to see in Putty

  • So now here it seems I can see the issue on myside, but after few times try still not get the root cause, but one thing may works for you is that close and open the COM port on PC side can make the communication be normal.

  • Closing and opening the COM port is certainly feasible for control commands and responses. But I also want to receive data continuously. This is not so easy with the port.

    But I just can't believe that nobody has had this problem before. The SD card is accessible by the customer in the end product and I simply have no influence on whether it is really installed. The problem is currently solved in such a way that the device is completely locked if no SD card is installed and there is a USB connection.

  • Sorry Stefan, have to close this thread, I think it should be related with the USB protocol settings in MSP430, but I am not familiar with the USB protocol.

  • Is it possible for this to be forwarded to the team behind the USB stack? I won't be the only one with this problem.

  • Hi Stefan,

    Unfortunately, the USB stack design team for MSP430 is not in TI now.

**Attention** This is a public forum