Tuesday, May 22nd 2018, 12:21am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

v01d1

Beginner

Date of registration: May 29th 2017

Posts: 27

1

Tuesday, August 8th 2017, 7:16am

Which device flag to use and how to connect to iMX7 Dual and Solo (using GDBServer) 's M4 core

Hello,

First question which of the -device flags to use for my device? Here are flags I got from Segger's list :

MCIMX7D3_M4

MCIMX7D5_M4

MCIMX7D7_M4



MCIMX7U3_M4

MCIMX7U5_M4


The xDx's must be for iMX7 Dual? But whats the difference between D3 , D5, D7? I have tried all these flags on my iMX7Dual SoM, and Segger's GDBServer fails to connect with same error for all 3 of D flags.


opt/SEGGER/JLink/JLinkGDBServer -device MCIMX7D3_M4
SEGGER J-Link GDB Server V6.18 Command Line Version

JLinkARM.dll V6.18 (DLL compiled Aug 3 2017 16:21:09)

Command line: -device MCIMX7D3_M4
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: yes
Generate logfile: off
Verify download: off
Init regs on start: off
Silent mode: off
Single run mode: off
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: MCIMX7D3_M4
Target interface: JTAG
Target interface speed: 1000kHz
Target endian: little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V10 compiled Jul 28 2017 08:59:01
Hardware: V10.00
S/N: 600000226
Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
Checking target voltage...
Target voltage: 3.33 V
Listening on TCP/IP port 2331
Connecting to target...
J-Link found 1 JTAG device, Total IRLen = 4
JTAG ID: 0x5BA00477 (Cortex-M4)
WARNING: CPU could not be halted
Halting target device failed. Trying again with reset
WARNING: CPU could not be halted
Failed to halt target device on connect
ERROR: Could not connect to target.
Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
Shutting down...
Could not connect to target.
Please check power, connection and settings.

And similarly for D5, D7, only difference is the target device flag , otherwise

The error seems always same:-->
...

JTAG ID: 0x5BA00477 (Cortex-M4)
WARNING: CPU could not be halted
Halting target device failed. Trying again with reset
WARNING: CPU could not be halted
Failed to halt target device on connect
ERROR: Could not connect to target.
.....

Same with my Solo SOM, tried all flags, fails to connect similarly.


Please help

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

2

Tuesday, August 8th 2017, 9:05am

Hi,

for an overview of the IMX device series supported by J-Link, please refer to this wiki article: https://wiki.segger.com/IMX_Series_Devices

Quoted

The xDx's must be for iMX7 Dual? But whats the difference between D3 , D5, D7?

