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
Solved! Go to Solution.
I found a solution to the problem.
Hi @MulattoKid ,
opensda for the RT1040 already be added to the nxp.com:
Thanks for your contribution.
If you find any issues, just kindly let us know.
Best Regards,
kerry
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:
Best Regards,
kerry
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?
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:
Best Regards,
Kerry
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 boardConnect 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:
Hi @MulattoKid ,
Please check private message, I already share RT1040 opensda bl to you.
In the near future, it will upload to the :
Best Regards,
Kerry
Great, thank you!
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
Great, thanks for the update and your support!
you are welcome!
Hi @kerryzhou,
Yes, I had to do a few extra steps (see accepted solution), but that was basically the issue.
Thanks,
Daniel
I found a solution to the problem.
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.
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.