How using Q2686 / 87 USB Port for debugging application

In the way I do you create a function in the same format of TRACE macro, and the string you recieve you send it as a AT response. In this way you can send “traces” in target mode in both situations, Debug and Release. If you don’t want the “traces” to be sent enclose the code inside the function that substitute TRACE with:

#ifdef  __DEBUG_APP__
...
#endif

But doing this via USB will still be affected by the fact that the PC “loses” the USB connection whenever the module restarts!

I don’t really see that it has any advantage?

Awneil, of course, as you have already said, each time the modem resets, you must reconnect with the USB.
The advantage is simple, TRACES doesn’t work over USB on rblode_new case, so it’s a way to get similar information TRACE gives without using it.
Have you ever tried TRACES on USB? I tried to use UART2 for debbuging two years ago and I desperate. Maybe because of the firmware used, I don’t know.
If you have real experience on using TRACE on USB, please share your knowledge with us and give us an step-by-step guidance in order to succeed.

Yes it’s good Idea :slight_smile: , i will try it , but i can send also the value of variable?
Thank You

Yes, Awneil , You can give us an step-by-step guidance please .
Thank you !

I tried this : adl_atSendResponse ( ADL_AT_INT, “\r\nOK\r\n” ); and adl_atSendResponse (ADL_AT_PORT_TYPE(ADL_PORT_USB ,ADL_AT_UNS),“Test Trace Envoi USB\r\n” ); but it work only when i choose UART1 for connection hardware :frowning: , so i want to replace UART 1 by USB .

Did you open the port?

AT+WMFM=0,1,3

I have already give it in my post of 07 May 2009, 12:02 - but here it is again:

  1. Wait for the device to restart, and wait for Windows to (re-)enumerate the USB.
    (at this point, you should be able to send AT commands to the module, and receive the responses, using Hypoterminal on the USB connection)

  2. Once the USB is connected & working (again) in Windows, open TMT.

  3. You should now be able to get traces over USB in the same way that you get traces over the UARTs…

Yes , i open the port and it work well in release mode and in debug if i choose UART1 like hardware interface but when i choose USB comme hrdware connection no,

My procedure :

1- I open Target Monitoring and in Prefernces -->Settings → Com , i select my virtual port for Usb , i click open then Auto detect .
2- I start Remot Task Monitor in Eclipse
3- In select i choose Hardware commmunication “USB”
4- I click Start.

If there is a problem in my procedure thank you for correcting me .

What about a configuration of the port , there is no think to do ?! , and i start not the debug mode ?!

That was covered by point number 3:

Of course, with a USB connection, baud rate, flow control, etc are all irrelevant.

But the Pc loses the connection when i start the debug after the 3 point , the problem is here .

i just tried this, and no problems occured.

I know - I’ve always said that’s the fundamental problem with using USB for Trace!
See: viewtopic.php?f=15&t=3303&p=12781&hilit=usb+for+traces#p12781

That’s why I said you will have to start your application before you start TMT!

I guess that pretty much precludes USB for RTE mode, though…

Like I also said, have you tried using the ‘External Com’ facility in the Terminal Emulator with TMT?

See: viewtopic.php?f=15&t=3303&p=12441&hilit=external+com#p12441

In the case you use the USB for “pseudo-tracing” open the port on the hyperterminal after your application starts to run.

How do you get the USB COM port number?

Look at the modem properties in the Windows Device Manager - on the ‘Modem’ tab

Sorry, rblode_new: How do you get the USB COM port number?

Hello , i’m sure that i have the true Port because it works in USB for AT commande , for get the port Number like he said awneil

There are a lot of devices responding to AT commands on a computer: modems, some bluetooth adapters, some net-boards… I will check that the device is the correct.
Anyway, after you start the application with AP+WOPEN=1 you must “Disconnect”, and after “Connect” again the Hyperterminal, I’m not sure you are doing it at the correct moment:

This behavior occurs on applications running on the PC which do not detect the switching OFF of the Wireless CPU. An example of such application is HyperTerminal.
To understand the cause of this behavior, it would be gud to see how Windows manages USB devices.

  1. When a USB device is connected to the Microsoft Windows PC, internally a Device Handle is assigned to it and stored in the registry.
  2. When the USB device is removed, that Device Handle is also removed from the registry.Now, when HperTerminal is connected to the COM corresponding to the USB port of the PC, and the USB device (Wireless CPU) is turned off, HyperTerminal does not detect that the device has been turned off and keep on locked on the COM corresponding to the USB.However, Windows has detected that the USB device (Wireless CPU) has switched OFF, so it removes the Device Handle. When the USB Device (Wireless CPU) is turned on again, Windows assigns another Device Handle to the USB device, but HyperTerminal still uses the previous one which has now become invalid. Due to this, if the Wireless CPU is reset when HyperTerminal is connected to the USB port(in AT mode or Data mode), HyperTerminal will not detect the Wireless CPU.

Hence, this problem is specific to the external application being used. Intelligent applications (like TMT/TE/Selima) monitors the status of the USB device, and if you reset the Wireless CPU when the USB connection is used for connecting TMT/TE/Selima with the Wireless CPU, then you will see, that although the connection is closed, you can connect again by clicking on the “Connect” button in TMT. Hence, this problem is specific to the tool being used, and is not a problem in the Wavecom Wireless CPU.I would recommend to use the USB port using TMT and then reset the Wireless CPU. When the Wireless CPU is reset, the TMT will detect it, and the connection will be closed. The customer can then again connect the TMT using the “CONNECT” button and there will not be any problem communicating again.

Otherwise obtaining traces on USB is not that difficult or impossible.