Well, what device / eval board are you using currently?
We use the names defined by NXP.
You can find them on NXPs website: http://www.nxp.com/products/microcontrol…ors:IMX7-SERIES
Just click one of the device series, e.g. "i.MX 7Dual" (link: http://www.nxp.com/products/microcontrol…age_Quality_Tab)
and then switch to the tab Package/Quality in order to see the device names, e.g. the first one listed is "MCIMX7D2DVK12SC"

Beset regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

v01d1

Beginner

Date of registration: May 29th 2017

Posts: 27

3

Wednesday, August 9th 2017, 2:09am

Hello Niklas,

Quoted


Well, what device / eval board are you using currently?
I'm using Toradex's Colibri iMX7D and/or iMX7S (Dual or Solo),
https://www.toradex.com/computer-on-modules/colibri-arm-family/nxp-freescale-imx7, ( it's the 512MB Dual and 256MB Solo versions )
Eval board:
https://www.toradex.com/products/carrier-board/colibri-evaluation-carrier-board



( Vybrid VF61x version works fine with Segger )

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

4

Wednesday, August 9th 2017, 12:54pm

Hi,


it is not possible to connect to the Cortex-M4 of a i.MX7 without enabling it beforehand.
For further information, please refer to https://wiki.segger.com/IMX7D, section M4 Debug Application (Example).

Does this work for you?

Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

v01d1

Beginner

Date of registration: May 29th 2017

Posts: 27

5

Thursday, August 10th 2017, 7:57am

Hi Niklas,

That seems to work as far as I tested (connection to M4 ), but a few things:

Per that wiki you referred to (JLink commander on Linux JLinkExe)
/opt/SEGGER/JLink/JLinkExe -JLinkScriptFile /opt/SEGGER/JLink/Devices/NXP/iMX7D/NXP_iMX7D_Connect_CortexM4.JLinkScript


does not seems to work, the script file is ignored, as far I see because no connection is established, and not even correct target core is selected. For me it was still on A7 from previous steps.

Substituting this with
/opt/SEGGER/JLink/JLinkGDBServer -jlinkscriptfile /opt/SEGGER/JLink/Devices/NXP/iMX7D/NXP_iMX7D_Connect_CortexM4.JLinkScript


Seems to connect to M4 and ready for session, except for this warning I get:
WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.


Is that an issue?

For the Solo version, as I see it is not listed as a supported device for Segger JLink, (no MCIMX7Sxxx anywhere), but it works similar to the Dual version?
I repeated the steps as per your wiki, and managed seems to connect using JLinkGDBServer command as above using same script.

Also I did not get any warnings as above, on T-bit.

However, for Solo version first time I tried to connect to A7, I got this error:
****** Error: Cortex-A/R (connect): Core internal signal DBGEN is not asserted. Debugging is not possible.


After plugging / unplugging (actually swapping with Duo version, then back) the module error went away, but I would want to know how to fix it if it comes back.

I saw someone else had this Segger problem on a different platform: [SOLVED] AM3352 DBGEN is not asserted error
Could you share the solution to that ?

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

6

Monday, August 14th 2017, 10:30am

Hi,

Quoted

/opt/SEGGER/JLink/JLinkExe -JLinkScriptFile /opt/SEGGER/JLink/Devices/NXP/iMX7D/NXP_iMX7D_Connect_CortexM4.JLinkScript
does not seems to work, the script file is ignored, as far I see because no connection is established, and not even correct target core is selected. For me it was still on A7 from previous steps.

The core is specified in the JLinkScript, and the script itself works fine, as you noticed when using J-Link GDB Server.
However, you need to execute the >connect< command in J-Link Commander, the connection to the target device is not established automatically.
You can specify >-autoconnect 1< as a command line parameter in order to connect automatically.

However, specifying the JLinkScript is not necessary at all with current versions of the J-Link software in order to connect to an i.MX7D device series target.
Specifying the correct device name is sufficient for the A7s, but enabling the M4 core before connecting to the M4 core of a i.MX7D series device is still mandatory.

Regarding the iMX7S:
Does the connect work when specifying Cortex-A7 as the target device and not using any script file at all?


Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

v01d1

Beginner

Date of registration: May 29th 2017

Posts: 27

7

Thursday, August 17th 2017, 2:37pm

Hi Niklas,

Quoted

However, specifying the JLinkScript is not necessary at all with current versions of the J-Link software in order to connect to an i.MX7D device series target
Yes but I'm connecting to and using script for the M4 core. Per your wiki you need this to connect to M4 core. And yes I need to script to connect to A7 core.

Quoted

Does the connect work when specifying Cortex-A7 as the target device and not using any script file at all?
I've repeated your steps for iMX7D on iMX7S, so yea first step is to connect to A7 core. And that seems to work.

v01d

Beginner

Date of registration: Feb 29th 2016

Posts: 121

8

Friday, September 22nd 2017, 11:50am

Hi,


You can specify >-autoconnect 1< as a command line parameter in order to connect automatically.

Niklas


There are quite few more options needed for that autoconnect to work:

JLinkExe -device MCIMX7D7_A7_0 -autoconnect 1 -if JTAG -speed 4000 -JTAGConf -1,-1


Then this will try without user input to connect.

v01d

Beginner

Date of registration: Feb 29th 2016

Posts: 121

9

Friday, September 22nd 2017, 12:05pm

Hi,
...
refer to https://wiki.segger.com/IMX7D, section M4 Debug Application (Example).

Niklas,

That procedure leaves A7 core halted by the way. You probably want to immediately restart if after M4 is running.

Also, why is it required to halt A7 core when loading M4? Isn't this odd this will interfere with whatever A7 is doing each time you want to start debugging with new image on M4?

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

10

Friday, September 29th 2017, 4:09pm

Hi,

Quoted

Also, why is it required to halt A7 core when loading M4? Isn't this odd this will interfere with whatever A7 is doing each time you want to start debugging with new image on M4?


That is the way which is recommended and documented by NXP in the linked the app note.

Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

v01d

Beginner

Date of registration: Feb 29th 2016

Posts: 121

11

Monday, October 2nd 2017, 2:30pm

.... That the way which is recommended and documented by NXP in the linked the app note. ...

Hi Niklas,

I have modified that that script the wiki refers to / the default M4 connect script for iMX7 Segger provides, to have customized resets, and now it does not
(in my tests) require preliminary or initial A7 connection. It works straight to M4.

I have sent you personal message with script information, if you could review it please.
v01d has attached the following file:

v01d

Beginner

Date of registration: Feb 29th 2016

Posts: 121

12

Friday, February 9th 2018, 4:18am

Had to fix the script, details in comments.
v01d has attached the following file:

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

13

Tuesday, February 13th 2018, 3:02pm

Hi,

Thank you for providing the script.
Great to hear that you are up and running with it.
Unfortunately we are not able to put this in the official shipment as we are obliged to follow official NXP documentation due to legal reasons.
We will however keep it in this thread if that is fine for you so users will find it when googling for it or using the forum search.
For future archiving this thread will be locked now.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/