Hello Øyvind Harboe,
Actually with your current modification on openocd.c (startup: fix bugs
in cleanup upon errors during startup), the function: adapter_quit is
called all time if startup be called. It's a good thing but on function:
adapter_quit, nothing is made if jtag == NULL.
And at the startup, the function: adapter_init is call to set pointer:
jtag and open an adapter handle. But if an error occurs during the
adapter init, the pointer: jtag be replaced by NULL. Even if a JTAG
adapter is opened (To close it later).
So correctly close to correctly close the JTAG adapter handle in any
cases, it's necessary to keep the pointer: jtag content in the case if
the JTAG adapter is opened.
As it's during an error that is possible to quit OpenOCD without close
the JTAG adapter handle, I think it's a good thing to add the knowledge
of error and JTAG adapter handle status (and I didn't know if it's a
good or a bad thing to add a value or a function on structure:
jtag_interface).
It's possible to add a new value on structure: jtag_interface, but I
don't have all JTAG adapters and I don't know the working of all JTAG
adapters so, I can’t make all tests to grant that I doesn't add bug for
others JTAG adapter.
So I have made the choice to add:
ERROR_JTAG_INIT_FAILED_WITH_UNOPEN_DEVICE
--
Regards,
Sébastien Farquet
http://www.amontec.com/
Amontec JTAGkey-2 : High speed USB JTAG interface
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development