Hello,
We've got a custom board with the RT1165 on it, as well as an SDRAM (IS42SM16320E-75BLI) and a QSPI Flash (IS25LP512M-RHLE).
The flash is connected to the FlexSPI2A pins.
We've burned no fuses, BOOT_MODE is set to 0x10. BOOT_CFG is 0b100000000001 . Both of these have jumpers / alternate pulls so I can change them if needed.
I have a J-Link Ultra+ connected to the MCU.
I've imported the Hello World example in MCUexpresso, and run it on the eval board (EVKMIMXRT1160) successfully. But I'm having trouble porting the example to our custom board.
I've changed the MCU settings to point BOARD_FLASH to flex spi 2A:
In evkmimxrt1160_flexspi_nor_config.c, I've changed the memConfig to the following:
I've changed BOARD_FLASH_SIZE to 0x20000000U, and FLASH_BASE to FlexSPI2_AMBA_BASE.
When I debug, it seems to reach the ResetISR before hanging. When I pause debugging, it breaks at 0x223104. "Break at address "0x223104" with no debug information available, or outside of program code."
Not sure what I'm missing here, any tips very appreciated. Let me know if I can provide any more information too.
Thanks,
Tristan
I hope you are doing great, thanks for your description.
Could you let me know which specific FlexSPI2A pins are you using?
To narrow down the issue, I propose two alternatives to first check communication of the MCU and the memory:
1 Run code that executes from SRAM and then proceeds to read/write external flash on FlexSPI2.
The demo should be able to discover the flash SFDP parameters, and possible execute read and write commands.
2 Test flash memory settings (use ROM bootloader and a image generation tool)
Use the MCUboot Utitliy or the MCUXpresso Secure Provisioning Tool (SPT) With the SPT. Below some steps with the SPT
1 Set MCU into serial downloader mode.
2 Open the SPT and do the below config.
3 Edit memory settings and run the TEST option. This will invoke bootloader APIS and try to write that configuration on your flash memory.
Please let me know your results,
All the best,
Diego
Hi Diego, thanks for your help.
I tried the Secure Provisioning Tool and was able to successfully test the flash:
However, I can't get flexspi_nor_polling_transfer to work. I see "Vendor ID: 0xff" in the debug console, and then it hangs at FLEXSPI_TransferBlocking:
These are the FlexSPI2A pins I'm using:
And I changed the app.h to match:
Any idea what I'm missing with the example project?
Thanks,
Tristan
I am glad that you where able to successfully test the flash configuration with the SPT. Now, lets review if we can boot an application :
1 Take a plain image from the MCUboot Utility package <>/NXP-MCUBootUtility-master\apps\NXP_MIMXRT1060-EVK_Rev.A1 for example : led_blinky_0x60002000
2 Build and program that image with the SPT.
3 Select internal boot.
Let me know your results, or if you have any issues.
Regarding the flexspi_nor_polling_transfer project setup :
I can't tell if the FlexSPI2 A pins are setup correctly within the config tools. Are you linking all the project to SRAM? In which function does the program actually halts?
I have to say that I am more interested on checking if you can boot an application, with the steps from the above point.
All the best,
Diego.
Hi Diego, thanks for the quick response -
I was able to build and write the image successfully with the SPT. I'm not sure how to verify that the image is running correctly - I don't have the same pin mux / LED / UART as the evk.
Regarding the flexspi_nor_polling example, here are my pin assignments:
I am linking the application to RAM. The program blocks when I step over "flexspi_nor_enable_quad_mode()." If I pause debugging, I can see that the I'm inside "FLEXSPI_ReadBlocking" waiting for a buffer to fill.
Thanks again,
Tristan
Hi Tristan,
I am very sorry for the delayed response! Did you manage to get any further results on this?
Regarding : I'm not sure how to verify that the image is running correctly.
the fastest thing for me is by halting the CPU. Then check where is the program counter. If the app booted correctly it should be on 0x60xx_xxxx space. You should see that every instruction the PC changes, and it is not repeatedly on any bad place like where the hardfault handler is typically located.
I think that the MCU boot utility application should toggle a RT1160 EVK user LED1 or user LED2. With the schematics of the EVK, you should see check which GPIO pins are connected to the user LEDs
Diego
Hi Diego,
I was able to program the blinky image using SPT and then halt the MCU and see that I'm in the 0x6xx xxxx space. I can also see the LED1 pin toggling (no LED on our board).
I still can't get any of the demo projects to load onto the flash and execute from flash using MCUXpresso, but it seems like it's a project config issue and not a hardware issue at this point?
Thanks for your help,
Tristan
Thanks for your reply and patience!
It is good to know that HW is able to work properly, as you mention this may be now related to SW.
I suggest the next steps :
For inspecting and locating addresses in binary images I like to use https://hexed.it , but you can use any other tool of your preference. Also refer to the FCB addresses on the reference manual.
Please let me know your results! If problems keep arising, please share me debugger console output.
Diego