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:
Is seems related to some malloc/free function into newlibNano library. I've checked the heap/stack allocation and it seems ok.
These are my configurations into the project settings:
And this is the configuration from the Secure Provisioning tool
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!
Solved! Go to Solution.
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
Hi @Joey_z
I am interested in the external flash on MCXN947. I read this guide https://community.nxp.com/t5/MCX-Microcontrollers-Knowledge/Running-code-from-external-memory-with-M... and I have some questions:
1. Is the guide in the above link is valid at current time? I ask this question because:
- I see that in the cmpa_template.yaml there are not DEFAULT_BOOT_SOURCE and FLEXSPI_AUTO_PROBE as NXP mentioned
- I saw you attached video and it is not same as the guide. The guide said that we need to created QSPI_FLASH and QSPI_FCB, but in your video I did not see this steps.
- At the step Write image and PFR and run demo, if I want to get output from board, what do I need to do. Assume that I have project tflm_cifar10. It need this feature because I want to know predictions of model. In the past, I used MIMXRTxxxx board and I could run with debug mode and got output via COM port by using picocom or Teraterm
- At the step Double-check execution from external flash. Maybe it is related to my above question.
- The guide said that If you want to return the device to run from internal memory, then you need to go back to default values. If there are no modifications, to the ones shown in this document, to the CMPA and CMPA areas, the nxpdebugmbox command can be executed. I am not clear about this point. Sorry, I am a newbie with board. As my understanding, NXP was saying about back to internal boot by using SPDSK. Whether I can back to internal flash by creating NEW PROJECT from SDK in MCUXpresso IDE (without any MCU settings) and run debug as usual?
Sorry, currently I don't have the board in hand, but it is some doubts about external flash. Thank you.
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.
Wish it helps you.
If you still have question about it,please kindly let me know.
BR
Xu Zhang
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