crt_emu_cm_redlink usage

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

crt_emu_cm_redlink usage

1,360 Views
petersteinberg
Contributor I

I'm trying to program the flash on our custom board outside of MCUXpresso in Windows.

When I use the flash programming option in MCUXpresso it works as expected.

I select the "preview" option and copied the commands to a batch file and run them and the board does not get programmed.

Working output from MCUXpresso:

Executing flash operation 'Program' (Program file into flash: MyCode.axf) - Fri Feb 12 15:19:27 CST 2021
Checking MCU info...
Scanning for targets...
Executing flash action...
MCUXpresso IDE RedlinkMulti Driver v11.2 (Sep 22 2020 13:23:35 - crt_emu_cm_redlink.exe build 19)
(  0) Reading remote configuration
Wc(03). No cache support.
Found chip XML file in C:/firmware/RT1062/Release\MIMXRT1062xxxxA.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 CMSIS-DAP V0.078 (NXP Semiconductors)
Serial Number:  SVJIGVCON01PE
VID:PID:  1FC9:0143
USB Path: \\?\hid#vid_1fc9&pid_0143&mi_00#a&2c9b7671&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      = Cortex-M7 (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: MIMXRT1062xxxxA
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 Sep 25 2020 10:49:26'
Opening flash driver MIMXRT1060_SFDP_QSPI.cfx
Sending VECTRESET to run flash driver
Flash variant 'JEDEC_SFDP_Device' detected (8MB = 128*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 'MyCode.axf' ELF 0x60000000 len 0x6060
Opening flash driver MIMXRT1060_SFDP_QSPI.cfx (already resident)
Sending VECTRESET to run flash driver
Flash variant 'JEDEC_SFDP_Device' detected (8MB = 128*64K at 0x60000000)
Writing 24672 bytes to address 0x60000000 in Flash
(  0) Mass erasing Flash
Mass erased flash in 13448msec
1 of 1 (  0) Writing sectors 0-0 at 0x60000000 with 24672 bytes
(  0) at 60000000: 0 bytes - 0/24672
( 66) at 60000000: 16384 bytes - 16384/24672
(100) at 60004000: 16384 bytes - 32768/24672
Sectors written: 1, unchanged: 0, total: 1
Wrote sector 0-0 with 24672 bytes in 226msec
Closing flash driver MIMXRT1060_SFDP_QSPI.cfx
(100) Finished writing Flash successfully.
Flash Write Done
Loaded 0x6060 bytes in 14018ms (about 1kB/s)
Reset target (system)
Starting execution using system reset

Non-working commands:

set MCUX_FLASH_DIR0=C:/nxp/MCUXpressoIDE/ide/plugins/com.nxp.mcuxpresso.tools.bin.win32_11.2.0.202009221128/binaries/Flash
set MCUX_FLASH_DIR1=C:/firmware/workspace/.mcuxpressoide_packages_support/MIMXRT1062xxxxA_support/Flash
set MCUX_IDE_BIN=C:/nxp/MCUXpressoIDE/ide/plugins/com.nxp.mcuxpresso.tools.bin.win32_11.2.0.202009221128/binaries/
%MCUX_IDE_BIN%/crt_emu_cm_redlink --flash-mass-load-exec "C:/firmware/RT1062/Release/MyCode.axf" -p MIMXRT1062xxxxA --ConnectScript RT1060_connect.scp --flash-driver MIMXRT1060_SFDP_QSPI.cfx -x C:/firmware/RT1062/Release --flash-dir %MCUX_FLASH_DIR0% --flash-dir %MCUX_FLASH_DIR1% --flash-hashing

 Non-working output:

Ns: MCUXpresso IDE RedlinkMulti Driver v11.2 (Sep 22 2020 13:23:35 - crt_emu_cm_redlink build 19)
Wc(03). No cache support.
Nc: Found chip XML file in C:/firmware/RT1062/Release\MIMXRT1062xxxxA.xml
Nc: Restarted LinkServer process (PID 2980).
Wc: ============= SCRIPT: RT1060_connect.scp =============
Wc: RT1060 Connect Script
Wc: DpID = 0BD11477
Wc: APID = 0x04770041
Wc: Disabling MPU
Wc: Configure FlexRAM for 768KB OC RAM, 128KB I-TCM, 128KB D-TCM
Wc: Finished
Wc: ============= END SCRIPT =============================
Nc: Probe Firmware: MCU-LINK CMSIS-DAP V0.078 (NXP Semiconductors)
Nc: Serial Number:  SVJIGVCON01PE
Nc: VID:PID:  1FC9:0143
Nc: USB Path: \\?\hid#vid_1fc9&pid_0143&mi_00#a&2c9b7671&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Nc: Using memory from core 0 after searching for a good core
Pc: ( 30) Emulator Connected
Pc: ( 40) Debug Halt
Pc: ( 50) CPU ID
Nc: debug interface type      = Cortex-M7 (DAP DP ID 0BD11477) over SWD TAP 0
Nc: processor type            = Cortex-M7 (CPU ID 00000C27) on DAP AP 0
Nc: number of h/w breakpoints = 8
Nc: number of flash patches   = 0
Nc: number of h/w watchpoints = 4
Nc: Probe(0): Connected&Reset. DpID: 0BD11477. CpuID: 00000C27. Info: <None>
Nc: Debug protocol: SWD. RTCK: Disabled. Vector catch: Disabled.
Ns: Content of CoreSight Debug ROM(s):
Nc: RBASE E00FD000: CID B105100D PID 000008E88C ROM (type 0x1)
Nc: ROM 1 E00FE000: CID B105100D PID 04000BB4C8 ROM (type 0x1)
Nc: ROM 2 E00FF000: CID B105100D PID 04000BB4C7 ROM (type 0x1)
Nc: ROM 3 E000E000: CID B105E00D PID 04000BB00C Gen SCS (type 0x0)
Nc: ROM 3 E0001000: CID B105E00D PID 04000BB002 Gen DWT (type 0x0)
Nc: ROM 3 E0002000: CID B105E00D PID 04000BB00E Gen (type 0x0)
Nc: ROM 3 E0000000: CID B105E00D PID 04000BB001 Gen ITM (type 0x0)
Nc: ROM 2 E0041000: CID B105900D PID 04001BB975 CSt ARM ETMv4.0 type 0x13 Trace Source - Core
Nc: ROM 2 E0042000: CID B105900D PID 04004BB906 CSt type 0x14 Debug Control - Trigger, e.g. ECT
Nc: ROM 1 E0040000: CID B105900D PID 04000BB9A9 CSt type 0x11 Trace Sink - TPIU
Nc: ROM 1 E0043000: CID B105F00D PID 04001BB101 Sys (type 0x0)
Nc: NXP: MIMXRT1062xxxxA
Nc: DAP stride is 1024 bytes (256 words)
Nc: Inspected v.2 External Flash Device on SPI using SFDP JEDEC ID MIMXRT1060_SFDP_QSPI.cfx
Nc: Image 'iMXRT1060_SFDP_QSPI Sep 25 2020 10:49:26'
Nc: Opening flash driver MIMXRT1060_SFDP_QSPI.cfx
Nc: Sending VECTRESET to run flash driver
Nc: Flash variant 'JEDEC_SFDP_Device' detected (8MB = 128*64K at 0x60000000)
Nc: Closing flash driver MIMXRT1060_SFDP_QSPI.cfx
Nt: Loading 'MyCode.axf' ELF 0x60000000 len 0x6060
Nc: Opening flash driver MIMXRT1060_SFDP_QSPI.cfx (already resident)
Nc: Sending VECTRESET to run flash driver
Nc: Flash variant 'JEDEC_SFDP_Device' detected (8MB = 128*64K at 0x60000000)

It looks like it just stops early without erasing or programming the device.

 

Any idea on how to get it to program as expected?

 

Thanks,

  Peter Steinberg

0 Kudos
2 Replies

814 Views
hariseldon
Contributor I

For what it's worth, I've been using this method of flashing my RT1050 EVKB without the GUI, from a linux host. I found it helpful to learn the "BASIC" language of the binaries/Scripts/RT1050_connect.scp script, so I could select among the 4 EVKB/USB/Jlink connections I have on a single system. I don't use gdb, but rather edit the .scp script to my needs and feed it to crt_emu_cm_redlink via the -ConnectScript param.

0 Kudos

1,341 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
To be honest, I've not encountered other customers try your method to program the image to MCU.
In my opinion, you want to follow the command log to reverse infer the programing process. However, we don't know whether the command is completely actually.
So I'd highly recommend you to use the Flashloader to implement the programming work, and the NXP provides a GUI tool to simplify the job.
Have a great day,
TIC

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