AnsweredAssumed Answered

PCROP protection

Question asked by francescato.diego on Mar 20, 2015
Latest reply on Aug 11, 2015 by 68516
For our customer I need build a new hw with a ST micro (STM32F4) with a pre-porgrammed code library.
The client develops its own application using the preloaded library (Obviously I provide also all the necessary file for link the library functions with its code)

If  I provide the flash with RDP = 1 protection I think it is always possible through my bootloader, to be activated in some way, upload in flash the customer application ?

...but the customer could write a trivial code that dumps the all flash area that contains the libraries code and he could create a full flash image.

From ST docs I read that  I can enable selective protection of certain flash sectors using the PCROP function that disables the "data mode access" for flash memory.
This would prevent the client to run a dump of the memory but...
This simple code example

const char message1 [] = "my message text1";
const char message2 [] = "my message text2";
const char message3 [] = "my message text3";
void print_message (char * p, uint8_t msgid)
  if (msgid = 1) sprintf (p, "% s", message1);
  if (msgid = 2) sprintf (p, "% s", message2);
  if (msgid = 3) sprintf (p, "% s", Message3);

located in protected area PCROP work?  The messagex strings are accessible ?

areas protected by PCROP are locked and a library software upgrade require erase of the entire flash.
Executing this procedure from RAM
- full erases the flash bringing the RDP=0
- updates the library code
- restores PCROP protection on library flash area.
- enables RDP = 1
is possible ?

thanks to all