LPC5528 Simple CRP enable/disable

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

LPC5528 Simple CRP enable/disable

跳至解决方案
995 次查看
bressan
Contributor III

I want to write a simple code read protection for LPC5528, which can be enabled/disabled via USB.

Until now, I have only LPC55S28.

Afraid of bricking the device, I tried writing in customer area first.

I tried writing on a LPC55S28 via FFR this way:

 

 

DisableIRQ(); setcpu100MHz();
Status = FLASH_Init(&flashInstance); //returns 0
Status = FFR_Init(&flashInstance);  //returns 0=ok
FLASH_GetProperty(&flashInstance, kFLASH_PropertyPflashPageSize, &PflashPageSize);

Status = FFR_InfieldPageWrite(&flashInstance, iap_FlashRam, len);
//returns 0x64. why?

 

 

iap_flashram contains a copy of the 0x09df00 region with modified data at offset 0x100. len is 32 bytes.

标签 (1)
0 项奖励
1 解答
978 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

 

Hello Bressan,

Yes, the length must equal the page size.

Alice_Yang_0-1651042551025.png

There may be different length for other part flash page.

 

BR

Alice

在原帖中查看解决方案

0 项奖励
3 回复数
926 次查看
bressan
Contributor III

For all users, which want to implement simple CRP (Code Read Protection) for LPC55xx / LPC55Sxx:

Disable debug, and fully read protection: CMPA cc_socu_pin / cc_socu_dflt to 0xFC0003FF / 0xFFFF0000

Reenable debug: CMPA cc_socu_pin / cc_socu_dflt to 0/0 and CFPA set all 0 and increase version.

0 项奖励
979 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

 

Hello Bressan,

Yes, the length must equal the page size.

Alice_Yang_0-1651042551025.png

There may be different length for other part flash page.

 

BR

Alice

0 项奖励
986 次查看
bressan
Contributor III

I was able to write, if len==0x200.
It seems, like I must write the full page at once. So, why is there a parameter for the length?

0 项奖励