LPC55S69 trustzone example flash init hardfault

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LPC55S69 trustzone example flash init hardfault

跳至解决方案
1,591 次查看
idtmdwo
Contributor I

Hello.
I am going to do flash write/read by referring to the flashiap example code in the trustzone example code.
But VERSION1_FLASH_API_TREE->flash_init(config);
In this part, it falls into a hard fault.
May I know what could be the cause?

1.png2.png3.png

0 项奖励
回复
1 解答
1,584 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi idtmdwo

VERSION_FLASH_API_TREE is at boot rom address 0x1301fe00.

According to UM, the user's TrstZone configuration data must allow ROM code execution for successful transition from secure to normal mode and jump to user application. Thus some settings are necessary.

ZhangJennie_0-1625215200138.png

So to fix the error,

1. in Security access configuration window, set related security level as below:

ZhangJennie_1-1625215450720.png

2. When operate Flash and other related peripherals in secure world, make sure the related peripherals are S-Priv. In your application, SYSCTRL and FLASH are used, we need to set both of them as S-Priv.

ZhangJennie_4-1625215667880.png

 

ZhangJennie_2-1625215643914.png

 

ZhangJennie_3-1625215651997.png

After above setting, update code. Your Flash code should be able to work.

 

Best Regards

Jun Zhang

 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,585 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi idtmdwo

VERSION_FLASH_API_TREE is at boot rom address 0x1301fe00.

According to UM, the user's TrstZone configuration data must allow ROM code execution for successful transition from secure to normal mode and jump to user application. Thus some settings are necessary.

ZhangJennie_0-1625215200138.png

So to fix the error,

1. in Security access configuration window, set related security level as below:

ZhangJennie_1-1625215450720.png

2. When operate Flash and other related peripherals in secure world, make sure the related peripherals are S-Priv. In your application, SYSCTRL and FLASH are used, we need to set both of them as S-Priv.

ZhangJennie_4-1625215667880.png

 

ZhangJennie_2-1625215643914.png

 

ZhangJennie_3-1625215651997.png

After above setting, update code. Your Flash code should be able to work.

 

Best Regards

Jun Zhang

 

0 项奖励
回复
1,577 次查看
idtmdwo
Contributor I

The problem has been resolved.
Thank you so much for your detailed, easy-to-follow answer.

0 项奖励
回复
1,575 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Good to know.

You are welcome!

Best Regards

Jun Zhang

0 项奖励
回复