Obtaining a load failure when flashing a binary file

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

Obtaining a load failure when flashing a binary file

282 Views
filo96
Contributor III

Dear NXP community,

We are encountering a problem with our IMXRT1062, where thre is a bug when trying to flash a binary file in it.

The IMXRT has an external 64MB flash, where the firmware is written.

 

We're working on it for a while already and we flashed the firmware (.axf, .bin) a 50MB file of graphics (.bin) and it worked well, by using the GUI flash tool of MCUXpresso IDE.

Then we added a new binary file (.bin) of 327696 byte and we wrote it at address 0x63FB0000 of the flash. The process ended with error load failure: Ef(49): Flash driver operation gave error.

Executing flash operation 'Program' (Program file into flash: my_file1.bin) - Fri Apr 12 16:30:11 CEST 2024
Checking MCU info...
Scanning for targets...
Executing flash action...
MCUXpresso IDE RedlinkMulti Driver v11.7 (Jan 12 2023 18:05:45 - crt_emu_cm_redlink.exe build 1)
(  0) Reading remote configuration
Wc(03). No cache support.
Found chip XML file in C:/Users/evkmimxrt1060_lvgl_guider_test2/Debug_NOUSB_NOPRINTER\MIMXRT1062xxxxB.xml
(  5) Remote configuration complete
Reconnected to existing LinkServer process.
============= SCRIPT: RT1060_connect.scp =============
RT1060 Connect Script
DpID = 0BD11477
APID = 0x04770041
Disabling MPU
Configure FlexRAM for 768KB OC RAM, 128KB I-TCM, 128KB D-TCM
Finished
============= END SCRIPT =============================
Probe Firmware: MCU-LINK r0FF CMSIS-DAP V0.078 (NXP Semiconductors)
Serial Number:  BI2ZGEIFL03DH
VID:PID:  1FC9:0143
USB Path: \\?\hid#vid_1fc9&pid_0143&mi_00#7&39b0f466&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Using memory from core 0 after searching for a good core
( 30) Emulator Connected
( 40) Debug Halt
( 50) CPU ID
debug interface type      = CoreSight DP (DAP DP ID 0BD11477) over SWD TAP 0
processor type            = Cortex-M7 (CPU ID 00000C27) on DAP AP 0
number of h/w breakpoints = 8
number of flash patches   = 0
number of h/w watchpoints = 4
Probe(0): Connected&Reset. DpID: 0BD11477. CpuID: 00000C27. Info: <None>
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Content of CoreSight Debug ROM(s):
RBASE E00FD000: CID B105100D PID 000008E88C ROM (type 0x1)
ROM 1 E00FE000: CID B105100D PID 04000BB4C8 ROM (type 0x1)
ROM 2 E00FF000: CID B105100D PID 04000BB4C7 ROM (type 0x1)
ROM 3 E000E000: CID B105E00D PID 04000BB00C Gen SCS (type 0x0)
ROM 3 E0001000: CID B105E00D PID 04000BB002 Gen DWT (type 0x0)
ROM 3 E0002000: CID B105E00D PID 04000BB00E Gen (type 0x0)
ROM 3 E0000000: CID B105E00D PID 04000BB001 Gen ITM (type 0x0)
ROM 2 E0041000: CID B105900D PID 04001BB975 CSt ARM ETMv4.0 type 0x13 Trace Source - Core
ROM 2 E0042000: CID B105900D PID 04004BB906 CSt type 0x14 Debug Control - Trigger, e.g. ECT
ROM 1 E0040000: CID B105900D PID 04000BB9A9 CSt type 0x11 Trace Sink - TPIU
ROM 1 E0043000: CID B105F00D PID 04001BB101 Sys (type 0x0)
NXP: MIMXRT1062xxxxB
DAP stride is 1024 bytes (256 words)
Inspected v.2 External Flash Device on SPI using SFDP JEDEC ID MIMXRT1060_SFDP_QSPI.cfx
Image 'iMXRT1060_SFDP_QSPI Jan 13 2023 12:24:40'
Opening flash driver MIMXRT1060_SFDP_QSPI.cfx
Sending VECTRESET to run flash driver
Flash variant 'JEDEC_SFDP_Device' detected (64MB = 1024*64K at 0x60000000)
Closing flash driver MIMXRT1060_SFDP_QSPI.cfx
( 65) Chip Setup Complete
Connected: was_reset=false. was_stopped=true
( 70) License Check Complete
Loading 'my_file1.bin' Binary 0x63FB0000 len 0x50010
Opening flash driver MIMXRT1060_SFDP_QSPI.cfx (already resident)
Sending VECTRESET to run flash driver
Flash variant 'JEDEC_SFDP_Device' detected (64MB = 1024*64K at 0x60000000)
Writing 327696 bytes to address 0x63FB0000 in Flash
1 of 1 (  0) Writing sectors 1019-1019 at 0x63FB0000 with 327696 bytes
(  0) at 63FB0000: 0 bytes - 0/327696
(  4) at 63FB0000: 16384 bytes - 16384/327696
(  9) at 63FB4000: 16384 bytes - 32768/327696
( 14) at 63FB8000: 16384 bytes - 49152/327696
( 19) at 63FBC000: 16384 bytes - 65536/327696
( 24) at 63FC0000: 16384 bytes - 81920/327696
( 29) at 63FC4000: 16384 bytes - 98304/327696
( 34) at 63FC8000: 16384 bytes - 114688/327696
( 39) at 63FCC000: 16384 bytes - 131072/327696
( 44) at 63FD0000: 16384 bytes - 147456/327696
( 49) at 63FD4000: 16384 bytes - 163840/327696
( 54) at 63FD8000: 16384 bytes - 180224/327696
( 59) at 63FDC000: 16384 bytes - 196608/327696
( 64) at 63FE0000: 16384 bytes - 212992/327696
( 69) at 63FE4000: 16384 bytes - 229376/327696
( 74) at 63FE8000: 16384 bytes - 245760/327696
( 79) at 63FEC000: 16384 bytes - 262144/327696
( 84) at 63FF0000: 16384 bytes - 278528/327696
( 89) at 63FF4000: 16384 bytes - 294912/327696
( 94) at 63FF8000: 16384 bytes - 311296/327696
( 99) at 63FFC000: 16384 bytes - 327680/327696
ProgramPage (0x64000000, 0x20005770, 0x4000) status 0x1 - driver reported driver error - EXTSPIJ driver rc 7001 (0x1B59)
Sectors written: 5, unchanged: 0, total: 5
Closing flash driver MIMXRT1060_SFDP_QSPI.cfx
(100) Writing Flash ended with an error.
File 'my_file1.bin' load failure: Ef(49): Flash driver operation gave error.
(100) Target Connection Failed
Unable to perform operation!
Command failed with exit code 1

 

