This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MMB0 Porus usb stack / NI-VISA driver problem

Other Parts Discussed in Thread: ADS131E08, ADS1282, ADCPRO, ADS1271, ADS1298

Hello!

First, I know that MMB0 platform is not supposed for being used with custom firmware, but this is exactly I am doing now. My goal is to evaluate the performance of digital feedback loop (and some other things) which include ADS1282/ADS131E08 converters, DSP with some signal processing and DAC/PWM output. Since MMB0 platform seems to suite perfectly for this purpose I decided to create the custom firmware and client program.

As a base I took the source codes for ADS1271EVM board and LabView client program, that are included in a software package and are free to download from TI website. Then, roughly speaking, I replaced almost everything with my own code except the part that corresponds to communication via USB and MMB0 board configuration functions.

This USB communication "subsystem" works perfectly, including firmware download procedure, control commands and bulk data transfer. 

Except one thing.

At random time, when the data transfer is active, the device suddenly receives bus suspend event from host, and that's it! No activity on the bus, no bus resume events, just silence. The only way to restore the communication is to reconnect device, either by physically unplug and plug the USB cable or by device reset.

I added some logging in USB ISR function to see what happens before bus suspends - nothing special. Just normal DMA events, no control/setup commands are received before. However there is a time interval between the last DMA event and bus suspend event of about several milliseconds - maybe host decides to suspend the bus because no activity happens there. This is unlikely, but maybe for some reason the device is blocked for a long time with other interrupt. But why then host doesn't resume after a while? And why this is not happening at idle time? There are several bus suspend events occurs during the enumeration procedure, but they are always followed by corresponding resume events.

The other observations are:
- The issue occurs respectively rarely. It can happen after several hours of normal data transmission. But the moment of time seems to be quite random.
- The frequency of the bug seems to be dependent of data flow speed. The more bitrate - the more often it happens. 
- Bad usb cable is not a point. I tried several cables, no changes.
- I also tested three different MMB0 boards - both behave the same way.
- Different PCs - seems that on some PCs issue happens more frequently. Dependence on host controller? By the way, all PCs I've tried were with Windows 7.

I made no changes in porus USB stack source code except I replaced MEM_alloc() function in usbhw_activate_ep() with function that returns statically initialized memory address. I made this because I don't want to use dynamic memory allocations in my code and this particular function is used only once (during usb enumeration) and allocates only 4 bytes.

I am using CCS5 and DSB/BIOS 5.42.1.09. I did not migrate from the old CCS3 project. Just created the new project and moved necessary source files. The old LabView project runs on LabView 2014 with almost no changes.
Since MMB0 driver included in ADS1271EVM package supports only XP, I took the new MMBO driver from latest ADCPro package.

So, do you have any consideration why this can happen? 

  • Hello Alexander -
    The ADS1271EVM was the first EVM that was done on the MMB0, so we have learned a few lessons since then. It probably would be better to take the code basis from the ADS131E08 for comparison. While a lot of this are the same, it does implement newer functionality that may correct the problem that you are seeing. As you have probably noticed, the firmware does not propagate errors up from the lower level functions well, so debugging is very difficult at best.
    Let us know if you would like the ADS131E08 code. We should have it available to be compatible with CCS 4.5 at least.
  • Hello Greg!

    Thank you for your reply! I will be very grateful if you can give me the source code of any up-to-date MMB0 project. This will help me a lot!

    I see that in current projects you are using the Styx USB stack with appropriate Windows driver. It is a bit disappoining for me because I already spent some time understanding communication via Porus and NI-VISA. If not a secret, is there any fundamental constraint or problem that forced you to stop using NI-VISA USB RAW driver? It seems for me that implementing VISA driver is much easier in LabView projects.
  • Hello Alexander -

    You will receive an email to the address in your profile with information for the ADS131E08 source.


    Regarding software/firmware -

    It has been a while since I looked at the ADS1271, but it should implement the same structure roughly as the newer devices; albeit the first iteration of it.  We made a decision to abstract the communication a little using Styx (implements a VFS).  The messaging that is required was a little tedious for LabView, so we could abstract it in a dll.  While the VFS could be implemented in real-world application, make sure that you understand the implications and review the code that was used.

    For future work, we are departing completely from LabView and Styx, and are trying to implement more of a bulk USB protocol to generalize the interface.  This project is still in the works, but will be on the newer devices going forward.

  • Hello, Greg!

    I have received the newest source code and I'm already studying it. It will take some time to work it out, and then I will let you know if the new USB communication method helped to solve suspend problem.

    Thanks again for your help! 

  • Hello, Greg!

    I have included the new code for Porus USB stack in my firmware and it seems that the USB Suspend problem have gone! I can still see some lags that interrupt data transmission for some time, but they don't kill USB bus completely and if you have big enough buffer the transmission resumes after a while with no loss of data.
  • Hello Alexander, Greg,

    I am using MMB0 EVM. I can read data from ADS1298 using the Windows based TI's application. But now, I want to use the same board with Linux based PC.

    Can you please suggest the steps that I should follow?

    Appreciate your quick reply.

    Thanks,

    Dhaval

  • Dhaval,

    As stated above, TI does not support the use of the EVM for a custom project. Perhaps Alexander can help you.

    Brian