FPROT runtime unlock

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
762件の閲覧回数
luca_toso
Contributor II

Hi all, 

Is it possible without using debugger access or erasing the flash to unlock the FPROT bits at runtime?

Use case: we have some flash area that needs to be protected by erase and/or programming during normal product cycle. 

It may be possible to require to update such areas during the lifetime of the product, i.e. sw update via bootloaders, parameters change or other.

If the FPROT is set in the NVM, how can we re-set the FPROT bits without erasing the FPROT flash sector?

 

K.R.

0 件の賞賛
1 解決策
745件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @luca_toso,

It is not possible to remove this FPROT protection.

And reprogramming the first sector is not recommended.

Ony the areas that do not get reprogrammed should be protected.

 

But access to the flash controller (FTFC) can be restricted in the Peripheral Bridge (AIPS-Lite) (OPACRA register)

danielmartynek_0-1646825908027.png

 

Regards,

Daniel

 

元の投稿で解決策を見る

3 返答(返信)
746件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @luca_toso,

It is not possible to remove this FPROT protection.

And reprogramming the first sector is not recommended.

Ony the areas that do not get reprogrammed should be protected.

 

But access to the flash controller (FTFC) can be restricted in the Peripheral Bridge (AIPS-Lite) (OPACRA register)

danielmartynek_0-1646825908027.png

 

Regards,

Daniel

 

741件の閲覧回数
luca_toso
Contributor II

Hello Daniel, 

one more related question.

Is it possible to set only one bit in flash?

I am picturing following scenario: FPROT are unlocked and at some point of the development I want to protect some sectors without re-flashing the uC (e.g switching from development to production and then protect sectors). 

In my understanding the minumum writable size in P/D-Flash with FCCOB0..BB is 64 bit (8 data byte), but the RM states that "In NVM Normal mode: The protection can only be increased, meaning that currently unprotected memory can be protected but currently protected memory cannot be unprotected. Since unprotected regions are marked with a 1 and protected regions use a 0, only writes changing 1s to 0s are accepted. This 1-to-0 transition check is performed on a bit-by-bit basis. Those FDPROT bits with 1-to-0 transitions are accepted while all bits with 0-to-1 transitions are ignored. "

How can we change only one bit in the NVM?

 

0 件の賞賛
737件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @luca_toso,

If one phrase is programmed (bits 1 -> 0), ECC checksum is generated for the data in that phrase (also bits 1 -> 0 in the inaccessible flash that holds the checksum).

To reprogram that phrase, the whole sector must be erased (all bits 0 -> 1 including the ECC checksum).

So that the new data can match the new ECC checksums.

But the FPROT registers (that are loaded from the NVM IFR during the reset sequence) can be ovewritten (to increase the protection only).

So, the application code can decide which sectors will be protected on top of the regions already protected in NVM.

 

Regards,

Daniel

 

 

 

 

0 件の賞賛