How to use LPSPI module with the flashloader

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

How to use LPSPI module with the flashloader

Jump to solution
3,128 Views
julio_delgado
Contributor II

I'm trying to flash a external memory using the LPSPI module and the flashloader. According to the Flashloader manual the LPSPI module can be used for Serial NOR/EEPROM memories but I had not been lucky.

  1. I flash the Flashloader into RAM using SDPHOST utility.
  2. Using BLHOST utility:
    1. blhost -u -- fill-memory 0x2000 0x04 0xc0333007 (write option block to SRAM address 0x2000)
    2. blhost -u -- configure-memory 0x110 0x2000
  3. Then I try to read the memory using BLHOST:
    1. blhost -u -- read-memory 0x60000000 0x200
  4. I get the error 10205 (0x27dd) kStatusMemoryNotConfigured

My setup:

MCU: RT1064

External memory: IS25WP128/064/032

Peripheral: USB

Please advice.

Labels (1)
Tags (2)
1 Solution
2,692 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Julio Delgado,

   Than you for your updated information.

   I have updated the attachment, please try the newest one:

NXP-MCUBootUtility_v1.4.0_patch_for_lpspi_nor_128mb_support.zip

   Any updated information, please kindly let me know.


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

View solution in original post

17 Replies
2,692 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Julio Delgado,

    Please use the attached file, and replace your MCUBOOTutitlity:  \src\targets\MIMXRT1062 and MIMXRT1064

    Jay Heng is our expert and the MCUBOOTutitlity author, this attachment is from his side.

    Please try it on your side.

    Any updated information, please kindly let us know.

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
2,692 Views
julio_delgado
Contributor II

Hello Kerry and Jay,

Thank you for the support on this.

I used the new Flashloader and I no longer get an error message when the memory is configured, but when I try to write or read any address after 16MB I get the same error:

 

Writing:

C:\Users\..\bin\Debug>blhost.exe -u 0x15A2,0x0073  -- write-memory 0x00000000 nvm.bin 0x110

Inject command 'write-memory'

Preparing to send 33554432 (0x2000000) bytes to the target.

Successful generic response to command 'write-memory'

(1/1)100% Completed!                  <-- The % was increased at regular speed before 50%, after, it increased faster.

usbhid: received data phase abort

Response status = 10200 (0x27d8) kStatusMemoryRangeInvalid  <-- Same error than before

Wrote 33554432 of 33554432 bytes.

 

Reading:

C:\Users\..\bin\Debug>blhost.exe -u 0x15A2,0x0073  -- read-memory 0x1000000 0x100 0x110

Inject command 'read-memory'

Successful response to command 'read-memory'

usbhid: received data phase abort

Data phase aborted by sender

Response status = 10200 (0x27d8) kStatusMemoryRangeInvalid <-- Same error than before

Response word 1 = 0 (0x0)

Read 0 of 256 bytes.

Greetings

0 Kudos
2,693 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Julio Delgado,

   Than you for your updated information.

   I have updated the attachment, please try the newest one:

NXP-MCUBootUtility_v1.4.0_patch_for_lpspi_nor_128mb_support.zip

   Any updated information, please kindly let me know.


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

2,692 Views
julio_delgado
Contributor II

Hello Kerry,

Thank you again for the fast support. I used the new Flashloader (Both) and I get this error:

pastedImage_1.png

If I see the USB properties on the Device Manager I observe that the Device did not change to the Flashlaoder's VID and PID:

pastedImage_2.png

Can you please help me to investigate this?

Thank you

0 Kudos
2,692 Views
julio_delgado
Contributor II

Hello Kerry,

I created, based on the attached SREC file a bootable image using elftosb. It seems that it worked ad now the flashloader does write and read. But it still has the issue, even the error messages are different now:

Write:

pastedImage_1.png

Read:

pastedImage_2.png

Please advice

0 Kudos
2,692 Views
julio_delgado
Contributor II

Hello Kerry,

I continued testing the new Flashloader, it seems that it was on my side the issue, I was configuring wrong the memory.

 

I confirm now that the new Flashloader works for our purposes.

 

Thank you again for the great and fast support.

2,692 Views
jay_heng
NXP Employee
NXP Employee

This is a limitation in Flashloader, as Flashloader is designed to support EEPROM (default recovery device), so 16MB is large enough for EEPROM. this limitation applies to 1-bit NOR as well. If customer do want to program 32MB NOR Flash, SW ROM team needs to update Flashloader.

 

