How to check for available licenses using command line only

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

    • How to check for available licenses using command line only

      Hi,

      I need to be able to check whether a programming device has J-FLASH license installed, so that I can use the erasechip command in J-FLASH. And I need to do this in command line.
      I can start j-link and then type 'license show' and it will give me a list, which I could parse if I could get as a return string. But I can't see how you run this in the command line and the documentation does not mention anything about this. I can also also see licenses using JLinkLicenseManager.exe but that program apparently doesn't support command line use.

      Can anyone please help?

      Kind regards,
      Christian
    • New

      Hi Christian,
      Thank you for your inquiry.

      You can pass a command script to the J-Link Commander:
      wiki.segger.com/J-Link_Commander#-CommandFile

      The command script could look like this:

      Source Code

      1. License Show
      2. Exit
      Does this work for you?

      Best regards,
      Fabian
      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 you can contact us via our support system: segger.com/ticket/


      Or you can contact us via e-mail.
    • New

      Hi Fabian,
      yes, it does work. Thanks for finding out.

      But, having thought more about this I have come to a conclusion. Parsing of returned strings from a 3rd party device is not a good solution. Yes, you may keep the exact same formatting and license naming - but the principle of having to rely on something that you have no control of should be avoided if possible.

      Let me fill you in with some additional details. We have a NRF52840 device and we can program this using NRF eval boards (comes with an on-board JTAG programmer). These boards are much cheaper than an Ultra+ so some in our team use these eval boards for local NRF work, and we always use the Ultra+ in our test systems and in production.

      The main problem I face is that if there is no JFLASH license present then JFLASH opens a pop-up window that you apparently have to close manually. It would be really nice if I could get JFLASH to just close with an error code. Of course I can opt to kill JFLASH (and spawned child processes if any) if it doesn't complete within 1s. That is simple - but again - this would not be a nice way to go about it.

      So, my question is: Can you get JFLASH to close automatically with an error code if a required license is not present?

      Kind regards,
      Christian
    • New

      Hi Christian,
      Regarding the 3rd party idea:
      Alternatively you could buy the J-Link SDK. It also comes with the samples and the source code of the J-Link Commander.
      The SDK comes with a function to check the available licenses of a probe.

      Regarding J-Flash in batch processing:
      The following article should answer your question.
      wiki.segger.com/UM08003_JFlash#Batch_processing

      Just so I understand your setup correctly:
      You use the J-Link OBs on the nrf52840 evaluation boards to develop your code and use the J-Link Ultra+ for tests and production?

      Best regards,
      Fabian
      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 you can contact us via our support system: segger.com/ticket/


      Or you can contact us via e-mail.
    • New

      Hi Christian,

      To answer your question reg. closing J-Flash with an error code if called with command line parameters, in case no license is found:
      We will think about that in the next team meeting which is scheduled for Tuesday.
      However, I cannot promise anything at this point.


      BR
      Alex