MIMXRT1040-EVK Unable to connect using LinkServer

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

MIMXRT1040-EVK Unable to connect using LinkServer

Jump to solution
3,192 Views
MulattoKid
Contributor IV

Hi,

I'm working with an MIMXRT1040-EVK, and I've been using the Cortex-Debug extension in VSCode to program and debug my application, along with LinkServer

 

LinkServer gdbserver --keep-alive MIMXRT1042xxxxB:MIMXRT1040-EVK

 

At one point I flashed Zephyr's HelloWorld sample, after which GDB seems to be unable to connect to the GDB server. Even doing it manually doesn't work:

 

# Terminal 1
LinkServer gdbserver --keep-alive MIMXRT1042xxxxB:MIMXRT1040-EVK
NFO: Exact match for MIMXRT1042xxxxB:MIMXRT1040-EVK found
INFO: Selected device MIMXRT1042xxxxB:MIMXRT1040-EVK
INFO: Getting available probes
INFO: Selected probe #1 022900003ac6651a00000000000000000000000097969905 (DAPLink CMSIS-DAP)
GDB server listening on port 3333 in debug mode (core cm7)
Semihosting server listening on port 4444 (core cm7)
# Halts here until GDB tries to connect
INFO: Connected to core cm7
INFO: Disconnected from core cm7
Gdbserver on port 3333 has closed

# Terminal 2
<toolchain path>/arm-none-eabi-gdb <path to elf>
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
Remote connection closed

 

I initially thought I might be doing something wrong, but I've got a second MIMXRT1040-EVK, and programming Zephyr's HelloWorld sample on it works repeatedly.

I've tried power-cycling the EVK, as well as pressing SW1 and SW7, upon which the sample seems to run fine, but I'm still unable to connect. I also tried putting on new FW for the LPC4322, but it didn't seem to make a difference.

Is there anything else I could try? I'm scared I'll end up in the same situation with my 2nd EVK, without being able to recover from it.

Here are my versions:

 

LinkServer v1.3.15 [Build 15] [2023-10-19 13:58:16]
Cortex-Debug 1.12.1
GNU gdb (Arm GNU Toolchain 13.2.rel1 (Build arm-13.7)) 13.2.90.20231008-git

 

Thanks,
Daniel

0 Kudos
Reply
1 Solution
3,173 Views
MulattoKid
Contributor IV

