MCXA153 ROM Flash Lock and Unlock

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCXA153 ROM Flash Lock and Unlock

2,316 Views
Wenziwen
Contributor I

In the STM32 HAL library, there are HAL_FLASH_Unlock and HAL_FLASH_Lock functions to restrict the flash write operation. Does MCXA153 have such a function? Will there be any problem if the unlocked Flash is unlocked again?

在STM32的HAL库中有HAL_FLASH_Unlock和HAL_FLASH_Lock的函数用于限制flash的写操作,请问MCXA153是否有这样的的功能?对已经解锁的Flash再次执行解锁操作会不会有问题?

0 Kudos
Reply
5 Replies

2,282 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Wenziwen 

在MCXA153中,通过life cycle 功能控制 Flash 的权限。 

“MCXA1 supports a life cycle state model to protect code from reading from  device internal flash, which is called code read protection feature. ”

具体请参看MCXA153 手册,20.3 Life Cycle。

 

BR

Alice

0 Kudos
Reply

2,239 Views
Wenziwen
Contributor I

Hi Alice,

非常感谢你的回答,但你回答的是如何禁止Flash被外部读取(比如一些盗版人员想要窃取芯片内的代码),而不是我想要的功能。

我想要的功能是,执行某个函数之后,芯片的Flash(地址0x00000000~0x00040000)区域不允许被修改(写入)。可能比较类似于GLIKEY这一章节,但我第一次接触GLIKEY这个概念,不知是否能满足我的需求。

请指教,谢谢

Thank you very much for your answer, but your answer is about how to prevent Flash from being read externally (for example, some pirates want to steal the code in the chip), not the function I want.

The function I want is that after executing a certain function, the chip's Flash (address 0x00000000~0x00040000) area is not allowed to be modified (written). It may be similar to the GLIKEY chapter, but this is my first time to come into contact with the concept of GLIKEY, and I don't know if it can meet my needs.

Please advise, thank you

0 Kudos
Reply

2,234 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Wenziwen 

Please review the Memory Block Checker (MBC) section. The MBC controls the read, write, and execute permissions for each flash block, and its configuration can be locked to prevent further changes. For code implementation, please refer to the SystemInit() function in the flashiap demo, which includes relevant code to configure the MBC.

 

BR

Alice

0 Kudos
Reply

2,154 Views
Wenziwen
Contributor I

Hi Alice,

    非常感谢你的回复,我查看了用户手册Chapter 45:Memory Block Checker(MBC),应该是可以实现我想要的功能的,但是我在MCXA153的flashiap的demo中没有找到SystemInit()函数,请问你是在哪个demo中看到MBC相关操作的?

    还有一个问题,程序有办法识别芯片型号吗?我想通过返回值区分MCXA133和MCXA132,有相关的寄存器吗?

Thank you very much for your reply. I checked the user manual Chapter 45: Memory Block Checker (MBC), which should be able to achieve the function I want, but I did not find the SystemInit() function in the flashiap demo of MCXA153. In which demo did you see the MBC related operations?

Another question, is there a way for the program to identify the chip type? I want to distinguish MCXA133 and MCXA132 by the return value. Are there any related registers?

0 Kudos
Reply

2,143 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @Wenziwen 

You can find it as below:

Alice_Yang_0-1736926114559.png

 

For the second question, you can read the register DEVICE_TYPE.

Alice_Yang_1-1736926128120.png

 

BR

Alice

 

0 Kudos
Reply