F29P329SM-Q1: Why the SECCFG programming fail?

Part Number: F29P329SM-Q1
Other Parts Discussed in Thread: SYSCONFIG

Hi team,

I ask this for my customer

My customer device work in bankmode1, ssumode2

image.png

image.png

before program the code, the SECCFG has the default code, no data in MAIN FLASH, and flash protection isn't enabled.

image.pngimage.png

they uncheck the FOTA in flash plugin

image.png

but the code download fail, the main flash is programmed, but the SECCFG region isn't change 

image.png

but after they enable the FOTA, code can be downloaded successfully

image.png

And after download the code and reset, we find some WEPROT register value change to 1( the protection enabled), but the seccfg.c value is 0(seemsthe values are exactly the opposite), why the value are the opposite? why the sysconfig set the FOTA region protection enable? this make the next code download fail. While in customer's application, customer can't download the code to update region because of the program/erase protection if they don't disable the update region memory protection firstly

image.png

image.png

BRs

Shuqing

  • Hi Shuqing, 

    Apologies for the delay in response. I got notified of the issue now and was out last week. 

    In seccfg.c, in the WEPROT configuration, some of the bits are 1 and some of the bits are 0. 

    The bit being 1 means the region in unlocked. The bit being 0 means the region is locked. The logic is inverted because when ROM reads the seccfg regions, it considers 1 as unlocked and 0 as locked. But while programming the registers, ROM does this the normal way.

    The modifications in WEPROT in seccfg can be seen by playing around APRs. If you create an APR with customize region option and choose a flash address such as 0x1020_0000 for instance, we can see that a new bit gets unlocked in the APR. 

    So the value you see in the seccfg.c file and value seen in the registers will be in inverse relation ship. For example in seccfg.c FLC_1_B0_A is 0x01FFF_FFFF, in the register it will be 0xFE00_0000.


    Thanks & Regards,

    Aswin

  • Hi Aswin,

    thanks for your explanation. I understand why the bit is inverted now

    Could you help to check the below question?

    but the code download fail, the main flash is programmed, but the SECCFG region isn't change 

    BRs

    Shuqing

  • Hi Shuqing, 
    Is the issue reproducible again on customer side. If so

    1. Can we check if the bank mode has indeed gotten programmed as bank mode 1 via the Bank mode registers.

    2. Secfg region is protected by the WEPROT NM registers. Can we check the value of these registers. This will be the CMDWEPROTNM register.

    The register has the ability to lock the non main region in flash where seccfg data is written.

    Thanks & Regards,
    Aswin