[SOLVED] Specific J-Link selection on per-user basis

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Specific J-Link selection on per-user basis

    Currently, a specific J-Link can be defined in the .jdebug file (by its serial number).

    This isn't particularly useful for a project shared between team members - as different people are likely to have their "own" J-Link(s).

    So is it possible to specify a J-Link (by serial number) in the .jdebug.user file?

    If so, how?

    If not, can this be considered a feature request?
  • Actually, the J-Link serial number doesn't seem to be getting saved to the project at all:



    I press 'Save to Project', and the following appears in the console:

    Source Code

    1. Tools.JLinkSettings();
    2. J-Link settings were written to the project file.

    but the serial number is not added to the .jdebug project file, and there's nothing in the .jdebug.user either.

    There is this in the .jdebug project file:

    Source Code

    1. void OnProjectLoad (void) {
    2. //
    3. // Dialog-generated settings
    4. //
    5. Project.SetDevice ("STM32L072CZ");
    6. Project.SetHostIF ("USB", "");
    7. Project.SetTargetIF ("SWD");
    8. Project.SetTIFSpeed ("4 MHz");

    Presumably, the J-Link Serial Number should appear as the 2nd argument to Project.SetHostIF() ?
  • Hello,

    Thank you for your inquiry.
    The prompt should only appear if more that 1 J-Link are detected to be connected to the host PC.
    Is this a common occurrence with you and your colleagues?


    awneil wrote:

    but the serial number is not added to the .jdebug project file, and there's nothing in the .jdebug.user either.
    Yes, because you need to select the J-Link you want. Right now it defaults to USB which will open the prompt if more than 1 are connected or chose the single J-Link.
    Press the three dots next to USB. It will list all J-Links on your host PC and your network. Simply slelect the one you want and it will be saved in your Ozone project.

    Our current recommendation for setups with multiple J-Link S/N per PC and multiple host PCs we recommend to use Ozones command line capabilities.
    See Ozone manual for more details.
    You can call Ozone with -usb <S/N> and Ozone will open the last project with your J-Link selected.

    Does that work for you?

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • SEGGER - Nino wrote:

    The prompt should only appear if more that 1 J-Link are detected to be connected to the host PC.
    Yes, that is the case


    SEGGER - Nino wrote:

    Is this a common occurrence with you and your colleagues
    Yes: it's a radio system, with a transmitter and a receiver.


    SEGGER - Nino wrote:

    Simply slelect the one you want
    I do that


    SEGGER - Nino wrote:

    and it will be saved in your Ozone project
    but it doesn't do that.



    SEGGER - Nino wrote:

    You can call Ozone with -usb <S/N> and Ozone will open the last project with your J-Link selected
    It's a workaround.

    I still think it would be nicer to have it in the per-user setup file
  • Hello,

    awneil wrote:

    but it doesn't do that.
    Ok that is odd. Works flawlessly for me for years.
    Could you provide a short clip on how you try to do this?


    awneil wrote:

    It's a workaround.

    I still think it would be nicer to have it in the per-user setup file
    It is more than a workaround.
    It provides a simple solution to exactly the setup prerequisites that you described.

    Where is the difference to have a Ozone launch script e.g. in Python where you call in one line Ozone with the CL parameter and some config/user file which you have to drag with your project to set your custom serial number?
    It is exactly the same effort. But the launch script has the benefit that the chance that one of your colleagues forgets to input his S/N is lower as there is a specific file that needs to be used to launch the session.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • SEGGER - Nino wrote:

    Where is the difference
    Ozone always creates the .user file anyhow - so there is no user effort to create it.

    It would just take the setting from the standard dialogue, so no need to transcribe the serial number and mess about in some other tool to create a "script" of some sort - which would, itself, have to be "dragged about".

    Also, I think (but haven't tried) that the .user file would be portable between Windows, Linux, etc - which a "script" wouldn't be ?


    SEGGER - Nino wrote:

    Works flawlessly for me for years.
    Could you provide a short clip on how you try to do this?
    could it be that I am using on-board ST-Links which have been converted to J-Link - is there some restriction related to the free conversion?
  • Hello,

    I feel that there is a misunderstanding here.
    Ozone already has that feature (ignore all the command line stuff and scripts).
    You can already save in your Ozone .jdebug file which J-Link to use based on the serial number.

    It is simply that for some reason you can't get that to work. Correct?

    Could you try the following?
    1. Open your Ozone project in Ozone.
    2. Go to Tools->J-Link Settings, this should yield picture A below.
    3. Select the three dots for the host interface settings (red circle in A).
    4. You should see now something similar to picture B just with your own J-Link probes and serial numbers.
    5. Now select the J-Link you want to link permanently to this project in your setup with your moues (picture C) or type the Serial No. field manually.
    6. Press OK.
    7. Save to Project.
    8. Now if you start the debug session the correct J-Link will be automatically used and no pop-up will appear. If you open the .jdebug file you can also see the following entry: Project.SetHostIF ("USB", "777038855");

    Alternatively you can simply open the .jdebug file in any text editor and edit Project.SetHostIF() yourself.

    Can you confirm that this works?

    Best regards,
    Nino
    Images
    • A.png

      8.96 kB, 338×246, viewed 183 times
    • C.png

      12.94 kB, 622×452, viewed 187 times
    • B.png

      12.45 kB, 622×452, viewed 176 times
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • So what I was doing was opening Tools->J-Link Settings:



    seeing that it already had the correct Serial number, I just clicked 'Save to Project' - and that doesn't add the current Serial number to the Project.
    in the Console, it says:

    Source Code

    1. Tools.JLinkSettings();
    2. J-Link settings were written to the project file.


    But if I do choose the '...' for 'Host Interface', select the required Serial number, and then do 'Save to Project' - it is, indeed, saved.
    in the Console, it says:

    Source Code

    1. Tools.JLinkSettings();
    2. J-Link settings were written to the project
    3. file.Project.SetHostIF ("USB", "777578294");