infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

Dave

+ Reply to Thread
Results 1 to 5 of 5

Thread: XMC4500 Flash protection in practice?!

  1. #1
    New Member New Member XmCfAn2014 is on a distinguished road
    Join Date
    Jun 2014
    Posts
    54
    Points
    142.65625

    XMC4500 Flash protection in practice?!

    Good day,

    I have read "XMC4500 Reference Manual"
    chapter 8.4.8 Flash Protection, but it is still unclear for me how it should be realized?

    Say, I choose to set up "Flash Read Protection", using option:
    – UCB0: Read protection that can be disabled with the password of UCB0 for whole Flash.

    For that, I shall set bit PROCON0[15] = RPRO = 1 in UCB0

    Meanwhile, description for it says:

    This bit indicates whether read protection is
    configured for PFLASH by user 0.

    0B No read protection configured
    1B Read protection and globalwrite protection is
    configured by user 0 (master user)


    So, looks like it is Global R/W Protection bit.

    Bits PROCON0[0:10] - write protection per sectors - can be used independently.

    A “UCB” is a specific logical sector contained in the configuration sector.
    Apparently, UCB blocks are not affected, when whole Flash is erased by Programmator.
    As far UCB blocks may be rewritten reliably only 4 times!

    It means theoretically, that if only "Read Protection" was installed, you are able to rewrite Flash, but as far protection still in place,
    you do not able to verify it without erasing UCB0 block as well, applying special procedure.

    Global R/W Protection as well may be disabled temporary, o.w. until next System Reset. It is used in MemTool. (See below)
    But, it requires ASC Bootstrap connection - through P1.4 RxD, P1.5 TxD lines.

    BR
    K
    Last edited by XmCfAn2014; May 22nd, 2017 at 02:18 AM.

  2. #2
    New Member New Member XmCfAn2014 is on a distinguished road
    Join Date
    Jun 2014
    Posts
    54
    Points
    142.65625
    I have found post in thread:

    https://www.infineonforums.com/threa...ght=Bootloader

    When you program a UCB with password and R/W sector protect, the UCB is considered operational. At this stage you can always temporary

    unprotect the flash for software update with the correct password. And the MCU will return to protect state after a reset.

    Sounds great, but still unclear how to achieve this?

    Unfortunately Travis has not visited this forum more than 6 monts
    Last edited by XmCfAn2014; May 19th, 2017 at 05:09 AM.

  3. #3
    New Member New Member XmCfAn2014 is on a distinguished road
    Join Date
    Jun 2014
    Posts
    54
    Points
    142.65625
    Get MemTool 4.07.03 and connect to it using ASC Bootstrap (P1.4 RxD, P1.5 TxD) at speed 57600.

    Click image for larger version

Name:	Memtool.png
Views:	1
Size:	31.5 KB
ID:	2961

    Meanwhile, to activate HW Protect button, in upper left field shall be vailid address space
    and PFLASH must be enabled. Other way to make it active - load some .HEX file.

    Click image for larger version

Name:	Flash.png
Views:	0
Size:	31.2 KB
ID:	2966

    Then protection may be activated. Please configure Setup first.
    "Try to disable protection.." - is most important option, as far it removes
    protection temporary, not erasing UCB0 block!

    Click image for larger version

Name:	Pass_and.png
Views:	0
Size:	16.2 KB
ID:	2970

    Press OK on warning message and get Flash protected:

    Click image for larger version

Name:	Protect_Done.png
Views:	0
Size:	34.4 KB
ID:	2967

    After reconnect, as far protection temporary removed, it looks as below:

    Click image for larger version

Name:	Protect_Removed.png
Views:	0
Size:	34.3 KB
ID:	2968

    I was able to Erase and Program Flash successfully in this mode, but Verify option failed on some reason.
    Last edited by XmCfAn2014; May 22nd, 2017 at 02:03 AM.

  4. #4
    New Member New Member XmCfAn2014 is on a distinguished road
    Join Date
    Jun 2014
    Posts
    54
    Points
    142.65625
    XMCLoader.exe is able to do similar job.
    It is located in "TOO_Bootloader_ASC_examples_v1_1"
    XMC4000_ASCBootloader -> XMCLoad -> Release -> XMCLoad.exe
    It loads ASCLoader.hex into PSRAM ( 0x1000 0000 ) and starts it.

    Mentioned example contains source codes for ASCLoader.hex (Dave 3, Keil, IAR),
    and for XMCLoad.exe as well.

    I was able to connect on 57600bps speed, next 4096 must be choosen

    Click image for larger version

Name:	XMCLoader.png
Views:	0
Size:	17.9 KB
ID:	2962
    Last edited by XmCfAn2014; May 22nd, 2017 at 02:09 AM.

  5. #5
    New Member New Member XmCfAn2014 is on a distinguished road
    Join Date
    Jun 2014
    Posts
    54
    Points
    142.65625
    So, let's protect Flash, using XMCLoader:

    Click image for larger version

Name:	XMCLoader_Prot.png
Views:	0
Size:	19.8 KB
ID:	2963

    And unprotect then:

    Click image for larger version

Name:	XMCLoad_unprotect_2.png
Views:	1
Size:	20.6 KB
ID:	2964

    Looks like it is can be done relaibly 4 times only, as far seems that XMCLoader erases UCB0 every time

    In case Flash Protection detected, NO option cause program termination.

    Click image for larger version

Name:	Unprotect_No.png
Views:	0
Size:	20.4 KB
ID:	2969
    Last edited by XmCfAn2014; May 22nd, 2017 at 02:05 AM.

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.