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.
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.
.
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
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:
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.
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