If we try again to flash the same file at the same position, this time the process works fine and it flashes successfully the binary file.

Executing flash operation 'Program' (Program file into flash: my_file1.bin) - Fri Apr 12 16:31:08 CEST 2024
Checking MCU info...
Scanning for targets...
Executing flash action...
MCUXpresso IDE RedlinkMulti Driver v11.7 (Jan 12 2023 18:05:45 - crt_emu_cm_redlink.exe build 1)
(  0) Reading remote configuration
Wc(03). No cache support.
Found chip XML file in C:/Users/evkmimxrt1060_lvgl_guider_test2/Debug_NOUSB_NOPRINTER\MIMXRT1062xxxxB.xml
(  5) Remote configuration complete
Reconnected to existing LinkServer process.
============= SCRIPT: RT1060_connect.scp =============
RT1060 Connect Script
DpID = 0BD11477
APID = 0x04770041
Disabling MPU
Configure FlexRAM for 768KB OC RAM, 128KB I-TCM, 128KB D-TCM
Finished
============= END SCRIPT =============================
Probe Firmware: MCU-LINK r0FF CMSIS-DAP V0.078 (NXP Semiconductors)
Serial Number:  BI2ZGEIFL03DH
VID:PID:  1FC9:0143
USB Path: \\?\hid#vid_1fc9&pid_0143&mi_00#7&39b0f466&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Using memory from core 0 after searching for a good core
( 30) Emulator Connected
( 40) Debug Halt
( 50) CPU ID
debug interface type      = CoreSight DP (DAP DP ID 0BD11477) over SWD TAP 0
processor type            = Cortex-M7 (CPU ID 00000C27) on DAP AP 0
number of h/w breakpoints = 8
number of flash patches   = 0
number of h/w watchpoints = 4
Probe(0): Connected&Reset. DpID: 0BD11477. CpuID: 00000C27. Info: <None>
Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Content of CoreSight Debug ROM(s):
RBASE E00FD000: CID B105100D PID 000008E88C ROM (type 0x1)
ROM 1 E00FE000: CID B105100D PID 04000BB4C8 ROM (type 0x1)
ROM 2 E00FF000: CID B105100D PID 04000BB4C7 ROM (type 0x1)
ROM 3 E000E000: CID B105E00D PID 04000BB00C Gen SCS (type 0x0)
ROM 3 E0001000: CID B105E00D PID 04000BB002 Gen DWT (type 0x0)
ROM 3 E0002000: CID B105E00D PID 04000BB00E Gen (type 0x0)
ROM 3 E0000000: CID B105E00D PID 04000BB001 Gen ITM (type 0x0)
ROM 2 E0041000: CID B105900D PID 04001BB975 CSt ARM ETMv4.0 type 0x13 Trace Source - Core
ROM 2 E0042000: CID B105900D PID 04004BB906 CSt type 0x14 Debug Control - Trigger, e.g. ECT
ROM 1 E0040000: CID B105900D PID 04000BB9A9 CSt type 0x11 Trace Sink - TPIU
ROM 1 E0043000: CID B105F00D PID 04001BB101 Sys (type 0x0)
NXP: MIMXRT1062xxxxB
DAP stride is 1024 bytes (256 words)
Inspected v.2 External Flash Device on SPI using SFDP JEDEC ID MIMXRT1060_SFDP_QSPI.cfx
Image 'iMXRT1060_SFDP_QSPI Jan 13 2023 12:24:40'
Opening flash driver MIMXRT1060_SFDP_QSPI.cfx
Sending VECTRESET to run flash driver
Flash variant 'JEDEC_SFDP_Device' detected (64MB = 1024*64K at 0x60000000)
Closing flash driver MIMXRT1060_SFDP_QSPI.cfx
( 65) Chip Setup Complete
Connected: was_reset=false. was_stopped=true
( 70) License Check Complete
Loading 'my_file1.bin' Binary 0x63FB0000 len 0x50010
Opening flash driver MIMXRT1060_SFDP_QSPI.cfx (already resident)
Sending VECTRESET to run flash driver
Flash variant 'JEDEC_SFDP_Device' detected (64MB = 1024*64K at 0x60000000)
Writing 327696 bytes to address 0x63FB0000 in Flash
1 of 1 (  0) Writing sectors 1019-1019 at 0x63FB0000 with 327696 bytes
(  0) at 63FB0000: 0 bytes - 0/327696
( 99) at 63FB0000: 327680 bytes - 327680/327696
Sectors written: 0, unchanged: 5, total: 5
Erased/Wrote sector 1019-1019 with 327696 bytes in 26msec
Closing flash driver MIMXRT1060_SFDP_QSPI.cfx
(100) Finished writing Flash successfully.
Flash Write Done
Loaded 0x50010 bytes in 106ms (about 3091kB/s)
Reset target (system)
Starting execution using system reset

 

