Wednesday, November 22nd 2017, 11:09pm 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.

v01d

Beginner

Date of registration: Feb 29th 2016

Posts: 37

1

Thursday, September 28th 2017, 6:29pm

[SOLVED] J-Link script file documentation

Gotta question about the documentation of the script files.

One thing is: where are the return codes / values documented for the Actions that can be customized?

E.g. prototype int ResetTarget(void). The doc (UM08001_JLink) does not have info on what this should return, or any of the Actions.

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

2

Friday, September 29th 2017, 3:59pm

Hi,


Quoted

The doc (UM08001_JLink) does not have info on what this should return, or any of the Actions.

Thanks for pointing that out.
return values for all J-Link script file functions are:

C/C++ Source code

1
2
<  0 error
>= 0 O.K.

We will update the documentation accordingly.


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: 37

3

Sunday, October 1st 2017, 3:37am

Hi Niklas,

What about the actions by the DLL or the caller of the customized J-Link scripts when return status is error?
Will they (or should ..) abort process, or not?

I tried returning different returns from ResetTarget() (which I've seen in one Segger example returns void for some reason ..) , and I don't
see that doing much difference.

Also, do the return values you posted apply to all of the Script file API functions? (5.12.2 / p 163)

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

4

Monday, October 2nd 2017, 10:39am

Hi,

Quoted

What about the actions by the DLL or the caller of the customized J-Link scripts when return status is error?
Will they (or should ..) abort process, or not?

I need to check with engineering on this.
Some should definitely fail, like InitTarget().

I am not sure about ResetTarget(), on some target devices, the reset does not work reliably, therefore aborting after one fail would not be good.
Needs to be discussed if ResetTarget() aborts after multiple fails or not at all.

Quoted

(which I've seen in one Segger example returns void for some reason ..)

They all all used to returned void. In order to not break old scripts, this still works.
Can you point me to the example?

Quoted

Also, do the return values you posted apply to all of the Script file API functions?

C/C++ Source code

1
2
<  0 error
>= 0 O.K.

Is the default, but does not apply for all functions.
The documentation needs to be updated, e.g.

C/C++ Source code

1
2
3
4
JLINK_JTAG_GetU32()
// Gets 32 bits JTAG data, starting at given bit position.
// Prototype
int JLINK_JTAG_GetU32(int BitPos);


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: 37

5

Monday, October 2nd 2017, 2:25pm

Quoted

They all all used to returned void. In order to not break old scripts, this still works. Can you point me to the example?
You can actually look into iMX7D default installation scripts, they all have void ResetTarget().. I tried modifying one to an int ResetTarget() and returning a non-good value, but saw no effect ..

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

6

Wednesday, October 11th 2017, 4:39pm

Hi,


the next version of the J-Link software comes with an updated documentation on the script file functions.
New functions and the return values of all existing functions have been added to the documentation.

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