Can't flash kw2xd since Low Power Mode enabled

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

Can't flash kw2xd since Low Power Mode enabled

1,788 Views
olivierfauchon
Contributor II

Hi, 

I'm working on phyWAVE  KW2xD ARM Cortex-M4 board (KW22D512VHA5) with RIOT-OS. 

I had no prior problems for flashing, debugging, running my code through OpenOCD / JLink / SWD interface. 

But yesterday, I changed some code to enable Low Power Mode (LLS), and I flashed the new code.

Since this update, I can't connect anymore the board with JLink/SWD .

Here is what I get when I try to flash : 

Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
swd
Info : add flash_bank kinetis kx.flash
adapter speed: 1000 kHz
none separate
cortex_m reset_config sysresetreq
Info : No device selected, using first device.
Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46
Info : Hardware version: 8.00
Info : VTarget = 2.685 V
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Error: MDM: failed to read ID register
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477

....
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477

Info : SWD DPIDR 0x2ba01477
Error: Could not initialize the debug port
TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0* kx.cpu cortex_m little kx.cpu unknown
Info : SWD DPIDR 0x2ba01477
Error: MDM: failed to read ID register
Info : SWD DPIDR 0x2ba01477

Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477
.....
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477
Error: Could not initialize the debug port
Error: Target not examined, reset NOT asserted!
in procedure 'reset'
in procedure 'ocd_bouncer'

Can you tell me if  Low Power Modes can affect JTAG / SWD ?

Is my board/MCU bricked ?  Are there workaround to recover it ? 

What are the safeguards to avoid this situation ? 

I was thinking about a delay at startup before enabling Low Power Modes, so programmer always have a couple

of seconds to halt processor.

Thanks

Olivier Fauchon 

0 Kudos
3 Replies

1,422 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Olivier Fauchon,

Regarding your questions please see my comments below.

Can you tell me if  Low Power Modes can affect JTAG / SWD?

Yes, when you send your MCU to a low power mode and you don't wake it up it will cause problems with the JTGA / SWD interface.

Is my board/MCU bricked?  Are there workaround to recover it? 

Yes, your board is bricked but you can recover it. What debugger are you using? What IDE are you using? To recover your board first your debugger needs to have some control over the reset line. After, you must configure your IDE to generate a Hardware reset (set to low the reset line) when launching the debug session. 

What are the safeguards to avoid this situation? 

The best option is to always have a way to wake up the MCU from the low power modes. 

Hope it helps!

Victor.

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,422 Views
olivierfauchon
Contributor II

Hi Victor, 

Thanks for your answer. 

I use JLink adapter with OpenOCD (configured with SWD transport)

I searched about Arm Reset, and I found there are two reset (SRST- which correspond pressing Reset buttons of MCU, and another TRST- Test Reset pin which is related to JTAG controller :   

Screenshot from 2018-11-24 09-00-04.png 

Should I wire both RESET  lines  to flash again my device ? 

It seems my programmer supports driving these two reset pins (nTRST / RESET) 

Screenshot from 2018-11-24 09-05-35.png

Thanks for you help

Olivier

0 Kudos

1,422 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Olivier,

You need to connect the following Reset pin of the debugger to the SRST pin of the MCU. 

pastedImage_1.png

Hope it helps!

Regards,

Victor.

0 Kudos