How can I avoid this error? Is there something I'm hitting that could raise future problems, although the second time it seems working?

Thank you for your help.

Labels (1)
0 Kudos
5 Replies

267 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @filo96 ,

  Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.

  I have a question to you, do you always meet the first time download issues, and the second time works ok?

  Or just meet one time, then other time works? 

  If it is the seldom, it may related to the unstable debugger connection, not the IDE issues.

  You may need to check the hardware side connection is stable or not. 

 

Wish it helps you!

Best Regards,

Kerry

0 Kudos

234 Views
filo96
Contributor III

Hello @kerryzhou , thank you for your support,

 

The problem happens every time I write the file in the flash when there's anything written yet.

As you can see, the second time I try to write, it completes successfully the process.

If I try again, it says:

 

Writing 327696 bytes to address 0x63FB0000 in Flash
1 of 1 (  0) Writing sectors 1019-1019 at 0x63FB0000 with 327696 bytes
(  0) at 63FB0000: 0 bytes - 0/327696
( 99) at 63FB0000: 327680 bytes - 327680/327696
Sectors written: 0, unchanged: 5, total: 5
Erased/Wrote sector 1019-1019 with 327696 bytes in 37msec
Closing flash driver MIMXRT1060_SFDP_QSPI.cfx
(100) Finished writing Flash successfully.
Flash Write Done
Loaded 0x50010 bytes in 115ms (about 2849kB/s)

 

