Problem to configure flash memory

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem to configure flash memory

2,090件の閲覧回数
tbonkers
Contributor II

I am truing to use the Secure Provisioning tool for programming a brand-new board with MIMXRT1042 and 2 x 1 Mb serial NOR flash AT25FF081A on FlexSPI1 and FlexSPI2 (my initial attempt is to use only one). I run into the following error over and over again (see screenshot below). Using the Tools->Flash Programmer, I can erase the flash, but writing is not reliable. The tool is also displaying the message "Success: External flash configured, however minimal erasable block size not detected".

tbonkers_0-1700863886500.png

The output of the tool is below:

Executing script C:\Users\null\secure_provisioning\ext_memory_setup.bat
### SCRIPT: Initialize external memory: C:\Users\null\secure_provisioning\ext_memory_setup.bat
### Check presence of FlashLoader ###
### Configure FlexSPI NOR memory using options on address 0x2000 ###
blhost -t 5000 -p COM3,115200 -j -- fill-memory 0x2000 4 0xC0000008 word
{
   "command": "fill-memory",
   "response": [],
   "status": {
      "description": "0 (0x0) Success.",
      "value": 0
   }
}
blhost succeeded
blhost -t 5000 -p COM3,115200 -j -- configure-memory 9 0x2000
{
   "command": "configure-memory",
   "response": [],
   "status": {
      "description": "0 (0x0) Success.",
      "value": 0
   }
}
blhost succeeded
### RESULT of the script `Initialize external memory`: SUCCESS (return code = [0]SUCCESS)
Status of the operation: SUCCESS: Initialize external memory
Executing script C:\Users\null\secure_provisioning\ext_memory_setup.bat
### SCRIPT: Initialize external memory: C:\Users\null\secure_provisioning\ext_memory_setup.bat
### Check presence of FlashLoader ###
### Configure FlexSPI NOR memory using options on address 0x2000 ###
blhost -t 5000 -p COM3,115200 -j -- fill-memory 0x2000 4 0xC0000008 word
{
   "command": "fill-memory",
   "response": [],
   "status": {
      "description": "0 (0x0) Success.",
      "value": 0
   }
}
blhost succeeded
blhost -t 5000 -p COM3,115200 -j -- configure-memory 9 0x2000
{
   "command": "configure-memory",
   "response": [],
   "status": {
      "description": "0 (0x0) Success.",
      "value": 0
   }
}
blhost succeeded
### RESULT of the script `Initialize external memory`: SUCCESS (return code = [0]SUCCESS)
Status of the operation: SUCCESS: Initialize external memory
ERROR: `blhost -- configure-memory 9 0x00002000` >>> FAILED with exception: MBoot: ConfigureMemory interrupted -> FlexSPINOR: Command Failure

 What could be the problem?

0 件の賞賛
返信
7 返答(返信)

2,036件の閲覧回数
liborukropec
NXP Employee
NXP Employee

Hello Borislav,

could you please specify the exacts steps in the order you are executing them? You mentioned reliability of Flash programmer and write action, but the error and screenshot is from the Memory configuration dialog where the Simple configuration is converted to FCB. Did you erased whole flash in Flash programmer? Did you reset the chip after flash erase, etc.?

 

Thank you,

Libor

0 件の賞賛
返信

2,023件の閲覧回数
tbonkers
Contributor II

Hi Libor,

I'll summarize my interaction with the tool below:

1. Open the tool
2. Set FlexSPI NOR - simplified using the AT25SF128A template, modify Memory size to match the memory I have (1 MiB), and click on Test. Log attached.
3. Click on "Convert to FCB". Operation fails - log attached.
4. Open Tools->Flash Programmer. The window says "Erasable block size: not known" and "Erased range: not known".
Modify the buffer size to match the memory size: 0x100000, and click Erase. The status is "Sucess: Erase memory region 0x60000000 - 0x600FFFFF".
5. Click on Black check - result is "Success"
6. Click on Read - result is "Success"
7. Click on "Fill...", specify patter "0xcafeface" (32-bit), and then Write - fails with message "ERROR: `blhost -- write-memory 0x60000000 1048576` >>> FAILED with exception: MBoot: WriteMemory interrupted -> FlexSPINOR: Command Failure".
8. Reset target and open the Flash programmer again, then read 0x100000 bytes. The Log window displays "ERROR: TAG does not match: fafecace"
9. Memory read is complete and buffer is filled. It appears that previous Fill operation succeeded in writting the first 512 bytes, but the pattern seem wrong. Screenshot below

