This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Flash Protection functions

Hai i have a small doubt in flash protection funtions.

I have studied Flash protection function in that i have one function that is ROM_FlashProtectSet()  in this the parameters are FlashReadWrite,FlashReadOnly,FlashExecuteOnly.

Here my objective is i need to protect the flash through these functions for that i have tried programming with these functions but i am not able to getting these explanations.In generally the Flash read only parameter says that block can be read and excuted .Now in this my doubt is it read by the processor or JTAG debugger?

And my aim is the code (out file or bi file)should be execute(in the microcontroller) and write by the debugger every time .But should not read out by the debugger through JTAG or SWD ....etc . Here i need to protect my code with blocking the flash.What the parameter i need to use for this?

Thank u...........

  • Hello Surendra

    To explain what it is when Flash protection is defined

    1. The device does not distinguish between Debugger or CPU when Flash protection is set.
    2. If you write by debugger then all IDE's require to read it back to make sure that the correct programming has happened. By disallowing it you may end up making the application behave unpredictably.

    To solve the issue, i would suggest disabling JTAG altogether using BOOTCFG or by converting JTAG Pins to GPIO. This will block write as well, but will secure (to some debatable extent) the code. The only way to get in is to erase the code externally, so a user would only end up getting erased device.

    Regards
    Amit
  • Is it not a fact that this post - in its (many) incarnations - can never succeed in "absolutely guaranteeing" that skilled, motivated, equipped hackers will not have every byte of posters (protected?) code in short order?

    Really - even w/clever disguise - does asking the same question to the point of exhaustion make any sense?
  • Hello cb1,

    Yes, that is true. What can be done is only a low level "denial of code access".

    Regards
    Amit