LPC55S69 trustzone example flash init hardfault

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

LPC55S69 trustzone example flash init hardfault

Jump to solution
1,583 Views
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 Kudos
Reply
1 Solution
1,576 Views
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

 

View solution in original post

0 Kudos
Reply
3 Replies
1,577 Views
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 Kudos
Reply
1,569 Views
idtmdwo
Contributor I

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

0 Kudos
Reply
1,567 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Good to know.

You are welcome!

Best Regards

Jun Zhang

0 Kudos
Reply