tbonkers_0-1701078231509.png

10. Click on Erase memory - result is Success

11. Reset target and open Flash programmer again. Read first 0x400 bytes - success

12. Try to write "0xcafeface" at address 0x0 and "0xdeadbeef" at the end of the 0x400-bytes block. Result is "ERROR: `blhost -- write-memory 0x60000000 1024` >>> FAILED with exception: MBoot: WriteMemory interrupted -> FlexSPINOR: Command Failure"

13. Try to read the memory again - nothing has been written.

14. Try to write the whole memory block at one go - fails with "ERROR: `blhost -- write-memory 0x60000000 1048576` >>> FAILED with exception: MBoot: WriteMemory interrupted -> FlexSPINOR: Command Failure".

15. Erase memory - success

16. Try to fill the first 0x400 bytes with 0xcafeface pattern:

tbonkers_1-1701078773640.png

Operation fails again.

 

17. Read 0x400 bytes - success. The pattern seems shifted.

tbonkers_2-1701078839401.png

So it appears there's a problem with writting to the flash. Could that be the reason "Convert to FCB fails"?

I also can't upload application to the flash using JLink and MCUXpresso.

 

0 件の賞賛
返信

2,016件の閲覧回数
liborukropec
NXP Employee
NXP Employee

Hi Borislav,

on first look there are two issues:

1) the creation of FCB fails - it might be wrong configuration of the used Flash. BTW, is it a custom board?

 

2) writing to 0x60000000 on first 512bytes basically corrupts location where the ROM configures/reads the FCB. So if you rewrite it with some pattern, the configuration is not recognized, including the erasable size, etc.

Regards,

Libor

0 件の賞賛
返信

2,014件の閲覧回数
tbonkers
Contributor II

Hi Libor,

Thank you for the quick reply. Yes it is a custom board using MIMXRT1042XJM5B and NOR Flash

I've tried every possible Quad SPI configuration, but can't configure the FCB.
 
Is there something I can to to determine why configuring FCB fails?
tbonkers_0-1701081120580.pngtbonkers_1-1701081175532.png

 

0 件の賞賛
返信

1,996件の閲覧回数
martin_lapis
NXP Employee
NXP Employee

Hello @tbonkers ,

this is probably not related to your issue, but I see no pull-ups on D2 and D3 (WP/IO2# and HOLD/IO3#)  signals in your schematic. It is not obvious from the pictures you shared here if there are any. These pull-ups are necessary in order to boot from the memory properly and might affect communication with the chip in single SPI mode.

Best Regards.
Martin

0 件の賞賛
返信

1,992件の閲覧回数
tbonkers
Contributor II
Hi Martin,
I do not have the pull-up resistors you mentioned on the board. When I was doing the schematic capture I was using MIMXRT1040-EVK board as a reference, and these pull-ups are marked with DNP in the schematic.

I managed to flash the example evkmimxrt1040_flexspi_nor_polling_transfer, but had to change some of the configuration structure params. This is described in another topic: https://community.nxp.com/t5/i-MX-Processors/MIMXRT1042-cannot-write-in-external-NOR-flash/m-p/17641....
0 件の賞賛
返信

1,988件の閲覧回数
martin_lapis
NXP Employee
NXP Employee

Hello @tbonkers ,

I would recommend placing the pull-ups on D2 and D3 anyway. Even if they are left DNP.

You are facing your memory chip config issue. It is difficult for me to recognize the root cause. I have no sample of the 25FFxx chip available to me at the moment. If you need support for this can you provide a sample of the chip used by your design to me? Then I would be able to test it with my validation board and probably provide valid config back to you.

Best Regards.
Martin

0 件の賞賛
返信