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.

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

  • Hi Aswin,

    As we discussed in the Webex, I can understand that why we must checked the FOTA in flash plugin when the device in bankmode1:

    If we choose the bankmode1 in sysconfig, it will try to program the 0x10D99000, 0x10D99800, 0x10D9D0000, and 0x10D9D800 addresses, these address belongs to FRI3 address. If we uncheck the FOTA in flash plugin, flash driver will try to program the FRI1 only, so the program will fail.

    But as me mentioned in webex, sometimes customer will let device work in bankmode1, and in order to debug more easily, customer will uncheck the FOTA in CCS flash plugin.

    Is it possible to let our tools to support this debug scenario?

    BRs

    Shuqing

  • Hi Shuqing, 

    In bank mode 1, we cannot write to the active region, we can only write to update region. I think this implementation was chosen intentionally for security reasons. Imagine if you write to active region and the process is interrupted in between, this could potentially harm the device. 

    Can you help me understand the customer's requirement?

    I assume that are trying to flash an out file that has the main image and seccfg image. If they select fota, the image will be flashed to the fota region. If they do a reset post this, they will be able to debug right? 

  • Hi Aswin,

    For main flash, if we uncheck the FOTA in flash plugin, we can still program the data to active region. In this situation, after flashing the out file to main flash, customer doesn't need to restart and they can debug directly from main() function

    The customer is more used to this way of debug

    why the main flash support but non-main flash isn't support? is it for security reason that if non-main active region is incorrect the device maybe locked, but if main active region is incorrect the device will not be locked.

    BRs

    Shuqing

  • Hi Shuqing,

    Your understanding is correct. Non Mai unlike Main region is critical for device operation. So this restriction is there.

    Thanks & Regards,

    Aswin