ERROR: InitTarget(): PCode returned with error code -1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ERROR: InitTarget(): PCode returned with error code -1

9,061 Views
chiao-weitsai
Contributor I

Hi All:

I try to load example project to FRDM-KW41Z, But it always show "ERROR: InitTarget(): PCode returned with error code -1".

I also try removing Anti-virus and disabling firmwall. But i also get same issue.

Please help to check log and give me some suggestion. thanks.

Board:FRDM-KW41Z

IDE:MCUXpresso IDE v10.0.2 [Build 411] [2017-07-11]   

Project:frdmkw41z_demo_apps_hello_world

==============LOG===========================

Could not connect to target.
  SEGGER J-Link GDB Server V6.16b Command Line Version
  JLinkARM.dll V6.16b (DLL compiled Jun  9 2017 18:03:30)
  -----GDB Server start settings-----
  GDBInit file:                  none
  GDB Server Listening port:     2331
  SWO raw output listening port: 2332
  Terminal I/O port:             2333
  Accept remote connection:      localhost only
  Generate logfile:              off
  Verify download:               on
  Init regs on start:            off
  Silent mode:                   off
  Single run mode:               on
  Target connection timeout:     0 ms
  ------J-Link related settings------
  J-Link Host interface:         USB
  J-Link script:                 none
  J-Link settings file:          none
  ------Target related settings------
  Target device:                 MKW41Z512xxx4
  Target interface:              SWD
  Target interface speed:        auto
  Target endian:                 little
  Connecting to J-Link...
  $$UserActionStart$$: Terms of use
  $$UserActionEnd$$: Terms of use
  J-Link is connected.
  Device "MKW41Z512XXX4" selected.
  Firmware: J-Link OpenSDA 2 compiled May  6 2016 11:04:17
  Hardware: V1.00
  S/N: 621000000
  Checking target voltage...
  Target voltage: 3.30 V
  Listening on TCP/IP port 2331
  Connecting to target...Executing InitTarget()
  Connect Under Reset
  Connect Under Reset
  Executing InitTarget()
  Connect Under Reset
  Connect Under Reset
  ERROR: InitTarget(): PCode returned with error code -1
  Executing InitTarget()
  Connect Under Reset
  Connect Under Reset
  Executing InitTarget()
  Connect Under Reset
  Connect Under Reset
  ERROR: InitTarget(): PCode returned with error code -1
  ERROR: Could not connect to target.
  Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
  Shutting down...
  Could not connect to target.
  Please check power, connection and settings.

Tags (2)
0 Kudos
Reply
3 Replies

2,112 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

You met board connection problem.

to confirm if this problem is on firmware side,I suggest you update your board firmware then test again.

OpenSDA Serial and Debug Adapter|NXP 

I suggest you try DAPLink rev0241

pastedImage_2.png

Can this firmware fix the connection problem?


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

2,112 Views
nxf42424
NXP Employee
NXP Employee

Hi I have tried on the TWR-K65F120M platform, but it will produce this result!

I downloaded this.

pastedImage_2.png

pastedImage_1.png

0 Kudos
Reply

2,112 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Ding,

This thread is of two years ago. We don't maintain it now.

I suggest you create a new thread for your issue.

We will help.

Thanks for your understanding.

Have a nice day,

Jennie Zhang

0 Kudos
Reply