I found a solution to the problem.

  1. Follow RT board recovery for debugger connect issues
    1. Note that you most likely need to select "UART" instead of "USB" as the connection to the board
    2. Follow the rest of the instructions, and erase the flash
  2. It was the Zephyr HelloWorld sample that I think put me in this situation, so I instead built a different sample that doesn't just exit, but instead runs in a loop, Zephyr Blinky
  3. Then, using the same tool as before, I go to the "Build image" tab, open the built binary as the source, and build it
  4. Next, select the "Write image" tab, open the *_nopadding.bin file that was just built (it's inside the workspace directory), and write it
  5. Unplug the board, and put the DIP switches back to "Internal boot" mode, and plug the board back in
    1. Opening a serial terminal I can see it's running the sample as it's printing "LED ON", "LED OFF"
  6. Now, I can start a GDB server through LinkServer, and flash and debug the same binary (not the *_nopadding version) through Cortex-Debug

 

View solution in original post

14 Replies
2,919 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @MulattoKid ,

   opensda for the RT1040 already be added to the nxp.com:

https://www.nxp.com/design/design-center/software/sensor-toolbox/opensda-serial-and-debug-adapter:OP...

Thanks for your contribution.

If you find any issues, just kindly let us know.

Best Regards,

kerry

0 Kudos
Reply
3,167 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @MulattoKid ,

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

  Your issue should caused by downloading some abnormal code to the flash, this will cause the debugger connection issues.

  To this issues, normally, customer can enter the serial download mode, and do the mass erase, then back to the serial download to make your debugger works again.

You can refer to my post:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT-board-recovery-for-debugger-connect-issues/ta...

Best Regards,

kerry

3,161 Views
MulattoKid
Contributor IV

While trying to solve it I tried putting new FW on the LPC4322, but I only found FW for the MIMXRT1060-EVK, not the MIMIXRT1040-EVK (from https://www.nxp.com/design/design-center/software/sensor-toolbox/opensda-serial-and-debug-adapter:OP...). Now the board is recognized as a 1060 instead of a 1040. Do you have FW for the LPC4322 that's for the MIMXRT1040?

Edit: or is it possible to grab it off another MIMXRT1040-EVK board somehow?

0 Kudos
Reply
3,118 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @MulattoKid ,

   Let me report internally to request the RT1040 to upload to the nxp.com/opensda/

  To your situation, I think, you can use the LPCScrypt to update the firmware again:

www.nxp.com/lpcscrypt

 

Best Regards,

Kerry

0 Kudos
Reply
3,105 Views
MulattoKid
Contributor IV

After having put the device in DFU boot, I tried running both lpcscrypt/scripts/program_JLINK and lpcscrypt/scripts/program_CMSIS, but now the device isn't detected at all after going back to normal boot mode, and I can't connect to it using MCUXpresso Secure Provisioning either, and it no longer shows up as a USB device in the "Files" utility, and lsusb detects it as "NXP Semiconductors LPC-LINK2 CMSIS-DAP V5.361".

I put it in DFU boot mode by shorting J12 on MIMXRT1040-EVK.

Here's the output:

PCScrypt - CMSIS-DAP firmware programming script v2.1.2 Nov 2020.

Connect an LPC-Link2 or LPCXpresso V2/V3 Board via USB then press Space.

CMSIS-DAP firmware successfully programmed to flash.

LPCXpresso V2/V3 programmed with LPC432x_IAP_CMSIS_DAP_V5_361.bin and has the uniqueID: MQA0BQGQ
- To use: remove DFU link and reboot the board

Connect next board then press Space (or <return> to Quit)


-To use: remove DFU link and reboot the board

Edit: after following the "Restore Factory Debug Firmware" from https://mcuoneclipse.com/2021/04/05/debug-firmware-switching-for-the-lpc4322/ I'm now back to it showing up as an MIMXRT1060-EVKB. I'll just continue with this, and just update to the MIMXRT1040-EVK version when it's put onto the website

For reference:

  1. Put in DFU mode
  2. Run boot_lpcscrypt
  3. Run lpcscrypt program lpc4322_bl_crc.bin BANKA
  4. Boot in normal mode
  5. Now it should show up as before and I could drag and drop the FW into in in "Files"

0 Kudos
Reply
3,014 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @MulattoKid ,

  Please check private message, I already share RT1040 opensda bl to you.

  In the near future, it will upload to the :

 

www.nxp.com/opensda

 

Best Regards,

Kerry

2,997 Views
MulattoKid
Contributor IV

Great, thank you!

0 Kudos
Reply
2,994 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @MulattoKid ,

  You are always welcome!

  If you meet any new issues, welcome to create the new case and let me know.

Best Regards,

kerry

2,914 Views
MulattoKid
Contributor IV

Great, thanks for the update and your support!

0 Kudos
Reply
2,820 Views
kerryzhou
NXP TechSupport
NXP TechSupport

you are welcome!

0 Kudos
Reply
3,164 Views
MulattoKid
Contributor IV

Hi @kerryzhou,

Yes, I had to do a few extra steps (see accepted solution), but that was basically the issue.

Thanks,
Daniel

3,174 Views
MulattoKid
Contributor IV

I found a solution to the problem.

  1. Follow RT board recovery for debugger connect issues
    1. Note that you most likely need to select "UART" instead of "USB" as the connection to the board
    2. Follow the rest of the instructions, and erase the flash
  2. It was the Zephyr HelloWorld sample that I think put me in this situation, so I instead built a different sample that doesn't just exit, but instead runs in a loop, Zephyr Blinky
  3. Then, using the same tool as before, I go to the "Build image" tab, open the built binary as the source, and build it
  4. Next, select the "Write image" tab, open the *_nopadding.bin file that was just built (it's inside the workspace directory), and write it
  5. Unplug the board, and put the DIP switches back to "Internal boot" mode, and plug the board back in
    1. Opening a serial terminal I can see it's running the sample as it's printing "LED ON", "LED OFF"
  6. Now, I can start a GDB server through LinkServer, and flash and debug the same binary (not the *_nopadding version) through Cortex-Debug

 

3,178 Views
MulattoKid
Contributor IV

I've also tried following RT board recovery for debugger connect issues  but the device isn't detected when connected over USB.

Edit: the MCUXpresso Secure Provisioning tool is able to erase the flash when I select UART instead of USB, but the main problem still persists.

0 Kudos
Reply
3,183 Views
MulattoKid
Contributor IV

I thought I'd try to erase the flash using LinkServer, but that also doesn't work:

 

 

daniel@daniel-XPS-15-9530:~$ /usr/local/LinkServer/LinkServer flash MIMXRT1042xxxxB:MIMXRT1040-EVK erase
INFO: Exact match for MIMXRT1042xxxxB:MIMXRT1040-EVK found
INFO: Selected device MIMXRT1042xxxxB:MIMXRT1040-EVK
INFO: Getting available probes
INFO: Selected probe #1 022900003ac6651a00000000000000000000000097969905 (DAPLink CMSIS-DAP)
Ns: MCUXpresso IDE RedlinkMulti Driver v11.8 (Oct 16 2023 13:16:42 - crt_emu_cm_redlink build 8)
Pc: (  0) Reading remote configuration
Wc(03). No cache support.
Nc: Found chip XML file in /tmp/tmp1smyty2t/MIMXRT1042xxxxB.xml
Pc: (  5) Remote configuration complete
Nc: Reconnected to existing LinkServer process.
Nc: Connecting to probe 1 core 0 (using server started externally) reports:
    'Ee(42). Could not connect to core.'
Nc: Retrying...
Nc: Reconnected to existing LinkServer process.
Nc: Server OK but no connection to probe 1 core 0 (after 3 attempts) - Ee(42). Could not connect to core.
Wc: ============= SCRIPT: RT1040_connect.scp =============
Wc: RT1040 Connect Script
Wc: Error: Wire Ack Fault - target connected?
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Disabling MPU
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Configure FlexRAM for 256KB OC RAM, 128KB I-TCM, 128KB D-TCM
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Error: Wire not connected
Wc: Finished
Wc: ============= END SCRIPT =============================
Ed:02: Failed on connect: Ee(42). Could not connect to core.
Et:31: No connection to chip's debug port
Pc: (100) Target Connection Failed
CRITICAL: Critical error
ERRMSG: subprocess.CalledProcessError: Command '['/usr/local/LinkServer_1.3.15/binaries/crt_emu_cm_redlink', '--redlink-port', '11111', '--flash-dir', '/usr/local/LinkServer_1.3.15/binaries/Flash', '-x', '/tmp/tmp1smyty2t', '-pMIMXRT1042xxxxB', '--vendor', 'NXP', '-g', '--cache', 'dis', '--probeserial', '022900003ac6651a00000000000000000000000097969905', '--coreindex', '0', '--no-packed', '--connectscript', 'RT1040_connect.scp', '--flash-mass-erase']' returned non-zero exit status 1.

 

 

0 Kudos
Reply