Page 2 of 2

Re: JLink debugging blue pill using the Sloeber IDE

Posted: Sat Aug 12, 2017 3:12 pm
by kostbill
Hi victor, now I understand what you say, that even if I am connected with JTAG, as soon as it hits the instructions that disable JTAG and enable SWD, I will no longer be able to use JTAG.

I was under the impression that normal code would not bother to do that, and that it would happen only when this is configured from the debug configuration that SWD will be used.

If this is not the case, do you happen to know where is this piece of code located? I searched for AFIO_MAPR (this is the register, in which the fields SWJ_CFG[2:0] are controlling the JTAG-SWD configuration) but didn't find anything related in the libraries.

Theses are the bits:

Code: Select all

Bits 26:24 SWJ_CFG[2:0]: Serial wire JTAG configuration
These bits are write-only (when read, the value is undefined). They are used to configure the
SWJ and trace alternate function I/Os. The SWJ (Serial Wire JTAG) supports JTAG or SWD
access to the Cortex® debug port. The default state after reset is SWJ ON without trace.
This allows JTAG or SW mode to be enabled by sending a specific sequence on the JTMS /
JTCK pin.
000: Full SWJ (JTAG-DP + SW-DP): Reset State
001: Full SWJ (JTAG-DP + SW-DP) but without NJTRST
010: JTAG-DP Disabled and SW-DP Enabled
100: JTAG-DP Disabled and SW-DP Disabled
Other combinations: no effect
But the more I read this, the more I get confused. How is it possible that both JTAG and SWD be enabled at the same time?

Re: JLink debugging blue pill using the Sloeber IDE

Posted: Sat Aug 12, 2017 10:07 pm
by kostbill
OK made it.

Pito's guide was very nice, however Sloeber (or Eclipse) is not very good. It will randomly decide to leave a perspective blank, no matter how many times you restart. Then, out of the sudden it will restore it, and many other things like that.

I also saw what victor was saying and of course he was right, Pito also spotted this some time ago, I saw it on his guide.

Now I am having other problems but hopefully these will be solved as well :).

Thanks everyone for your help.

Bill.

Re: JLink debugging blue pill using the Sloeber IDE

Posted: Sun Aug 13, 2017 7:49 am
by Pito
It will randomly decide to leave a perspective blank, no matter how many times you restart. Then, out of the sudden it will restore it, and many other things like that.
Not seen here at least for last 4 months..