2014-03-27 06:18 AM
I use eeprom emulation library on STM32f107.
I don't understand relations of eeprom emulation and flash protection.If I use flash as eeprom,Is code protection failed? or something else...?Its any relation between these? #flash-protect #eeprom-emulation2014-03-27 07:02 AM
You'll have to experiment.
As far as I'm aware read-out protection does not limit code in FLASH reading other data in FLASH, or writing or erasing sections of FLASH. You'd have to mass erase the part to turn off read-out protection.2014-03-27 07:56 AM
Hi
Please specify what you mean by ''flash protection'' Do you mean - Flash read out protection or Flash sector lock?2014-03-28 05:57 AM
Thank for your answers.
1.I want to protect my code versus extraction methods.2.I want to use eeprom emulation(use flash for data read and write) too.I said: ''I dont understand flash sector lock or unlock and read out protection relations'',Can tell me what the meaning of flash sector lock and read out protection difference?I secure the chip with jlink program menu:In this state mcu operation has no problem and read from flash(eeprom emulation) is good.but no success operation when I want to write data to flash and data is not saved.What can I do? Is this way true?Thanks.2014-03-28 06:05 AM
Hi
''Can tell me what the meaning of flash sector lock and read out protection difference?'' 'flash sector lock' - adds an extra level of protects when trying to erase/program Flash. Helps to stop erroneous erasing and programming of Flash. 'flash read out protection' - stops the ability to read out the contents of the flash when turned on.2014-03-28 07:06 AM
2014-03-28 07:30 AM
Thanks.
OK,I want read out protection and write to some page of flash at runtime.So ''secure chip'' don't solve my problem at all.I want to use EEPROM_Write... and its not work on this mode,but I have another question: Is ''secure chip'' protect the code from read out?,because I cant read mcu in this mode with debugger or program it in uvision.All of flash will be erased after ''Unsecure chip''.Is there any way that I can use ''Read out protection'' and write in flash at runtime?how can I enable read out protection(principled way)?Thanks.2014-03-28 07:55 AM
''So ''secure chip'' don't solve my problem at all.''
'' Is ''secure chip'' protect the code from read out?'' I do not know what this feature does. ''because I cant read mcu in this mode with debugger or program it in uvision.'' This suggests the Read out protection has been enabled. ''Is there any way that I can use ''Read out protection'' and write in flash at runtime? how can I enable read out protection(principled way)?'' Read out protection does not stop the STM32 reading or writing to the Flash. Read out protection can be enabled/disabled through the option bytes of the processor. See the reference manual or data sheet for the device you are using for information about the option bytes and how to use them (For a STM32F4xx it is in the Flash memory section - do not know where it will be for your part). It should explain the memory address for the option bytes, what they are/do and what the sequence is to set them. There may be functions provided in the standard peripheral library to set the option bytes.2014-03-31 03:20 AM
I found this function on flash peripheral library:
FLASH_ReadOutProtection();
This function change option byte and then,readout protection has been activated.
There is no write protection flash page in this state,and work with eeprom emulation without any problem.
There is a tip in ReadOutProtection: Mcu needs power on reset after set readout option byte.
reset pin,or other reset solution don't reload option byte,
only
power on reset
reload readout protection data. ''J-Link secure'' enable readout protection and flash write protection.We need only readout protection in eeprom emulation.So its not useful for this thread. Thanks for your answers. Problem Solved.