So basically it skips all the sectors because the system checks if what is written is equal to what I'm trying to write, hence it completes sucessfully the process again.

To reproduce the issue, I must erase the memory and try again.

 

What I can't understand is why this is happening systematically.. I reproduced this problem in two boards already.

The next step for us will be writing the same file by using the USB port. We would like to avoid issues like this one, before doing all the work. Can you help us?

 

Thank you

Tags (2)
0 Kudos

202 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @filo96 ,

  Thanks for your updated information.

  From your log, it is report the flashloader program issues:

ProgramPage (0x64000000, 0x20005770, 0x4000) status 0x1 - driver reported driver error - EXTSPIJ driver rc 7001 (0x1B59)

  I have a question, in your RT1062 board, do you let the DQS pin floating?

Do you have the NXP MIMXRT1060-EVK board or not? Whether download the same project have the same issues or not? Or just your customer board have this issues?

To you own board flash, do you also enable the QE bit or not?

Please help also test your code in the NXP board, this will help me to analysis the root issues, thanks. Just want to know, whether it is also related to the hardware or not.

 

Any updated information, please kindly let me know.

Best Regards,

Kerry

0 Kudos

193 Views
filo96
Contributor III

  I have a question, in your RT1062 board, do you let the DQS pin floating?

The DQS pin of the external flash memory (MX25UM) is connected to the GPIO_SD_B1_05 pin of the IMXRT.

Screenshot 2024-04-18 142044.png

 

Do you have the NXP MIMXRT1060-EVK board or not? Whether download the same project have the same issues or not? Or just your customer board have this issues?

Yes, we have an evaluation board but at this time of the development, where we use a custom board, it would be hard to go back in the evaluation board.

 

To you own board flash, do you also enable the QE bit or not?

How can I check this?

 

Please help also test your code in the NXP board, this will help me to analysis the root issues, thanks. Just want to know, whether it is also related to the hardware or not.

We think we'll check this if the problem invalidates the writing in some cases.

 

Thank you @kerryzhou  for your patience

Tags (3)
0 Kudos

60 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @filo96 ,

  Thank you for your updated information.

  I know your root issues now, just be caused by your DQS is used.

  To this situation, you need to set the flashloader flexspi mode to the loop back internally:

FlexSPIn_MCR0[RXCLKSRC]=0x0, and also need to set the flexspi frequency not lager thank 60Mhz.

kerryzhou_0-1714117937653.png

  Now, you are using the MCUXPresso, so, you need to generate the new .cfx file.

You can refer to this post:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/How-to-create-a-new-Flash-driver-of-the-MCUXPres...

Then, in the flashloader source code modify the frequency to 60Mhz at first, then try it again.

This Chinese document also very useful to tell you how to generate the new .cfx.

https://www.cnblogs.com/henjay724/p/14190485.html

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

Best Regards,

Kerry

 

0 Kudos