RT1050 EVK writing QSPI FLASH image over USB-HID

cancel
Showing results for 
Search instead for 
Did you mean: 

RT1050 EVK writing QSPI FLASH image over USB-HID

771 Views
mrecoskie
Contributor II

Using RT1050 evaluation board.  Modified the board hardware to boot from QSPI NOR.

I’ve loaded my simple image using the OpenSDA port.  This works.

Now trying to load image over USB-HID - OTG port.  The goal is to create a script using blhost/sdphost over USB to burn images for our final design.

Only image change is removing header by setting XIP_BOOT_HEADER_ENABLE=0 and rebuilding.  (I also tried disabling the DCD on one attempt.)  

Create a S-Record image using Binary Utilities.  In Serial downloader mode, using the MCU Secure Provisioning Tool in Windows I get the error “Unknown error code. (0x7002)” during writing.  Does anyone know what might be causing this?  Thanks.

Picture below.

write-error.jpg

0 Kudos
12 Replies

764 Views
jay_heng
NXP Employee
NXP Employee

7002 error code means kStatus_FLEXSPI_DeviceTimeout, FlexSPI busy bit is not clear in timeout during configuration. You can try MCUBootUtility tool

740 Views
mrecoskie
Contributor II

Thank you.  This pointed me in a good direction.  

The Write operation is now succeeding.  But my application is not working as expected from Internal Boot afterwards.  I have tried the iled_blinky application as well.  The light is on but never flashes.

To use the MCUXpresso Secure Provisioning Tool I am setting these variables to remove the IVT/etc header in my source.

   XIP_EXTERNAL_FLASH=1

   XIP_BOOT_HEADER_ENABLE=0

   XIP_BOOT_HEADER_DCD_ENABLE=0

Something I don’t understand while following the instruction ( Instruction ref ) … we are told to add the following definition - 

   const flexspi_nor_config_t qspiflash_config = { 

     

   };

But this is surrounded by the define below and never gets included.

   #if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)

I must be missing something?

 

If I start using the MCUBootUtility tool do I include the IVT/BootData/DCD header?  Is this the only needed change?  Thanks.

Mark 

 

To add - If I take the same code and switch XIP_EXTERNAL_FLASH, XIP_BOOT_HEADER_ENABLE and XIP_BOOT_HEADER_DCD_ENABLE all to 1 and then update using the OpenSDA drag and drop the image works.

 

0 Kudos

709 Views
mrecoskie
Contributor II

I tried the MCUBootUtility and followed the instruction.  (no Header included in the image.). 

The application seems to stall when generating the bootable image for my image.  Other projects like the led_blinky_0x60003000.srec don't stall and says the write was successful however it doesn't run on the board.  No blinking.

Attached is my MCUXpresso IDE project.  The app is very simple - it initializes and sets custom USB PID/VID.

 

0 Kudos

700 Views
mrecoskie
Contributor II

Continuing to work with the MCUBootUtility.  If I use the SREC file as input I avoid the stall when creating the image.  

But once the application is loaded it performs the same as the Secure Provisioning tool.  It does not run.

Is it possible to get a MCUXpresso project which runs XIP from the FlexSPI on the RT1050-EVK board?  It would be of great help.

Why the OpenSDA Drag and Drop works but the MCUXpresso Secure Provisioning tool and MCUBootUtility don't work?

 

0 Kudos

688 Views
marek-trmac
NXP Employee
NXP Employee

Hi,

> Is it possible to get a MCUXpresso project which runs XIP from the FlexSPI on the RT1050-EVK board?  It would be of great help.

In SEC tool, toy can find "blinky LED" application for EVK board in "c:\nxp\MCUX_Provi_v4.0.1\bin\data\targets\<MCU>\source_images\*.*"

Regards,
Marek
0 Kudos

673 Views
mrecoskie
Contributor II

Hi,

Can the MCUXpresso IDE project for this image be found anywhere - specifically for the ext_FLASH?

Thanks.

Mark

 

0 Kudos

695 Views
mrecoskie
Contributor II

Following up - the flash configuration parameters and IVT tag is present. But the boot start address looks incorrect?  Where does this value come from?

 

0 Kudos

668 Views
marek-trmac
NXP Employee
NXP Employee

Mark,

this is SDK example (https://mcuxpresso.nxp.com). The step-by-step procedure is described in User Manual, chapter 7.2 RT10xx/RT11xx device workflow

For RT10xx, it does not matter, whether the input image is bootable or not. SEC tool can parse bootable image and extract the source image, FCB, DCD and/or other parts, that are included. So even with default settings, the output should be directly usable in SEC tool.

Regards,
Marek
0 Kudos

665 Views
mrecoskie
Contributor II

Thank you for the quick response!  The image found in the SEC tool works for me here - 

"c:\nxp\MCUX_Provi_v4.0.1\bin\data\targets\<MCU>\source_images\*.*"

 

I just need to find a method for creating writable images.

The default MCUXpresso IDE demo iled_blinky project (No changes) doesn’t work for me. 

I have also tried other things - 

a) I changed the memory type to IS25WP064 for the Flash memory type to match the EVK rev. A board. Is this needed?

Screen Shot 2022-06-24 at 10.10.17 AM.png

b) removing the header (XIP_BOOT_HEADER_ENABLE=0) just in case.

c) using the srec image as opposed to the axf image.

All these have not worked for me.  It is very strange.  Is any other changes needed in the case of a rev A evaluation board?

Thanks,

Mark

 

0 Kudos

660 Views
marek-trmac
NXP Employee
NXP Employee

Hi Mark,

I'd say your problem is not in the image itself. Have you tried the image in the debugger? Does it run in debugger?

Have you tried to read memory after image is written?

 

Regards,
Marek
0 Kudos

651 Views
mrecoskie
Contributor II

Hi Marek,

I switched to a revision B evaluation board and everything works as expected.  Thanks for the help.

Mark

 

768 Views
marek-trmac
NXP Employee
NXP Employee

Hi Mark,

I do not know what the error code means, but it is definitely NOT related to the bootable image, it is related to the configuration of the memory. The memory configuration failed. I'd recommend to double check the memory configuration parameters.

The error should not be related to USB HID, you should see the same error is you try same configuration via UART.

 

Regards,
Marek
0 Kudos