I have a big problem when using JTAGkey and openocd, my windows system crash and a blue screen is displayed and then restart.
When run openocd without specifying in configuration file to use JTAGkey , it’s ok, but when in configuration file I specify to use Amontec JTAGkey, windows crash.
My system is an IBM T42 laptop, running Windows XP SP2. The USB host controller on my pc is an Intel 82801DB/DBM.
When this happen JTAGkey is connected to computer but is not connected to any board.
The demo software from amontec is running fine, but I guess amontec demo is using ftcjtag.dll to access the driver and openocd is working directly with it.
I’m totally confused, I can’t continue my work because of this ugly issue
After spending some time to understand how to build openocd from sources I found that it crash when FT_OpenEx function is called. I tray to hard code the parameters but without success FT_OpenEx(“Amontec JTAGkey A”, FT_OPEN_BY_DESCRIPTION, &ftdih).
But if I disable FT_OpenEx and I call FT_ListDevices function, this one is running fine and display the available devices.
Also I made a simple project in vc++6 to test the library, and everything it’s fine, I can access the JTAGkey device without any problems.
Maybe the problem is coming from cygwin …
I don’t understand why this problem appear only on my machine , if it’s something related to hardware configuration why the vc++ test is working …
-FT_OpenEx function don’t fail if FT_HANDLE is declared locally, in the function that call FT_OpenEx, ft2232_init_ftd2xx. The fail occur if the passed FT_HANDLE variable is declared outside the function ft2232_init_ftd2xx
-if I declare a pointer of FT_HANDLE and I pass it to FT_OpenEx function this pointer and not the reference of FT_HANDLE then there is no more system crash (blue screen), but a windows xp memory corruption message
static FT_HANDLE *ftdih; … static int ft2232_init_ftd2xx(u16 vid, u16 pid, int more, int *try_more) { … FT_OpenEx(openex_string, openex_flags, ftdih)) … }
in test application I made in cygwin everything works fine even if FT_HANDLE is declared outside the main function, or is static.
taken care of the above statements, I tray to create a locally FT_HANDLE (declared in function ft2232_init_ftd2xx), call FT_OpenEx with this one and then to pass the returned handler pointer to the global variable; well it’s so funny, because when I assign the local variable to the global one it crash again
So I guess there is something wrong in the way openocd play with memory addresses, and in some cases you may have these kind of stupid issues.