On Fri, Aug 12, 2011 at 12:03 PM, Xiaofan Chen <xiaof...@gmail.com> wrote:
> On Fri, Aug 12, 2011 at 11:17 AM, Antonio Borneo
> <borneo.anto...@gmail.com> wrote:
>> in Jlink code in src/jtag/drivers/jlink.c
>> there is the following:
>>    static int jlink_init(void)
>>    {
>>        ....
>>        /*
>>         * The next three instructions were added after discovering a problem
>>         * while using an oscilloscope.
>>         * For the V8 SAM-ICE dongle (and likely other j-link device 
>> variants),
>>         * the reset line to the target microprocessor was found to cycle only
>>         * intermittently during emulator startup (even after encountering the
>>         * downstream reset instruction later in the code).
>>         * This was found to create two issues:
>>         * 1) In general it is a bad practice to not reset a CPU to a known
>>         * state when starting an emulator and
>>         * 2) something critical happens inside the dongle when it does the
>>         * first read following a new USB session.
>>         * Keeping the processor in reset during the first read collecting
>>         * version information seems to prevent errant
>>         * "J-Link command EMU_CMD_VERSION failed" issues.
>>         */
>>
>>        LOG_INFO("J-Link initialization started / target CPU reset 
>> initiated");
>>        jlink_simple_command(EMU_CMD_HW_TRST0);
>>        jlink_simple_command(EMU_CMD_HW_RESET0);
>>        usleep(1000);
>>
>> During JLink initialization OpenOCD forces nTRST and nSRST.
>> Personally I do not like it, since I use to attach OpenOCD on running
>> boards and I want to start debugging without resetting the CPU.
>> In my personal build of OpenOCD I always comment the nSRST part.
>> I never got the problem reported in the comment above, but I only have
>> JLink version 5 and 6.
>>
>> What about removing these two code lines instead of cutting nTRST and
>> nSRST wires?
>
> Thanks a lot for the information.
>
> I will try to borrow a V8 from my colleague and try this out over the
> weekend.

Unfortunately commenting out the 4 lines does not help.

C:\openocd\openocd_0.5.0_mingw\bin>openocd_mod.exe -f
interface/jlink.cfg -f target/lpc2478.cfg
Open On-Chip Debugger 0.5.0 (2011-08-12-16:07)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html
Warn : Adapter driver 'jlink' did not declare which transports it allows; assumi
ng legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
init_targets
Warning - assuming default core clock 4MHz! Flashing may fail if actual core clo
ck is different.
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
500 kHz
Info : J-Link ARM Lite V8 compiled Jan 31 2011 18:38:46
Info : J-Link caps 0xb9ff7bbf
Info : J-Link hw version 80000
Info : J-Link hw type J-Link
Info : J-Link max mem block 8496
Info : J-Link configuration
Info : USB-Address: 0xff
Info : Kickstart power on JTAG-pin 19: 0xffffff01
Info : Vref = 3.274 TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 1 TRST = 1
Info : J-Link JTAG Interface ready
Error: usb_bulk_read failed (requested=1, result=-5)
Error: jlink_tap_execute, wrong result -107 (expected 1)
Info : clock speed 500 kHz
Error: usb_bulk_read failed (requested=1, result=-116)
Error: jlink_tap_execute, wrong result -107 (expected 1)
Error: usb_bulk_read failed (requested=1, result=-5)
Error: jlink_tap_execute, wrong result -107 (expected 1)
in procedure 'transport'
in procedure 'init'

C:\openocd\openocd_0.5.0_mingw\bin>openocd_mod.exe -f
interface/jlink.cfg -f target/lpc2478.cfg
Open On-Chip Debugger 0.5.0 (2011-08-12-16:07)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html
Warn : Adapter driver 'jlink' did not declare which transports it allows; assumi
ng legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
init_targets
Warning - assuming default core clock 4MHz! Flashing may fail if actual core clo
ck is different.
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
500 kHz
Error: J-Link command EMU_CMD_VERSION failed (-5)
Info : J-Link JTAG Interface ready
Error: usb_bulk_write failed (requested=6, result=-116)
Error: jlink_tap_execute, wrong result -107 (expected 1)
Error: J-Link setting speed failed (-116)
in procedure 'init'

-- 
Xiaofan
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to