Tuesday, November 21st 2017, 3:00pm UTC+1

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.

Tcer

Beginner

Date of registration: Jul 22nd 2017

Posts: 3

1

Tuesday, August 1st 2017, 3:23pm

[SOLVED] J-Link EDU debugging with NXP iMX6Q

Hi, all

I have a J-Link EDU connected to an NXP iMX6Q which has 2G RAM and 16G emmc, but it can't debug program with eclipse.
Becasuse the GDB server always shows following lines after I clicked debug icon.

Downloading 12 bytes @ address 0x00008000 - Verify failed
Downloading 4096 bytes @ address 0x0000800C - Verify failed
Downloading 4096 bytes @ address 0x0000900C - Verify failed
Downloading 108 bytes @ address 0x0000A00C - Verify failed
Downloading 12 bytes @ address 0x0000A078 - Verify failed
Downloading 32 bytes @ address 0x0000A084 - Verify failed
Downloading 8 bytes @ address 0x0000A0A4 - Verify failed
Downloading 4 bytes @ address 0x0000A0AC - Verify failed
Downloading 8 bytes @ address 0x0001A0B0 - Verify failed
Downloading 4 bytes @ address 0x0001A0B8 - Verify failed
Downloading 4 bytes @ address 0x0001A0BC - Verify failed
Downloading 2384 bytes @ address 0x0001A0C0 - Verify failed
Writing register (PC = 0x0000809C)
Writing register (CPSR = 0x800001F3)
WARNING: Failed to read memory @ address 0x0000809C
Received monitor command: clrbp
Received monitor command: reset

I find this development board doesn't support internal flash for user, because 0x0000000~0x00017fff is belong to iROM.
And J-Flash Lite or eclipse can't download elf file to a specified address either.

So,
does it mean that I should buy a JFlash license for EDU or buy a new J-LINK ULTRA+ so that I can download elf file to emmc for debugging ?

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

2

Tuesday, August 1st 2017, 5:28pm

Hi,

In order to narrow down the list of possible causes of this issue:
Could you please give J-Link Commander a try?
J-Link commander is part of the J-Link software package, which is available free of charge here .

  • Start J-Link Commander (jlink.exe)
  • Type "connect" in order to start a debug session
  • Type in the target device name if asked (Or type "?" for a target selection Dialog)
  • Choose the correct target interface (JTAG/SWD/etc..)
  • Use a valid speed (Default: 4000kHz, try 100-500 if default does not work)
  • [JTAG only]JTAG conf can be default(most of the times)
  • You should now be successfully connected.
  • It is now possible to program a binary file via the >loadfile< command (works with .bin/.hex/.srec/.s19/etc. files).
  • The commands >r<, >g<, >h<, >s< can be used for reset, go, halt and step.
  • Breakpoints can be set by using the >setbp< command.
If anything fails, could you please post a screenshot of the complete session?

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

Tcer

Beginner

Date of registration: Jul 22nd 2017

Posts: 3

3

Thursday, August 3rd 2017, 6:05pm

Hi, Niklas


Thanks for your advice, and I had a try yesterday.
The result shows that this simulator works well, all commands go on the right way.
My debug environment is eclipse + J-LINK EDU simulator + J-LINK GDB server.


I check the .elf file and find that VMA is default set as 0x00000000 by linker script.
And the iMX6Q memory map shows address 0x00000000~0x00017fff is read only.
I think it means this board do not have a programmed internal flash.


Since I use J-LINK EDU to debug, it's not available for flash downloading.
So, I started uboot on iMX6Q and changed the VMA to a legal ddr address such as 0x10000000 so that I could download .elf file on ddr via J-LINK and debug.
But it turns out useless, because simulator will reset CPU after download is done.


Now, I am wondering if that I should add licenses for J-LINK EDU or buy another J-LINK ULTRA+ so that I can program on external flash such as emmc.
Do you have some advice about how to program emmc on iMX6Q board ?

Following is the output of J-LINK EDU connecting to iMX6Q :


Connecting to J-Link via USB...O.K.
Firmware: J-Link V10 compiled Jun 16 2017 16:15:19
Hardware version: V10.10
S/N: 260101769
License(s): FlashBP, GDB
OEM: SEGGER-EDU
VTref = 3.270V


Type "connect" to establish a target connection, '?' for help
J-Link>con
Please specify device / core. : CORTEX-A9
Type '?' for selection dialog
Device>
Please specify target interface:
J) JTAG (Default)
S) SWD
TIF>
Device position in JTAG chain (IRPre,DRPre) : -1,-1 => Auto-detect
JTAGConf>
Specify target interface speed [kHz]. : 4000 kHz
Speed>
Device "CORTEX-A9" selected.


Connecting to target via JTAG
TotalIRLen = 13, IRPrint = 0x0101

**************************
WARNING: At least one of the connected devices is not JTAG compliant (IEEE Std 1149.1, 7.1.1.d, IR-cells). (NumDevices = 3, NumBitsSet = 2)

**************************

