Monday, February 19th 2018, 8:42pm UTC+1

You are not logged in.

  • Login
  • Register

noisternigw

Beginner

Date of registration: Nov 24th 2017

Posts: 5

Location: Bad Oldesloe

1

Friday, November 24th 2017, 3:34pm

J-Link Plus does not find devices on JTAG chain (J-Trace does)

Hi,

today we got our new J-Link Plus device. It works just find with single MCUs.
With our boards which have 2 MCUs (Kinetis K22) on a JTAG-chain, it refuses to find any of the MCUs. We used the same settings as for out J-Trace for ARM, which works as expected.
Are there any special settings? We already tries to reduce the JTAG-Speed down to 5kHz.

The "detect" button does not find anything. We just get the Message "ERROR: InitTarget(): PCode returned with error code -1". This also happens if we try the "Simple configuration". Then we get this:
Connecting ...
- Target interface speed: 4000 kHz (Fixed)
- VTarget = 3.341V
- ERROR: InitTarget(): PCode returned with error code -1
- ERROR: Failed to connect.
Could not establish a connection to target.

Any ideas, why the J-Link Plus does not work?

Br,
Wolfgang

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 699

2

Friday, November 24th 2017, 4:45pm

Hello Wolfgang,

Thank you for your inquiry.

Such an issue is not known to us.

Quoted

Are there any special settings? We already tries to reduce the JTAG-Speed down to 5kHz.

With what software are you trying to connect to the target devices?
Are you using the exact same debug interface for J-Link as you did with J-Trace?
Has anything changed between your setups or are they 100% the same except the used debug probe??

Quoted

The "detect" button does not find anything.

What detect button do you mean specifically?
Could you post a screenshot of the error you are seeing?

Best regards,
Nino

noisternigw

Beginner

Date of registration: Nov 24th 2017

Posts: 5

Location: Bad Oldesloe

3

Friday, November 24th 2017, 5:02pm

Hi Nino,

we use the J-Flash v6.20h software. I talked about the "detect" button in the "Project settings" :-)

The setup is exactly the same, I only exchanged the J-Trace with a J-Link.
This is how it looks with the J-Trace after pressing the "detect" button:


With J-Link Plus it looks like this:


I changed the configuration to directly select the target:


Then I tried to connect:


Br,
Wolfgang

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 699

4

Wednesday, November 29th 2017, 10:59am

Hello Wolfgang,

Thank you for providing the additional information.

We are wondering how it is working with the J-Trace at all. The problem with Kinetis devices is that we need to use a special connect sequence which per default assumes only a 1 device chain.
When using the J-Trace are you able to connect and program both targets or does only "detect" work but everything else not?

Could you try and use the J-Link Commander and try to connect to the devices with J-Trace and J-Link and post screenshots of the complete Commander output?

Would it generally be possible to send us your custom hardware to investigate this behaviour in house?

When setting up the chain did you consider the following? https://wiki.segger.com/Kinetis_Series_Devices

Best regards,
Nino

noisternigw

Beginner

Date of registration: Nov 24th 2017

Posts: 5

Location: Bad Oldesloe

5

Monday, January 15th 2018, 4:14pm

Cortex-M4 identified as Cortex-M0

Hi again,

now I had some time to play around with this problem again.
I used the JLink Commander for my tests and I created a small JLinkScript:

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
int InitTarget(void) {
	JLINK_SYS_Report("Kinetis K22 JTAG chain - InitTarget");
	JLINK_JTAG_Reset();
	if (JTAG_TotalIRLen != 8) {
    	MessageBox("Can not find both CPUs");
    	return 1;
	}
	JTAG_AllowTAPReset = 1;
	CPU = CORTEX_M4;
}


With this code, both CPUs are found if there is any firmware available in the controllers:


If I now do an erase on the controller and perform a reset, I get the following (Cortex-M0 detected instead of Cortex-M4):


Sometimes the controller gets locked and I get the following:


If the controller is locked, I am not able to unlock it with JLink Commander (unlock kinetis). I have to use another Toolchain to unlock the controller.

Any idea, how to connect to the device again after erasing it? Right now I had a third behaviour after erase:


I'm a little bit confused right now...

Br,
Wolfgang

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 699

6

Wednesday, January 17th 2018, 3:45pm

Hello Wolfgang,

That behaviour matches the issue described in the wiki article: https://wiki.segger.com/Kinetis_Series_Devices

Make sure that the Reset pins on *each* target device have a Diode positioned as described to make sure that the target devices don't reset each other if no application is running in them.
Did you implement this on your hardware?

Best regards,
Nino

noisternigw

Beginner

Date of registration: Nov 24th 2017

Posts: 5

Location: Bad Oldesloe

7

Wednesday, January 17th 2018, 4:07pm

Hi Nino,

thanks for your answer.
We implemented something like this. It is an external watchdog system which separates the interrupt pins of the target devices (the watchdog functionality can be disabled by jumpers).
We use the same hardware via JTAG chain with a debugger from one of your competitors and it works. We are able to flash both target devices, regardless if they are empty or not. It is also possible to unlock both target devices.
So I think it is a problem with the initializazion.
Nevertheless, I will check our hardware again in respect of the reset pins.

Br,
Wolfgang

noisternigw

Beginner

Date of registration: Nov 24th 2017

Posts: 5

Location: Bad Oldesloe

8

Friday, February 9th 2018, 2:47pm

Hi Nino,
Hello Wolfgang,

That behaviour matches the issue described in the wiki article: https://wiki.segger.com/Kinetis_Series_Devices

Make sure that the Reset pins on *each* target device have a Diode positioned as described to make sure that the target devices don't reset each other if no application is running in them.
Did you implement this on your hardware?

Best regards,
Nino
we changed one of our boards and replaced our watchdog with just the diodes. It still does not work :-(
I have one controller with firmware (device 1) and one without (device 0). I can connect to device 1 without any problem, but not to device 0 using the JLink Software (v6.30b).

Best reagrds,
Wolfgang

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 699

9

Thursday, February 15th 2018, 11:34am

Hello,

This thread will be handled further per e-mail so it will be closed now.

Best regards,
Nino