Monday, December 11th 2017, 1:00am 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.

djregan42

Beginner

Date of registration: Sep 9th 2017

Posts: 7

Location: Waukon, IA USA

Occupation: Software Engineer

1

Monday, December 4th 2017, 5:18pm

[SOLVED] Using Segger GDBServer with mx6ull EVK, and getting message: "Unable to start core"...

Hello,

We are developing with a NXP mx6ull evk (has IMX6ULL processor), and attempting to perform some 'bare metal' development with the Segger JLink Plus.

NXP supports such development with a SDK called 'SDK_2.2_MCIM6ULL', which can be downloaded from NXP's site here...
https://www.nxp.com/webapp/Download?colC…e&location=null

Folks following instructions from this SDK are given instructions for installing required toolchains are provided within this download at path:
'\SDK_2.2_MCIM6ULL\docs\Getting Started with MCUXpresso SDK for i.MX 6ULL Derivatives.pdf'.

After successfully installing the armgcc toolchain path -> we are getting a message from Segger's "JLinkGDBServer.exe"... where we observe failure to start the core, with exact message through the GDB server console: "ERROR: Could not start CPU core. (ErrorCode: -1)".


And so, my question is... Has anyone else observed issues initiating a "monitor go" response through the GDB Server console?

Other information...
- Demo app being tested is ''\SDK_2.2_MCIM6ULL\boards\evkmcimx6ull\demo_apps\hello_world\"
- From 'GNU ARM Embedded Toolchain in Launchpad' we are using the latest version build '5.4 2016q3'.
- The full GDB server console session is attached (see file: 'gdb_debug_hello_world.elf.txt'.
- The 'hello_world.elf' file resulting from executing the 'build_ddr_debug.bat' is in attached file 'hello_world.zip'.

Thoughts? Troubleshooting ideas?

Thanks much,
--DJ Regan
djregan42 has attached the following file:

This post has been edited 2 times, last edit by "djregan42" (Dec 4th 2017, 5:20pm)


djregan42

Beginner

Date of registration: Sep 9th 2017

Posts: 7

Location: Waukon, IA USA

Occupation: Software Engineer

2

Tuesday, December 5th 2017, 1:05am

Cannot execute monitor reset command after JlinkGDBServer is invoked...

All, FYI...


I have found a sequence of steps that allows the program to execute successfully...


While following 'Getting Started with MCUXpresso SDK for i.MX 6ULL Derivatives.pdf'...
It it is necessary to skip steps 9.b, 9.c (do not use 'monitor reset' and 'monitor halt' during the gdb environment startup procedure). It seems as though command 'monitor reset' is clearing out initialization that was established by the necessary jlinkscriptfile


See attached file 'do not execute step 9b.png'.



Running steps: 9 a., 9.d, 9.e (skip steps 9.b, 9.c) results in program execution success.

Regards,
--DJ Regan

This post has been edited 4 times, last edit by "djregan42" (Dec 5th 2017, 1:12am)


SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 430

3

Tuesday, December 5th 2017, 9:32am

Hello,

Thank you for your inquiry.

Generally we recommend to do a reset before programming as the MCU could be in a state where connections are not allowed or similar.
In this case it worked out it seems but in many other cases it can lead to unpredictable behaviour.
As you correctly assumed the reset command clears any active initialization and puts the MCU back to reset values.
This is the behaviour 99% of our customers expect.
So all you need to do is edit your JLinkScript and put your init steps in the AfterResetTarget() function described in the J-Link User Manual.
That way your peripheral init gets executed again after each reset.
I assume the JLinkScript that comes with the imx SDK uses InitTarget() or SetupTarget() which are called before reset in that scenario.

Best regards,
Nino

djregan42

Beginner

Date of registration: Sep 9th 2017

Posts: 7

Location: Waukon, IA USA

Occupation: Software Engineer

4

Tuesday, December 5th 2017, 5:38pm

Need to use AfterResetTarget() inside the jlinkscript file...

Hi Nino,

Thanks much for your reply. I agree... it would be better to allow reset to guide the system back to a known state.

I added this function definition to my script (attachment named 'ddr_init.jlinkscript')...
int AfterResetTarget(void) {
Report("'AfterResetTarget': Re-initializing...");
Clock_Init();
DDR_Init();
Report("'AfterResetTarget': Re-Initialized.");
}

ddr_init.jlinkscript

Although I do not observe the 'Report()' calls generating JLinkGDBServer console log messages... it does appear clock and DDR re-initialization procedures are getting called, as the program is allowed to be run successfully despite use of 'monitor reset' command from GDB.

I appreciate it Nino!

Thanks much,
--DJ Regan

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 430

5

Wednesday, December 6th 2017, 9:07am

Hello,

Great to hear that you are up and running again.
I could not find any reference to the function Report() but there is one for JLINK_SYS_Report() in the user manual.
Try to use that instead.

Best regards,
Nino

v01d

Beginner

Date of registration: Feb 29th 2016

Posts: 56

6

Wednesday, December 6th 2017, 12:38pm


I could not find any reference to the function Report() but there is one for JLINK_SYS_Report() in the user manual.


Best regards,
Nino

Try this from Segger's Linux install :
grep -rn Report /opt/SEGGER/JLink/Devices/


many scripts use "Report".

Also saw that you can looks like drop the "JLINK_" prefix entirely : e.g.: MEM_WriteU32 works without it fine.

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 430

7

Thursday, December 7th 2017, 11:03am

Hi,

Yes I see that now, thanks for pointing it out.
We will look into improving documentation in that regard.

As the original question has been this thread will be treated as solved now.

Best regards,
Nino