Hard fault on Hello world example on iMX RT 1052

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

Hard fault on Hello world example on iMX RT 1052

680 Views
KinC
Contributor I

Hardware: Custom iMXRT1050-EVKB board with RT1052
Flash Memory: Windbond W25Q512JV

Encountered: Debugging 'hello_world' example from SDK_2.14_EVKB-IMXRT1050 in serial downloader mode encountered hard fault below, which I am inexperienced about. No codes are altered in the example.

KinC_0-1723512199033.png

 

Labels (1)
0 Kudos
Reply
5 Replies

655 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @KinC 

I hope that you are doing well. I do not know many details of your implementation but let me give you some quick feedback on what could help you. 

The i.MX RT1050 EVKB SDK is setup to boot from a Hyper flash memory, so if you want to boot from another memory, like your QSPI NOR flash, you will need to implement some modifications to run the SDK examples. If this is your case, I think this application note will be handy:  How to Enable Boot from QSPI Flash. Also from IDE perspective, whenever we attempt to debug an i.MX RT project the IDE will pick a default flash driver, SDK examples for the RT1050 EVKB will use Hyper Flash driver, so you need to select QSPI nor flash driver. 

diego_charles_0-1723567130540.png

 

In summary getting a demo to execute from your custom flash memory requires to get correct flash settings ( Flash configuration block in the code, and flash driver)
If you are still on bring up phase and you are not sure that your flash memory implementation works, I think that it is convenient to try out the MCUXpresso Secure Provisioning tool  (or SPT for short )before. In case that you still have not used this tool before, it will help you to generate the flash configuration in the code and test and program the code to your flash memory, without doing a SWD debug session, you only need bootROM UART1 or LPUART1 ports and the ability to put the RT1050 into serial downloader mode. You can download the SPT from here , once you install and open the tool, go to the Help tile and open the tool's documentation to see how to get started. 

 

I hope this helps,

Diego

 

 

0 Kudos
Reply

615 Views
KinC
Contributor I

Hi  @diego_charles  ,

I tried modifying the flash config and the GUI Flash tool seems to be able to program my flash now. However, demo apps are still unable to run and resulting in hard fault. This time I looked at the disassembly and found 'vmaxnm.f32 <illegal reg>' always occur to cause the hard fault. Any idea what this means and how I can debug it? Here is a screenshot of the dubugger:

KinC_0-1723700328467.png

Also I realised that all the other disassembly instructions are mostly 'movs r0,r0'. Should I be concerned about this?

I am now testing with the iled_blinky demo and it can execute via SDRAM but not on flash.


Thank you once again for your help.

0 Kudos
Reply

584 Views
diego_charles
NXP TechSupport
NXP TechSupport

Hi @KinC 

My apologies for the delayed response. 

I am glad that you are now able to program your application and execute well application on RAM! I have not found this particular errors, with such 'vmaxnm.f32 <illegal reg>' before. But I think that you can check the configuration for the NOR flash config, let me detail further.

We have this application note AN12183 How to Enable Debugging for FLEXSPI NOR Flash  it goes over FlexSPI settings. A tipical detail to check here is the Quad SPI commands. Sometimes customer's flash memories do not have Quad mode bit  enabled, or QE bit.  If you are not sure, if your memory does have QE enabled. I think that you can use standard SPI flash commands. Refer to chapter 5.6 Modifying boot header for NOR flash XIP booting of the application note. 

This is a general reply, If you are still getting issues, or find out something else in the meantime please let me know. 

Diego

 

 

0 Kudos
Reply

644 Views
KinC
Contributor I
Hi @diego_charles,

Thank you for your reply.
My goal is to be able to flash into my custom QSPI NOR.

I tried both SPT and MCUBootUtility before but they required either USB-HID, or UART connection. Unfortunately my board only contains a single JTAG port with a PE MULTILINK UNIVERSAL FX, which is unrecogniable to both tools. To my understanding, the drive for PE probe is linked through Jungo instead of HID. This further brought up another issue when I tried to follow the QSPI setup document included in your comment, which DAPlink is used to update the board firmware, again through USBHID which is unavailable to me. I may have missed some instructions on how to work with PE Jungo connection. Do you have any idea on how to work with it, especially by using MCUXpresso? Do I need another debugging tool, both software and hardware wise?
Thank you once again for your help.

Regards,
Kin
0 Kudos
Reply

622 Views
KinC
Contributor I
Update:
Up until now I followed the document you've attached and switched the driver to SFDQ_QSPI.cfx, set flash address to 0x60000000, ran flexspi_nor_polling_transfer by linker to RAM, and edited flexspi_nor_config.c to match my flash config. The same hardfault occured. I wonder if I need to edit flexspi_nor_boot.c for the IVT, but it does seem fit in the example. The only thing I did not do was to update the OpenSDA firmware on board.
0 Kudos
Reply