cancel
Showing results for 
Search instead for 
Did you mean: 

PCROP, End-user usage example

B.Kaya
Associate III

Hello,

I have already read the AN4758 application note and I still have a few questions regarding PCROP.

I have a project for end-users where the main application provides functions (API) that users can call to develop their own code. I was originally planning to provide these functions as a static library, but since PCROP is very useful and secure, I would prefer to protect my API using PCROP instead of distributing a library with unnecessary header files.

In my application, the region 0x08000000 to 0x0805DFFF contains my API code. I plan to flash this code first and then protect this area with PCROP.

Here are my questions:

  1. If the end-user creates an empty project and I only provide the header files, can they still debug their own application even though the API code region is PCROP-protected?

  2. Since a PCROP-protected area cannot be read or written, is there any way to update my API code later? I have a CAN bootloader, but this region will be protected by PCROP.

(I am using STM32G474RET6 with custom board.)

Thanks for your help,
BK

1 REPLY 1
Jocelyn RICARD
ST Employee

Hello @B.Kaya ,

Setting PCROP region at beginning of flash can only work if you change boot address to be outside this region, other wise it will crash. On STM32G4 there no such option.

Also, there is no way to update PCROP area independently. You must go through a regression from RDP1 to RDP0 that will erase everything.

There is no simple solution on STM32G4 to isolate your code.

Best regards

Jocelyn