blhost fails to erase flash region

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

blhost fails to erase flash region

Jump to solution
2,022 Views
Mike_B
Contributor III

Our Hardware

We have developed a custom PCB based around the MIMXRT1021CAG4A. There are some layout differences, but our board is similar to the RT1020 dev board (MIMXRT1020-EVK) except we use the W25Q64JVS not the IS25LP064A. We use the following hardware:

  • MCU: MIMXRT1021CAG4A (144 pin LQFP)
  • SDRAM: IS42S16160J-6TL (16 Mbit, 166 MHz)
  • NOR Flash: W25Q64JVS (64 Mbit, 133 MHz)

Issue

When attempting to use blhost to erase our flash chip we get the following failure:

compare difference.PNG

Failing board is on the left. Working board is on the right. 

More Background

  • We have tested 9 boards and so far 7 boards have this issue
  • We have tried swapping in a new flash chip but get the same result
  • Traces are routed the same on working boards vs non-working boards

My question

Why might the command flash-erase-region fail on some boards but not others?

Labels (1)
0 Kudos
Reply
1 Solution
1,839 Views
Mike_B
Contributor III

This turned out to be an issue with how the Secure Provisioning Tool was configured. I had selected "FlexSPI NOR/user FCB file" in the "from" pull down menu, which worked for some boards but not others (don't know why). However, when I use "FlexSPI NOR/W25Q32JV" I am able to erase and write to all boards without issue. 

Mike_B_0-1684339024898.png

We are actually using the W25Q64JVS and not the W25Q32JVS, so I am not yet sure if this will be an issue. But we are at least getting off the ground. Thank you very much for the help. 

View solution in original post

0 Kudos
Reply
6 Replies
1,840 Views
Mike_B
Contributor III

This turned out to be an issue with how the Secure Provisioning Tool was configured. I had selected "FlexSPI NOR/user FCB file" in the "from" pull down menu, which worked for some boards but not others (don't know why). However, when I use "FlexSPI NOR/W25Q32JV" I am able to erase and write to all boards without issue. 

Mike_B_0-1684339024898.png

We are actually using the W25Q64JVS and not the W25Q32JVS, so I am not yet sure if this will be an issue. But we are at least getting off the ground. Thank you very much for the help. 

0 Kudos
Reply
1,934 Views
Mike_B
Contributor III

To try to convince myself that this problem is not due to a bad chip or a routing issue, I removed the flash chip from the board and dead-bugged a new one to the MCU. Still getting command failure 20106 as described above. As a sanity check I removed the flash chip completely and again tried to program the flash chip. This time I got command failure 1004.

### Erase memory before writing image ###
blhost -t 50210 -u 0x15A2,0x0073 -j -- flash-erase-region 0x60000000 21040 9
WARNING:spsdk.mboot.mcuboot:Note: memoryId is not required when accessing mapped external memory
ERROR:spsdk.mboot.interfaces.usb:Cannot read from HID device, error=0
{
"command": "flash-erase-region",
"response": [],
"status": {
"description": "10004 (0x2714) No response packet from target device.",
"value": 10004
}
}

To me this implies that our flash chip is at least able to send a response packet to the MCU, meaning that the flash chip and MCU are able to communicate. But for some reason the Secure Provisioning Tool can’t or won’t erase the flash chip.

0 Kudos
Reply
1,917 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Mike_B ,

   Thanks for your patience!

SDK_2_13_0_EVK-MIMXRT1020\boards\evkmimxrt1020\driver_examples\flexspi\nor\polling_transfer

The above code totally can run in the internal RAM, not the external flash. 

Please debug the above code to check the details in RAM.

kerryzhou_0-1683187857873.png

Check the Link application to RAM, then code will run in internal RAM, this will help you to debug the flexSPI external flash.

Best Regards,

kerry

 

0 Kudos
Reply
2,000 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Mike_B 

  Please check the flexSPI DQS pin, GPIO_SD_B1_05, do you use it as other function or not?

   This pin should leave it as float, otherwise, it will influence the flexSPI communication.

   Do you also enable the QE bit?

  You can test this code in your RAM at first:

 SDK_2_13_0_EVK-MIMXRT1020\boards\evkmimxrt1020\driver_examples\flexspi\nor\polling_transfer

 Please note, to check the QE bit position, you can check your QSPI flash datasheet find the correct QE position.

 

Wish it helps you!

Best Regards,

Kerry

 

0 Kudos
Reply
1,982 Views
Mike_B
Contributor III

Hi Kerry,

Thank you for the reply. Pin 26 (GPIO_SD_B1_05) is floating.

Also, we cannot execute out of the external flash. For example, I can run evkmimxrt1020_iled_blinky (that is, the LED turns off and on) when my memory configuration is as follows:

Mike_B_0-1682707669844.png

But when I try to execute evkmimxrt1020_iled_blinky with the following memory configuration:

Mike_B_1-1682707687902.png

My stack usage is hosed before the fist line of code executes:

Mike_B_2-1682707701076.png

And I get this hard fault when I try run the program:

Mike_B_3-1682707713190.png

So running code that requires use of the board flash (such as SDK_2_13_0_EVK-MIMXRT1020\boards\evkmimxrt1020\driver_examples\flexspi\nor\polling_transfer) may not be an option for me at this point.

0 Kudos
Reply
1,959 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Mike_B ,

we are in the May Day Vocation now, if you have any updated information, I will reply you after back to work from 5.4, thanks a lot for your understanding.

Best Regards,

Kerry

0 Kudos
Reply