How to disable Flash Protection
In this topic:
•Disable Flash protection (Pre Operation)
•Restore Flash protection (Post Operation)
This how-to guide describes how to temporarily disable Flash protection via initialization scripts for Infineon Aurix TC2xx and TC3xx devices, which then allows winIDEA to perform Flash programming.
Infineon Aurix TC2xx and TC3xx devices implement various embedded safety and security features. For example, internal CPU Flash can be protected to prevent an unauthorized microcontroller manipulation. When a section of the internal Flash has been protected, any manipulation like programming and erasing of the storage device is not allowed.
Using dedicated initialization scripts, winIDEA can temporarily unprotect Program Flash (PFLASH), Data Flash (DFLASH) and Boot Mode Header Location (BMHD) before performing flash read/write operations into these areas. Optional Flash protection password can be also entered as a script parameter.
•winIDEA 9.17.146 or newer
•iC7 / iC5 BlueBox
•Infineon AGBT Active Probe / Infineon DAP/DAPE Active Probe / 10-pin 1.27mm Infineon DAP2 Wide Debug Adapter / 22-pin ERF8 DAP2 Debug Adapter
Scripts are distributed along with winIDEA.
Infineon Aurix device |
Initialization script |
Operation |
Script function |
---|---|---|---|
TC2xx |
TC2xx_DisablePFLASHProtection.cpp |
Pre operation |
Disables PFLASH protection on TC2xx |
TC2xx_DisableDFLASHProtection.cpp |
Disables DFLASH protection on TC2xx |
||
TC2xx_DisableBMHDProtection.cpp |
Disables BMHD protection on TC2xx |
||
TC3xx |
TC3xx_DisablePFLASHProtection.cpp |
Disables PFLASH protection on TC3xx |
|
TC3xx_DisableDFLASHProtection.cpp |
Disables DFLASH protection on TC3xx |
||
TC3xx_DisableBMHDProtection.cpp |
Disables BMHD protection on TC3xx |
||
TC2xx and TC3xx |
TCxxx_ResumeFLASHProtection.cpp |
Post operation |
Resumes PFLASH / DFLASH / BMHD protection on TC2xx / TC3xx |
Open Hardware | Flash Device | Configure. |
Select Pre operation | Default | Custom. |
Press the arrow button | From SFR folder | script to disable PFLASH / DFLASH / BMHD protection. |
(optional) Select arrow button | Parameters. |
•Enter 8 password values (long format). If the Flash section is protected by a password, the password is entered as a script parameter. A 256-bit password is written in eight 32-bit WORDS: PW0 – PW7.
•UC parameter configuration – Initialization scripts have default UC parameters values to cover most common protection scenarios. Enter an additional parameter, e.g. UC=0x17. See the microcontroller reference manual for more information about the UC parameter values.
(optional) Enter parameters (password) in the Edit options. |
Flash protection is restored automatically after every CPU reset which is also executed at the end of the debug download. However, when “live” modifying flash e.g. through the Memory debug window or when applying software breakpoints in Program Flash during debugging, Flash protection has to be restored by winIDEA.
To restore protection after a flash programming operation, select TCxxx_ResumeFLASHProtection.cpp initialization script in the Post operation section within the same dialog.