Disable ISP mode for LPC55

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

Disable ISP mode for LPC55

4,589 次查看
jimmyli
Contributor IV

Hi NXP,

       Our customer will disable ISP mode before booting, below is the code to modify the CMPA register. 

       But after running the code, LPC55 will disable ISP and SWD (debug) function.

       Question:

       1> Why the code will affect the debug funtion ?

       2>How to recover the debug function ?

       3>How to disable ISP mode only ?

      

       Thanks very much.

 

jimmyli_0-1726051223724.png

标签 (1)
0 项奖励
回复
11 回复数

4,568 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my name is Pavel, and I will be supporting your case, I reviewed your case see questions below, 

       1> Why the code will affect the debug function?
Maybe the register was not written correct, what was the hex number you use to write?

       2>How to recover the debug function?
For that need to do a mass erase, could use the SPT tool or the BLHOST tool.

       3>How to disable ISP mode only?
Let me research more information about this.

Best regards,
Pavel

0 项奖励
回复

4,551 次查看
Johnson_Ho
Contributor I

Hi, Pavel,
1>from the code, you can see that I have read the orignal data via the function FFR_GetCustomerData, then change the first byte to 0x70, and then write it back to the flash via FFR_CustFactoryPageWrite. And I
have took a quick look at the original data when debug, there were all 0x00.
2>Is the SPT tool or the BLHOST tool could work without debug port? and where can I get those tools?

0 项奖励
回复

4,538 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my apologize I never use it before that function FFR_CustFactoryPageWrite. I saw the CMPA information, and the disabled ISP is on address 0x9E400 and need to put 0x70 to active the 6:4 bits.

So, I reviewed your function FFR_CustFactoryPageWrite your data configuration seems to be well, offset 0 and len 512, and the same with the FFR_CustFactoryPageWrite.

Pavel_Hernandez_0-1726186149858.png

Could you please share me this part of your code to get more details? 

-To use the BLHOST I recommend install the SPSDK, this has a bunch of tools in same places.

I make on the past a similar document with other LPC maybe could help you. 

attached below, only change the LPC for the LPC55s69, and the address that you need to modify.

Best regards,
Pavel

0 项奖励
回复

345 次查看
danielholala
Senior Contributor II

Thanks @Pavel_Hernandez , that document was helpful.  Your document contains the information absent from both the reference manual and the BLHOST manual, but which ought to be included in those manuals.

0 项奖励
回复

4,462 次查看
Johnson_Ho
Contributor I

1>the original data is as below:

Johnson_Ho_0-1726620655739.png

I have modified the 0x2000186c to 0x70, and then write it back.

2>I have installed the spsdk, and connect the board via cmsis-dap,but I got a different result from the manual when I use the "nxpdevscan" command:

Johnson_Ho_1-1726621192269.png

 

 

0 项奖励
回复

4,457 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, about the communication with the Blhost you need to use a UART and USB to Serial. I mean connect your board to the PC push the bottom ISP and then Reset to enter in ISP mode.

Pavel_Hernandez_0-1726682568934.png

On the board the debugger has UART interface you can use the same debug link port P6.

Best regards,
Pavel

0 项奖励
回复

4,447 次查看
Johnson_Ho
Contributor I

I have modified the first byte(offset 0)to 0x70,which means disabling the ISP pin according to the TRM. Could I use the ISP pin to enter the ISP mode?

标记 (1)
0 项奖励
回复

4,438 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, if the ISP is disable and the SWD is active, you could use the flash IAP to restore that.

Here is a thread that could help you about that

[LPC55]: Disable ISP and SWD to utilize code protection - NXP Community

Best regards,
Pavel

0 项奖励
回复

4,394 次查看
Johnson_Ho
Contributor I

My problem is When I disabled the ISP(modified the first byte to 0x70), the SWD also been disabled. So the chip is unable to recover.

0 项奖励
回复

4,327 次查看
Pavel_Hernandez
NXP TechSupport
NXP TechSupport

Hello, my apologize for the delayed response, how the SWD was locked too? Did you write other number instead of 0x70? to recovery need to do a mas erase but, in this case, maybe could use the mailbox.

Updated Debug Mailbox commands for LPC55S69 - NXP Community

Best regards,
Pavel

0 项奖励
回复

4,550 次查看
jimmyli
Contributor IV

Hi Pavel,

      Thanks very much.

      I will loop in our customer to check with you.

0 项奖励
回复