Hi Chen Xiaofan

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?

Best Regards
Antonio Borneo

On Fri, Aug 12, 2011 at 10:00 AM, Xiaofan Chen <xiaof...@gmail.com> wrote:
> On Sun, Jul 10, 2011 at 8:38 PM, Jean-Christophe PLAGNIOL-VILLARD
> <plagn...@jcrosoft.com> wrote:
>>> Unfortunately this is a known issue.
>>> https://lists.berlios.de/pipermail/openocd-development/2011-July/020046.html
>>>
>>> Basically 4.10i and below works, 4.20 and above does not work.
>>>
>>> Hopefully this will be fixed with some reverse-engineering
>>> or contacting Segger. It seems Segger knows the problem
>>> and may want to work with OpenOCD developers to fix the problem.
>>>
>>> http://www.segger2.com/index.php?page=Thread&threadID=869
>> I try to get in Contact with them already hope they will reply soon
>
> Any updates?
>
> I came across this post in SparkFun forum and it might ring some bell.
> http://forum.sparkfun.com/viewtopic.php?f=18&t=28923&sid=bc50d79d7c9cc1e96e5b0d99a43008aa
> ***********
> I have some update. I run logic analyzer and noticed that Segger GDB
> server does not use nor nSRST neither nTRST during JTAG init.
> And Segger SW connects to target MCU properly. Just after RESET,
> I am getting zero on TDO.
>
> If I desoldered nSRST and nTRST, now I can connect to the AT91SAM9263.
> But do not understand, why. Can TDO signal be disabled after RESET ?
>
> "reset_config" does not work properly for JLink interface in my version of
> OpenOcd. Even if I use "reset_config none", on LA I see that RESET
> signals are both used with some default values. Is it repaired in some
> newer version of OpenOcd ?
> **********
>
>
> --
> Xiaofan
> _______________________________________________
> Openocd-development mailing list
> Openocd-development@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/openocd-development
>
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to