Anyway, I will update my tool (NXP-MCUBootUtility) to fix this limitation, v2.0.0 will be released this Friday

2,692 Views
julio_delgado
Contributor II

Hello Kerry

I'm using a 32 Mbytes memory, I attached photos of my configuration and error logs.

Question: Do you have the LPSPI Configuration Option Block?

Configuration:

pastedImage_2.png

Error using MCU Boot Utility:

pastedImage_1.png

pastedImage_5.png

Error using blhost tool manually;

pastedImage_4.png

0 Kudos
2,692 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Julio Delgado,

   Thank you for your detail information.

   Do you use the correct LPSPI pins?

  I find you have selected the SPI index as 3.  Do you use these pins?

pastedImage_3.png

Please share your according schematic.

MCUbootutility also have the log, please share the MCUbootutility tool log when you meet the problems.

You said: I'm still getting issues as the tool seems to support only 16Mb, whenever I try to setup a bigger memory I get this error.

Do you mean, if you choose this configuration with the same hardware:

pastedImage_4.png

Then you don't have problems? Is it right?

If yes, please also share your 16M log?


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
2,692 Views
julio_delgado
Contributor II

Hello Kerry,

The LPSPI instance should not be the problem, I'm using a 32 MB connected to LPSPI instance 3 for all my testing.

I'm using a 32 MB memory with both configuration, and the only change I do is select between 16 MB or 32 MB on the Boot Device Configuration.

  • when I configure the MCUBootUtility to work with a 16 MB memory (Although it is 32 MB in real life) it is properly configures and I can work with that memory but only the first 16 MB.
    • Log from tool: 16MB_log.txt
    • Log from Cmd window on bakcground: 16MB_NXP-MCUBootUtility_Cmd_Window.txt

  • when I configure the tool to work with a 32 MB, without changing any of my schematic, I get the kStatus_SerialNorEepromSizeInvalid error message and I'm not able to work with the memory.
    • Log from tool: 32MB_log.txt
    • Log from Cmd window on bakcground: 32MB_NXP-MCUBootUtility_Cmd_Window.txt

pastedImage_1.png

0 Kudos
2,692 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Julio Delgado,

   Thank you for your updated information.

   Please tell me, what the detail nor flash you are using? 32 MB flash is which chip part number?  IS25WP128?

   Please note:  IS25WP128 is the 128Mbit=16MByte.

   And in the MCUBootUtility, the total size is KByte, not Kbits.

  So, if you are using IS25WP128, actually it is 16MByte,  then you need to select 16384.

  But if you are using IS25WP256, please also let me know, then I will need to check it with our MCUBootUtility tool author.

 


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
2,692 Views
julio_delgado
Contributor II

Hi Kerry,

I'm using a IS25LP256D,

Thank you

0 Kudos
2,692 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Julio Delgado,

   Thank you for your updated information.

   I already help you to check it in our internal side, if I get any feedback, I will let you know ASAP,

   please wait patiently, thanks a lot for your understanding.

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
2,692 Views
julio_delgado
Contributor II

I have been able to read the external memory using the Flashloader, but for some reason it has been addressed to address 0x00000000. This location is limited to 512kB which doesn't allows me to read the whole flash.

Can this memory be addressed in other location?

0 Kudos
2,692 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Julio Delgado,

  You can try to use this new tool:

https://github.com/JayHeng/NXP-MCUBootUtility/releases/tag/v1.4.0

  You can find the user manual from this link:

GitHub - JayHeng/NXP-MCUBootUtility: A one-stop boot utility tool based on Python2.7+wxPython4.0, it... 

pastedImage_2.png

Please try it!

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


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
2,692 Views
julio_delgado
Contributor II

Thank you Kerry, it helped a lot.

I'm still getting issues as the tool seems to support only 16Mb, whenever I try to setup a bigger memory I get this error:

10703 (0x29cf) kStatus_SerialNorEepromSizeInvalid

My guess is that it is related to the 4-byte addressing that a memory bigger than 16MB requires. But I'm not able to find where can I setup this change.

Could you please help me to figure out the issue?

0 Kudos
2,692 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Julio Delgado,

  Could you please share your configuration, and the memory size you are using?

  You can also share the screenshot when you get the error, then I will help you to check it.


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