Dear enrico,
I have been unable to find anything to account for the problems on several of you PCs. I have tried a number of different PCs without any problems. I have also reviewed the code.
In the absence of any definite approach I have re-written part of the USB handling code to hopefully make it a bit more robust. I would appreciate if you could try the attached version and see if there is any improvement.
I'm unsure of how much time and resources you have available to track down this bug. If you could indicate your willingness I will provide a version of the code with extra debugging and ask you to try the BDM out with the Codewarrior debugger and check for particular happenings.
bye
Dear pgo,
I've tried to do a simple trace on the code, setting some breakpoints where the program (I think)
sends the "stall". I found a point in "handleGetDescriptor" in "bdm.c" where the " switch() " jumps
to "default". On "working" PCs the program doesn't pass for this point.
I don't know how USB driver works so I am not sure this info could be useful;
I've attached a file with "snapshot" of the situation at breakpoint, together with the last piece
of the program flow.
bye
Enrico
Dear Enrico,
Good job of debugging - This was exactly the information I would ask for. Unfortunately I still can't find the problem.
Attached are some comments and a description of the diagnosis so far
There is also an updated project to try.
I would appreciate if you re-do your debugging with this project as outlined in the PDF. It would be also useful if you could provide an updated USB trace if you still have the equipment.
Thanks!
Dear pgo,
Now the problem seems a bit more clear.
Testing the "official" code, I've found that the "byte swapping" code is correctly working,
but it swaps the "older" contents of ep0SetupBuffer, because when ep0SaveOutData() is
called ep0BDTOut.byteCount is zero; so ep0SetupBuffer, that is filled with old setup
request data, is "re-swapped" to its original content.
Note: at the time ep0SaveOutData() is called and ep0BDTOut.byteCount is zero, the contents of
ep0OutDataBuffer seems to be OK.
Then I have tried the project you posted...
On this code there is no more "stall" sent (I think because there is no "byteCount" check on
But also this code doesn't work on my "not working" pc! (It works correctly on my "working" pc)
The good news are that with this code the USB enumeration seems to be OK... I've attached
the two enumeration logs for comparison.
Now the problem could be on the PC, but if this is the case, I don't know how to resolve it;
I've already tried to uninstall the device, and rebooting the pc, but the situation did'n change.
Pheraps I need a "registry cleaner" for installed USB devices...
Note: I've not tried the previous test code (the one you posted on 30/04) with USB analyzer,
pheraps it was not sending any "stall" as the last test code.
Thank you
Enrico
Dear enrico,
Good progress!
I'm a little unclear about the situation.
As you indicated, I can confirm that the USB trace shows that the device has enumerated correctly and been set an address and has responded to a further transaction after being addressed.
Does the device appear in the Hardware manager? If so you should be able to re-install the driver from there. Is there a problem with the driver installation or does the problem lie elsewhere?
There is a utility testUSBDM in the original software that can be used to check communication with the BDM.
bye
Dear pgo,
Despite the new USB trace seems correct, I have exactly the same issues that I described on my
first posts (I can view the device on Hardware manager, but it tolds me that drivers are uninstalled;
if I try to reinstall the drivers, it says me that the correct driver (?) is already installed and there are no
other drivers available; if I uninstall and reconnect the USBDM, it never asks me for a driver, and says
that there was an error; ecc. ecc. ). The TestUSBDM utility tolds me that there are no found devices.
Now I think the problem could be one of these:
- The enumeration routine could still be not perfect (timing problems, ecc);
but USB analyzer should detect this kind of situation...
(but it seems to me that the USB analyzer I've used is a bit too "poor" to detect anything...);
- The PC is "messed up" because I've connected the "faulty" USBDM, and refuses to work correctly
(until, for example, I reinstall the whole OS, but it's a bit hard to try; I have no more "fresh" PC to try,
because I have connected the faulty USBDM on all the PCs that were available to me).
Do you have any idea of what will be the next test step?
Thank you very much
Enrico
Dear enrico,
Please try the attached image which I expect will be more successful.
I have made some changes to the setup for the USB OUT endpoints.
I have tested this version and it passes the USB compliance test from USB.org.
Let me know how it works with your PCs.
bye
Dear pgo,
I've tried the test code v1.5 and it works on all six PCs I've used for test!
I've attached for reference the USB log files made on two of the previously
"not working" PCs. The log is different from the ones of my last posts.
Also on some PCs with winXP where the USBDM was already working, the OS
now re-asks for the drivers: it seems that the USBDM is recognized in a
"different way"...
P.S.: I've tried both the "old" USBDM code and the last v1.5 code with USBCheck
(the older version of USBCV that works on win2K) and it reported in both cases
the same result, that the USBDM was "1.1 compliant"!
So I think that it should not have been easy for you to find the solution...
Very good job and thank you very much for your support!
Let me know if you need more testing...
Enrico
Dear pgo,
I was tryed your updated code and it works correctly on my "not working" PC.
Thanky you!
Best Regards,
Macias
Dear enrico,
I've this same problem with my USBDM based on JM60 (CLD). When I connect it to my Acer Notebook with Intel chipset every think works fine. WinXP recognized my hardware. But when I connect it to my desktop PC (with SiS chipset) I see nice message: "USB Device was not recognize" I see it in Device Manager as Unknown Device, but I seen some intersting think when I connect/disconnect USBDM 5-6 time (fast), winXP recognize this device correct.
With another USB examples from freescale I haven'tany problems every think was recognized.
Best Regards,
Macias
Dear Macias,
I think the same strange behaviour happened to me,
when I was trying my USBDM with USB analyzer on my laptop running winXP.
Initially the USBDM wasn't recognized, but after some "connect/disconnect" cycles, winXP
correctly found the device. I think that a quick repetitive restart of handshake"tricks" the USB
connection driver, making it believe that the enumeration "continues", when in fact is not (it could be?).
This behaviour could be related to the first "stall" issue I've seen on some of my PC.
Unfortunately, this trick didn't seem to work on win2K (I have weared out my USB plug in trying,
Thank you
Enrico
Dear All,
June Release of USBDM for JMxx.
You might also be interested in the JB16 version:
This release also provides a version that supports Coldfire V2, 3 & 4 targets.
History
Enjoy.
Dear pgo,
what is about firmware sources and gerber files?
Dear LightElf,
Source code & PCB files for USBDM_JMxx(/CF).
No changes to the PCB for the USBDM H/W, Added CF version.
Unified Software for both versions
USBDM/CF_JMxx PCB Version V1.5
USBDM_JMxx Version 1.6 (no changes)
Unified S/W Version 1.5
bye
Dear all
Is it work correct?
Dear helloshi,
What have you got against FETs?
And surely R27 isn't 10K?
bye
Dear pgo,
Sorry, R27 is 100R.
I have only transistor.
It can be normal to use ?
bye
Dear helloshi,
Re: Using BSTs
I just prefer FETs as they have negligible drive current.
However, looking at the circuit again I would have some concerns about R9 turning on when the RST line is pulled low. RST going low would pull the base of Q9 low through the BE junction of Q10. This would turn on Q9. This might not be apparent in voltage measurements but might result in excessive current from the Flash supply. Even when RST is high I would expect Q9 to be partially on if VPP is 12V.
Finally I would have to think about how Q10 & Q11 work and my brain's too tired at the moment
bye
Dear pgo,
Thank you for your guidance. I understand it.
However,Can you talk about the role of the Q4 ,in your circuit.
thanks a lot.
bye.
Dear Helloshi,
Please see the discussion in the following thread (page 2) which describes the same circuit used by the JB16 version of USBDM.
bye