LPC5528 Simple CRP enable/disable

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

LPC5528 Simple CRP enable/disable

Jump to solution
975 Views
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.

Labels (1)
0 Kudos
1 Solution
958 Views
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

View solution in original post

0 Kudos
3 Replies
906 Views
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 Kudos
959 Views
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 Kudos
966 Views
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 Kudos