blhost "-- receive-sb-file" timeout when erasing flash

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

blhost "-- receive-sb-file" timeout when erasing flash

2,024 Views
t_thurgood
Contributor III

I am using windows based blhost.exe to download to an iMXRT1021/ext flash target, which is working ok. But only if I choose to erase a minimal amount of flash. We have 4Mbyte qspi device.

In the program_flexspinor_image_qspinor.bd file, I have...

#2 Erase flash as needed.
erase 0x60000000..0x600e0000;          << this is ok
erase 0x60000000..0x600f0000;           << this fails

Ping responded in 1 attempt(s)
Inject command 'receive-sb-file'
Preparing to send 153056 (0x255e0) bytes to the target.
Successful generic response to command 'receive-sb-file'
Error: read_start_byte() timeout after 5.097 seconds
Data phase write aborted by status 0x5 kStatus_Timeout
Error: read_data_packet found unexpected packet type 0xa1
Response status = 10004 (0x2714) No response packet from target device.
Wrote 0 of 153056 bytes.
Done.

I assume that qspi flash operations take a little longer, but we are no where near erasing our maximum before we get the comms timeout.

Can this timeout be increased?

tia,

Tony

Labels (1)
Tags (1)
0 Kudos
Reply
9 Replies

1,784 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Tony Thurgood 

 Please check these points:

1. Your external QSPI flash is really 4Mbyte, it is not the fake chip.

2. Please tell me your QSPI flash part number

3. What's the board you are using? NXP official MIMXRT1021-EVK?

4. Please send me your .bd file which will reproduce the problem.

  Then I can help you to check more details.

5. Do you try to erase more size which is larger than 0x600f0000, but just smaller than 4Mbyte?

Waiting for your updated information.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,784 Views
t_thurgood
Contributor III

Hi Kerry,

1. Our flash device is the Macronix MX25L3233F.

2. MX25L3233F-M2-08-G

3. Oem board with qspi bus based on MIMXRT1021-EVK.

4. program_flexspinor_image_qspinor.bd

# The source block assign file name to identifiers
sources {
myBinFile = extern (0);
}

constants {
kAbsAddr_Start= 0x60000000;
kAbsAddr_Ivt = 0x60000400;
kAbsAddr_App = 0x60002000;
}

# The section block specifies the sequence of boot commands to be written to the SB file
section (0) {

# bit 8 is set high (Quad Enable) to allow MX25L3233F flash programming. Low nibble 6 = 100MHz qspi bus freq.
load 0xc0000106 > 0x2000;

# Configure QSPI NOR FLASH using option a address 0x2000
enable flexspinor 0x2000;

#2 Erase flash as needed.(Here only 256KBytes are erased)
# This should be 0x60000000..0x60400000; but atm the blhost/receive-sb-file times out waiting for the large erase!?
erase 0x60000000..0x60080000;

#3. Program config block
# 0xf000000f is the tag to notify Flashloader to program FlexSPI NOR config block to the start of device
load 0xf000000f > 0x3000;

# Notify Flashloader to response the option at address 0x3000
enable flexspinor 0x3000;

#5. Program image
load myBinFile > kAbsAddr_Ivt;
}

5. We envisage a program image around 512k. The flash memory needs to support 2 banks of this size, as we have to allow for Firmware upgrade. Also the upper area of flash will be used for NV storage of system data. 

best regards,

Tony

0 Kudos
Reply

1,784 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Tony Thurgood,

  Could you also please use the MCUXBootUtility tool to test it after you enter the serial download mode?

  You can find the tool from this link:

https://github.com/JayHeng/NXP-MCUBootUtility/releases/tag/v2.1.0

the related user manual is:
https://github.com/JayHeng/NXP-MCUBootUtility

  Please try it at first, this tool is more easy to use. After you connect it, you can do the erase, just check whether erase 0x60000000, length 0xf0000 works Ok or not.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,784 Views
t_thurgood
Contributor III

Hi Kerry,

Yes, it works ok with MCUXBootUtility. Interesting, I can erase the whole of flash...

blhost -t 2048000 -p COM3,115200 -j -- flash-erase-region 1610612736 4194304 9
toolStatus: 0
commandOutput: {
    "command" : "flash-erase-region",
    "response" : [],
        "status" : {
        "description" : "0 (0x0) Success.",
        "value" : 0
       }
}

However, if I d/l the flashloader with SDPhost and then run the same blhost command, it fails...

blhost\blhost -t 2048000 -p COM3,115200 -j -- flash-erase-region 1610612736 4194304 9
{
    "command" : "flash-erase-region",
    "response" : [],
        "status" : {
        "description" : "10205 (0x27DD) kStatusMemoryNotConfigured",
        "value" : 10205
        }
}

The bat file I use for downloading the flashloader has...

@ECHO OFF
@REM Use the ROM bootloader to download a more advanced bootloader that understands Flash
@sdphost\sdphost -p %1 -- error-status
@sdphost\sdphost -p %1 -- write-file 0x20208000 "OS Firmware\ivt_flashloader.bin"
@sdphost\sdphost -p %1 -- jump-address 0x20208400
@ECHO Done.

So I'm puzzled as to why blhost flash erase works with MCUBootUtility but not with the SDP tools.

br,

Tony

0 Kudos
Reply

1,784 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Tony Thurgood,

  That's very good to hear the MCUBootUtility tool works OK on you side.

  So, now, we can confirmed, it is not the hardware problems.

   Let's back to your blhost problems, please tell me which flashloader version you are using?

  Do you try the newest SDK flashloader tool?

  Please download it from this link:

Welcome | MCUXpresso SDK BuilderpastedImage_2.png

After you download it, you will find the new tool from this path:

SDK_2.6.1_EVK-MIMXRT1020\middleware\mcu-boot\bin\Tools

As I know, the MCUBootUtility also use the new tool.

Please check it.

If you still have questions about it, please kindly let me know.

Wish it helps you!

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,784 Views
t_thurgood
Contributor III

Hi Kerry,

I downloaded this latest SDK_2.6.1_EVK-MIMXRT1020 version and updated our tools. Unfortunately the timeout error still occurs if I erase more than 0x600E0000.

When I have a bit more time, I will look at this in more detail and see if I can capture some signal timing on the serial port etc.

For now, I have more priority things to work on (e.g. encryption?).

thanks for you help,

Tony

0 Kudos
Reply

1,784 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Tony Thurgood,

  In fact, the MCUBootUtility also use the blhost, you can also copy the blhost under the MCUbootutility to the flashloader package to test it.

   But, if you can accept to use the MCUBootUtility, I suggest you use that tool directly.

   Even you want to use the encryption, you also can use that tool, but you need to configure the cst at first.

  If you have the encryption question, welcome to create the new question post.

Wish it helps you!

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

1,783 Views
t_thurgood
Contributor III

Hi Kerry,

Can you (or your team) respond to this query please…

https://community.nxp.com/thread/520767

br,

Tony

0 Kudos
Reply

1,783 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Tony Thurgood,

  I find my colleague jeremy zhou already reply you in your post.

  So, if you still have question about your new question post, you can reply him directly in that post, thanks.

Wish it helps you!

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply