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.