FRDM-MCXN947

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

FRDM-MCXN947

跳至解决方案
543 次查看
Deidan91
Contributor I

Hi everyone,

I'm facing a problem with my FRDM-MCXN947. What I'm trying to do is to boot an example program from the W25Q64JW external flash memory.

In order to do this, I've done the steps explained in the following user guide: Running code from external memory with MCX N94x - NXP Community

Also, I've managed to do the job also using MCUXpresso Secure Provisioning Tool 8.

With the led_blinky example, everything went well and the code is running correctly from the external flash.

So I've tried to execute a more complex example that involves ML/AI and TensorFlow Lite library. The example from the SDK is frdmmcxn947_mpp_camera_persondetect_view_tflm.My goal is to modify this example with a more complex model and so I need the external flash, because the 2 MB internal memory is not sufficient to contain my custom model.

Using the example code with its defaul model, the code starts correctly but when reaching a particular instruction, then an hardfault is triggered.

Looking at the disassembly code, the hardfault happens here:

Deidan91_6-1721729636986.png

 

Deidan91_0-1721729141216.png

 

Is seems related to some malloc/free function into newlibNano library. I've checked the heap/stack allocation and it seems ok.

Deidan91_7-1721729720254.png

 

 

These are my configurations into the project settings:

Deidan91_1-1721729250921.png

 

Deidan91_2-1721729281190.png

Deidan91_3-1721729335558.png

Deidan91_4-1721729386163.png

 

And this is the configuration from the Secure Provisioning tool

Deidan91_5-1721729414896.png

 

I've tried to change heap/stack size, changing memory placement, changing the newlib with redlib, but nothing worked and I'm struggling with this problem.

I hope someone can help me with this particular task.

Thank you!

 

标记 (2)
0 项奖励
回复
1 解答
445 次查看
XuZhang
NXP Employee
NXP Employee

hi,Deidan91

I'm glad I could help you. If your question is solved, please help me to fill the feedback as resolved, thanks.

 Any new issues,welcome to create the new case.

BR

Xu Zhang

在原帖中查看解决方案

3 回复数
490 次查看
XuZhang
NXP Employee
NXP Employee

hi,Deidan91

Thank you for your interest in NXP Semiconductor products and the opportunity to serve you, I will gladly help you with this.

I tried to use blhost to load the frdmmcxn947_mpp_camera_persondetect_view_tflm program into the external flash and succeeded. I recorded a video of the operation process and put it in the attachment. There are some precautions during the operation.

  1. I put the cmpa_bin.bin file in the attachment. By writing this file, you can configure the program to start from the external flash.
  2. The area of ​​the external flash erased by the flash-erase-region command must be larger than the size of the executable program.
  3. I have put all the blhost commands used in the attachment.
  4. If you re-enable the on-chip loader, you need to use the blhost command to re-load the cmpa_re_bin.bin file instead of the cmpa_bin.bin file.

Wish it helps you.

If you still have question about it,please kindly let me know.

BR

Xu Zhang

477 次查看
Deidan91
Contributor I
Hi, thank you for your help! With the video and the config files the firmware worked correctly.
I've understood what I was missing and the wrong things in my options. :).
I really appreciated your help and the amonut of the infos you gave me, thanks!
Best regards.
0 项奖励
回复
446 次查看
XuZhang
NXP Employee
NXP Employee

hi,Deidan91

I'm glad I could help you. If your question is solved, please help me to fill the feedback as resolved, thanks.

 Any new issues,welcome to create the new case.

BR

Xu Zhang