LPC1343 lost SWD capabilities after setting NO_ISP CRP Mode

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC1343 lost SWD capabilities after setting NO_ISP CRP Mode

1,536 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by BrunoF on Wed Jan 08 23:08:13 MST 2014
Hi there,

im using a LPCXpresso 1343 board, and just programmed the target device in NO_ISP mode. Now, i'm getting the "Failed to connect: Ee(07). Bad ACK returned from status - wire error.:" while trying to re-program a new firmware to the device via LPCXpresso Run or Debug modes. Why is this happening?

As i read in the AN10968:

Quote:
These devices also feature a new protection level “NO_ISP” which will suppress response to the ISP pin at system startup (but will not prevent debug via SWD, nor will it prevent read access to flash memory)



So, OK. I was expecting loosing ISP capabilities (no more serial or USB bootloader) but why SWD too? Why im not being able to update/debug the firmware via LPCXPresso? Is there an option in Project Settings that i should change?

Thanks for reading.
标签 (1)
0 项奖励
回复
5 回复数

1,442 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by BrunoF on Thu Jan 09 09:33:58 MST 2014
I've used:

#include < NXP/crp.h >

// Variable to store CRP value in. Will be placed automatically
// by the linker when "Enable Code Read Protect" selected.
// See crp.h header for more information
__CRP const unsigned int CRP_WORD = CRP_NO_ISP ;

Dissasembly shows:

000002fc < CRP_WORD >:
     2fc:7370 4e69                                   psiN


Which seems correct for NO_ISP mode.

P.S. Text parser is eating texts closed betweeen < and >, even inside
 block
P.S. 2: Vector Catch doesn't work either.
Thanks!
0 项奖励
回复

1,442 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Jan 09 09:05:37 MST 2014

Quote: BrunoF
Current Firmware is OK (user code is valid). SWD isn't failing sometimes, it's failing everytime.



And the answer is: SWD is failing sometimes (even if axf code is correct). This is a known effect (at least for me) since 2009.
There was never an official clarification if this is a bug and I doubt you get an official answer from NXP.
So you need ISP to regain access via SWD at all. Via PIO0_1 or with your own mechanism. And the lesson of this behaviour is: Don't switch off ISP if you ever want to flash your LPC again. That's a general rule at least for all software writers I know... 
0 项奖励
回复

1,442 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Jan 09 08:59:02 MST 2014
So the obvious thing is to check is that you really did program the right value into flash at 0x2fc. Please disassemble the exact image that you programmed into flash. The simplest way to do this is probably by using the GUI to disassemble the AXF file:

http://support.code-red-tech.com/CodeRedWiki/DisassObsjExes

Regards,
LPCXpresso Support
0 项奖励
回复

1,442 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by BrunoF on Thu Jan 09 08:38:39 MST 2014
You just quoted me a part of text from CRP3 mode (wich isn't the one i used). I understand that they share that quoted part but still, the difference (related to this subject) between CRP3 and NO_ISP mode is that CRP3 mode disables SWD pins, while NO_ISP doesn't. That's kind of the whole difference between NO_ISP and CRP3 modes! And should be the BIG difference between being able to reprogram/debug target via SWD pins or not.

I'm using LPC-Link via LPCXpresso to program the target.
Current Firmware is OK (user code is valid). SWD isn't failing sometimes, it's failing everytime. I can't program the target via JTAG :(
So, my real question seems to be: Why i'm not being able to debug/program via SWD pins (JTAG) in NO_ISP mode?

0 项奖励
回复

1,442 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Jan 09 01:25:50 MST 2014
First of all: You are not losing ISP, just sampling of pin PIO0_1.

UM:

Quote:
It is up to the user’s application to provide a flash update mechanism using IAP calls or call reinvoke ISP command to enable flash update via UART0.



It's no surprise that sometimes SWD is failing. If your chip isn't in ISP mode already (user code not valid) and you've not included your own mechanism to reinvoke ISP there's not much you can do.

Try to use 'Vector catch'.
If you use LPC-link2, try LPC-link.

After that it's time to heat up your solder iron...


0 项奖励
回复