JTAG chain detection found 3 devices:
#0 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
#1 Id: 0x00000001, IRLen: ?, Unknown device
#2 Id: 0x2191C01D, IRLen: ?, Unknown device
ARM AP[0]: 0x44770001, AHB-AP
ARM AP[1]: 0x24770002, APB-AP
ROMTbl[0][0]: CompAddr: 82141000 CID: B105900D, PID:04-003BB907 ETB
ROMTbl[0][1]: CompAddr: 82142000 CID: B105900D, PID:04-002BB906 ECT / CTI
ROMTbl[0][2]: CompAddr: 82143000 CID: B105900D, PID:04-004BB912 TPIU
ROMTbl[0][3]: CompAddr: 82144000 CID: B105900D, PID:04-001BB908 CSTF
ROMTbl[0][4]: CompAddr: 8214F000 CID: B105100D, PID:04-000BB4A9 ROM Table
ROMTbl[1][0]: CompAddr: 82150000 CID: B105900D, PID:04-000BBC09 Cortex-A9
Found Cortex-A9 r2p10
6 code breakpoints, 4 data breakpoints
Debug architecture ARMv7.0
Data endian: little
Main ID register: 0x412FC09A
I-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
System control register:
Instruction endian: little
Level-1 instruction cache enabled
Level-1 data cache enabled
MMU disabled
Branch prediction enabled
Cortex-A9 identified.
J-Link>

Best regards,
Tcer

This post has been edited 4 times, last edit by "Tcer" (Aug 3rd 2017, 6:31pm)


SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

4

Friday, August 4th 2017, 10:00am

Hi,

Quoted

So, I started uboot on iMX6Q and changed the VMA to a legal ddr address such as 0x10000000 so that I could download .elf file on ddr via J-LINK and debug.
But it turns out useless, because simulator will reset CPU after download is done.

This is not a default behavior of J-Link, therefore the reset is probably issued by eclipse.
Or this also occur via J-Link Commander?

Do you want to give Ozone - The J-Link Debugger a try?
You can build the executable as usual (make sure its located at the correct address) and then use Ozone as a debugger.

Ozone can be used for evaluation purposes free of charge with any J-Link. J-Link Plus or higher ship with a burned-in unlimited license for Ozone.
  • Start Ozone
  • In the startup-dialog, select Create New Project
  • Click on the Button "..." to the right of the Device Box and select your target device (Selecting only the core will only work when debugging in RAM)
  • Click Next
  • Choose the correct target interface (JTAG/SWD/etc..)
  • Use a valid speed (Default: 4000kHz, try 100-500 if default does not work)
  • Click Next
  • Click on the Button "..." in order to select a Data file (the .elf file / .out file/ etc build by the IDE)
  • Click Finish
  • enter Project.SetJLinkScript (<path to scriptfile>) in the console in order to use the J-Link script file
  • Press F5 or click the green on/off button in the left upper corner
  • The debug session should be ready to use
If anything fails, could you please post a screenshot of the complete session, and copy paste the complete contents of the Console window?

Quoted

Now, I am wondering if that I should add licenses for J-LINK EDU or buy another J-LINK ULTRA+

J-Link EDU cannot be extended with additional licenses and may only be used for education and evaluation purposes.
Please note if your using J-Link and/or features like Flash-Breakpoints, J-Flash or Ozone beyond evaluation or education purpose, you need to acquire a J-Link PLUS or higher.

Quoted

[...] so that I can program on external flash such as emmc.
Do you have some advice about how to program emmc on iMX6Q board ?

Programming of the emmc flash memory of the iMX6Q is not supported natively by J-Link, since it is not memory-mapped available.
However, flash programming support can be added via the open flash loader feature of J-Link by following the instructions in this article https://wiki.segger.com/Adding_Support_for_New_Devices and the chapter "Open Flashloader" of UM8001.
You can either implement this yourself or get in touch with support@segger.com regarding a custom order. Please note that this order will come at the cost of NREs and that the management decides if this order would fit in our project schedule, as we are currently quite booked with other projects.



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

Tcer

Beginner

Date of registration: Jul 22nd 2017

Posts: 3

5

Saturday, August 12th 2017, 2:28pm

Hi, Nikals


Thanks for your advice very much !

I find it was eclipse that resets J-LINK as default after downloading *.elf file.
And now I am succeed in debugging IMX6Q when I canceled the option of eclipse.

I check your offical website and find there are so many amazing functions on J-LINK.
But, I am afraid these funcitons might a little expensive for me, since I am just a college student in China who are hardly able to increase the budget on this project.


So, I have to go on with J-LINK EDU, it seems like enough for me now after all.

Anyway, I really appreciate for your help in solving this problem.

Best regards,
Tcer

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

6

Monday, August 14th 2017, 9:25am

Hi Tcer,


Quoted

And now I am succeed in debugging IMX6Q when I canceled the option of eclipse.
I check your offical website and find there are so many amazing functions on J-LINK.

Good to hear that your are up and running again and thanks for the "flowers"!

Quoted

But, I am afraid these funcitons might a little expensive for me, since I am just a college student in China who are hardly able to increase the budget on this project.

Please note that many functions of J-Link can be used free of charge with J-Link EDU, like SystemView:
https://www.segger.com/products/developm…out-systemview/

Quoted

Free tool. No license cost, no hidden fees

and others, like Embedded Studio, come with a free license for non commercial usage e.g. colleges / universities:

https://www.segger.com/products/developm…ercial-license/ :

Quoted


Educational purposes in the context of the non commercial license terms allows using Embedded Studio
  • by students, tutors, teachers, or private individuals
  • in universities, colleges, non-profit organizations, or at home
  • for courses, classes, training, and self-education.


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