M2M crashes

I am not sure if I’ll be able to tell you the old “unstable” version of the FTDI driver. To tell the version I currently use I have to look in my laptop, which I have at home, not here in my office. I’ll write you in the evening. Interesting is also the fact, that I use the same cables with two other desktops, and these haven’t had any crash problems at all. The version in my office desktop is: 2.4.6.0 from 13.03.2008.

Or maybe not: it’s just crashed twice in succession before successfully connecting…

EDIT: but then, as when I did a ‘Clean Project’ it crashed again! :angry:
Again, M2MStudion just disappeared - no messages, no nothing!

Connect after that worked.

Hi awneil,
the “bad” FTDI driver was probably CDM 2.02.04.exe with date 13.1.2008, the “good” one is CDM 2.04.16.exe with date 13.6.2009. The older versions of M2M Studio didn’t crash on your computer?

i’m using version 2.6.0.0

file versions are 2.06.00 for ftser2k.sys
and 2.06.00.1 for ftserui2.dll

I also do not have any special knowledge regarding the discussed issue. I only wanted to let you know, that in my case the crash problem of M2M Studio disappeared after updating the FTDI driver.

I’ve just realised that two things changed at once there:

  1. I started using this FTDI cable;
  2. It’s at 921600 baud.

Previously - when I hadn’t had “any particular issues with ‘Connect to Target’” - I had never used it above 115200.

TMT does seem to exhibit at least two problems above 115200:

  1. The download doesn’t work;
  2. If you close the port manually before closing TMT, it will forget the speed, and use 115200 the next time it starts.

I don’t know if these are specific to just TMT, or if they are problems with the underlying stuff - which would be shared by M2MStudio… :question:

This is a new one (to me):

M2MStudio had connected to the target fine first time, and downloaded the app.

Some time later (5-10 minutes) when I wasn’t even touching the PC - let alone M2MStudio - it just disappeared off the screen!

Again, no error messages, no warnings - just disappeared entirely!

I seem to have the same problem with the USB. It seems to me that when you type at+wopen=1 or at+wopen=0, the usb to serial renumerate. Also if try at+cfun=1 or at+wdwl, the same happens. I have tried it with teraterm and type those commands in my PC and monitor the device manager, the wavecom modem disconnects momentarily and then enumerate when I disconnect teraterm. I don’t think m2mstudio handles these disconnection properly. The product that I am working on will be mass manufacture in the near future and I don’t want to use teraterm to program the software by connecting and disconnecting for the production staff to get the USB working. The only way I resolve this is to write my own programming software in C# (suggested by the FAE) which I managed to do successfully. This makes it easier for the production staff to program the wavecom chipset. I also have the same problem when using the stm32 with a bootloader using the usb to serial and I had to resolve this by writing my own C# application which also works successfully. This doesn’t solve the m2mstudio crashing.

No, a USB-to-serial converter should certainly not re-enumerate! That is the big advantage of using a USB-to-serial converter on one of the device’s UARTs rather than the device’s USB port.

Are you talking about the USB port on the Wavecom device itself? That is a true USB port - not just a USB-to-serial converter.

The USB port on a Wavecom device does restart when the device restarts - which includes on WOPEN=0 and WOPEN=1 and CFUN=1

That really does sound like you’re talking about the Wavecom USB port - not a USB-to-serial converter.

Did you look at DWLWin?
That has an automation interface - and can be used to download to multiple devices simultaneously

However, I’d be interested to know how you catch the Device removal & re-appearance events in C#…

Yes, it is an inherent problem with a USB “engine” that’s in the chip and, therefore, restarts when the chip restarts.

To setup the USB events.

Add this declaration in the class, ManagementEventWatcher eventWatcher;
Include using System.Management; in the top of the source file.

In project, add referenece to the system management.

To setup the USB event add the following code to initialisation function.

WqlEventQuery eventQuery = new WqlEventQuery();
            eventQuery.EventClassName = "__InstanceOperationEvent";
            eventQuery.WithinInterval = new TimeSpan(0, 0, 1);
            eventQuery.Condition = @"TargetInstance ISA 'Win32_USBControllerDevice' ";

            eventWatcher = new ManagementEventWatcher(eventQuery);
            eventWatcher.EventArrived += new EventArrivedEventHandler(eventWatcher_EventArrived);
            eventWatcher.Start();

Add the event code.

private void eventWatcher_EventArrived(object sender, EventArrivedEventArgs e)
        {
            ManagementBaseObject mbo = (ManagementBaseObject)e.NewEvent["TargetInstance"];
            using (ManagementObject mo = new ManagementObject(mbo["Dependent"].ToString()))
            {
                if (mo != null)
                {
                    try
                    {
                        mo.Get();
                        /* Wavecom vendor ID is always 0x114F and Q26 product ID is 0x1234 */
                        if (mo.GetPropertyValue("DeviceID").ToString().Contains("VID_114F&PID_1234"))
                        {
                            objQ26Comms.Open(Q26Port);
                            USBConnectionFlag = true;
                        }
                    }
                    catch (ManagementException)
                    {
                        if (objQ26Comms != null)
                        {
                            objQ26Comms.Close();
                        }
                        USBConnectionFlag = false;
                    }
                }
            }
        }