FRDM-MCXN947

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

FRDM-MCXN947

Jump to solution
383 Views
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!

 

Tags (2)
0 Kudos
Reply
1 Solution
285 Views
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

View solution in original post

3 Replies
330 Views
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

317 Views
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 Kudos
Reply
286 Views
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