[SOLVED] Can't use J-Link with SW4STM32

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

  • [SOLVED] Can't use J-Link with SW4STM32

    I'm taking a Udemy course on using SystemView to debug FreeRTOS programs. Thank you for making a free version of SystemView for educational use! It is an awesome program! I hope one day to be able to order the commercial versions of your software.

    I first modified my STM32F446RE-Nucleo board using your ST-Link Reflash Utility. Thank you for that also! It took several tries but once it worked, I was able to examine my project using SystemView. What an awesome tool!

    Now I want to continue the course and of course I need to modify and then debug the C code in my project. I am using SW4STM32. The instructor wants us to restore my Nucleo board back to ST-Link in order to make changes and debug using breakpoints. And then refresh it back to J-Link to analyze with SystemView. I hope that rather than switch back and forth between J-Link and ST-Link that I can find a way to flash and debug using SW4STM32 with my Nucleo board flashed as J-Link.

    So I found this article on your web site:
    SystemWorkbench

    My versions of eclipse and sw4stm32 are slightly newer than when you wrote the article and some of the settings are in different places, but I was able to make all the configuration changes shown in your article. However it does not work. Every time I try to debug, Eclipse returns and error: Error while launching command: gdb --version

    Do you have any suggestions on how I can fix this?

    For the time being I really want to continue using SW4STM32. Would purchasing a J-Link EDU solve the problem? I am afraid the problem is some software incompatibility between SW4STM32 and J-Link. Or possibly a configuration issue. In either case I am afraid the purchasing a J-Link EDU would not solve the problem.

    In the event you cannot help me, I do have some other options I'd like to get your opinion on:

    Options to prevent having to switch the Nucleo board back and forth between ST-Link and J-Link:

    1. Purchase a J-Link EDU. Use it for SystemView. Configure the Nucleo board for ST-Link. Use SW4STM32 to build, flash and debug (set breakpoints, examine memory, etc). I hope I could keep both the Nucleo board ST-Link and the J-Link EDU plugged into my computer and that the various software would automatically use the proper USB connection. Will this work?

    2. Configure the Nucleo board for J-Link. Use SEGGER Embedded Studio for development, flashing, and debugging. I am not yet and experienced embedded programmer and I'm a little worried about porting my code from SW4STM32 to Embedded Studio.

    3. Configure the Nucleo board for J-Link. Use SW4STM32 for development and building only. Use Ozone for debugging.

    Do you have any thoughts on these options?

    Thank you for helping me. I am really impressed with your tools. I want to purchase a J-Link EDU so I hope you are able to reassure me that one of these solutions will be easy to implement using it.

    Clark Sann
  • Hi Clark,

    Thank you for your inquiry.
    Little reminder, the free SystemView version can also be used commercially for free!
    The Pro version simply comes with some additional features but for the base functions no extra license needed.

    Now regarding the debugging in SW4. Currently we do not have a guide online explaining how to use the GNU MCU Eclipse plugin with it or if it is even possible.
    But the principle setup is always similar in Eclipse based IDEs.
    a) Install the Plugin
    b) Set JLinkGDBServer Path
    c) Create debug config and set target device
    d) Start debugging
    Once we got more information about this our website will be updated.

    Anyhow I find it weird that you got asked to switch back to the inferior ST-Link FW.
    As an alternative I would like to introduce to you our lightweight debugger Ozone:
    segger.com/products/development-tools/ozone-j-link-debugger/
    It can be used for free for educational purposes and works mutli platform with any IDE output.
    So the idea is that you can keep using SW4 for project management and building but debugging is then done in Ozone with all and more features you usually get in an IDE.

    Also If you are looking to use a professional IDE to get a better feel on what is used later in the embedded industry I can recommend our IDE Embedded Studio:
    segger.com/products/development-tools/embedded-studio/


    Again it can be used for free for educational and private purposes. Works multi platform and comes with an extensive CPU support package and Board support package library so you can have complex project ready to go with one button press.

    Additionally our Embedded Studio PRO packages can also be used for free for education so you can use all our professional embedded libraries with more than 25 years of experience (USB stack, IP Stack, RTOS, Filesystem, Display drivers etc.etc.) in your projects so you can focus on creating great software instead of trying to fix your hardware stacks and RTOS hiccups ;)


    May out sponsoring team contact you via e-mail? I have the feeling that your course in in dire need of some professional tools and we would like to make that happen ;)
    Edit: Uups just noticed that Udemy is no university or similar. Sorry for the confusion. The above tips for you still stand though ;)

    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.
  • Thank you Nino for your helpful reply. I've ported my project from AC6 into SES. I've found that SES lacks several features I've grown accustomed to in Eclipse, but I still really like it.

    I especially like that I can use your Embedded Studio Pro tools for my private projects. Outstanding.

    Accordingly, I've ordered a J-Link probe. I can't wait for it to arrive.

    One last question, how do you compare debugging in SES vs Ozone?
  • Hi Clark,


    ClarkS wrote:

    I've found that SES lacks several features I've grown accustomed to in Eclipse, but I still really like it.
    Could you elaborate what features are missing? We would like to improve our software where possible.


    ClarkS wrote:

    One last question, how do you compare debugging in SES vs Ozone?
    Not sure if I understand you correctly here, but if you want to know what the differences between the both debuggers are is that Ozone comes with a couple of more advanced features like streaming trace, power profiling and debug automation. But all other debug features you find in SES you will find in Ozone and vice versa.

    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.
  • Nino,

    Here are some of the IDE features I miss from Eclipse:

    1. Cannot setup project folder structure using my file manager (Finder in my case). In Eclipse I can use Finder to copy folders and files into the project and then command Eclipse to Refresh. Eclipse then sees the added folders and files. This makes it very easy to add, especially with nested folders. In SES I had to add each folder separately.

    2. Cannot collapse / expand parts of the program - functions, loops, etc

    3. Cannot split a screen so as to be able to look at the top of a long file at the same time I am viewing part of the bottom of the same long file.

    4. Cannot rename a project.

    There may be other things that I have forgotten or haven't noticed yet. Right now my plan is to continue working in SES. If I find any other suggestions should I update this list or create a new thread?

    I would really like to be able to right click on a folder and then provide an option to have that folder added to the include path list. Eclipse doesn't do this either but I wish it did.

    Nino, I am also having problems integrating SystemView into my FreeRTOS program. I was able to do this in Eclipse but I can't get it to work in SES. I think it's because SES already has some RTT files and this is causing a conflict. I think after I play with it a bit more that I should create a new thread for this subject.

    Best to you...

    Clark

    The post was edited 1 time, last by ClarkS ().

  • Hello Clark,

    Thank you for your feedback.

    1: The same works in ES but also even better as we have a virtual folder structure so you can have any folder tree in your project that you want independent of your harddrive structure. But you can mimic this as well.
    You can add whole folders by simply drag and dropping them into your project explorer and if you have set up a dynamic virtual folder it will even update automatically if you drop in new sources with your file manager.
    More information about this can be found in the ES user manual.

    2: We already have this on our wishlist and should be added with a future version.

    3: We will add this to our wishlist as well, however this seems like a rather niche feature, anyhow it sounds interesting so we will discuss it in our next team meeting,

    4: Sure you can, see picture attached. Or double click on the project name in project explorer to edit it.


    ClarkS wrote:

    If I find any other suggestions should I update this list or create a new thread?
    For new suggestions better a new thread.


    ClarkS wrote:

    I would really like to be able to right click on a folder and then provide an option to have that folder added to the include path list. Eclipse doesn't do this either but I wish it did.
    Will add this to our wishlist as well. Sounds like a useful feature.


    ClarkS wrote:

    Nino, I am also having problems integrating SystemView into my FreeRTOS program. I was able to do this in Eclipse but I can't get it to work in SES. I think it's because SES already has some RTT files and this is causing a conflict. I think after I play with it a bit more that I should create a new thread for this subject.
    Yes, you should make sure to only have one set of RTT data in your project.
    All other information on how to instrument a FreeRTOS program can be found in the SystemView manual.
    Alternatively we can suggest using our RTOS emBOS which will come with the instrumentation out of the box.

    Best regards,
    Nino
    Images
    • Capture.PNG

      30.19 kB, 504×619, viewed 467 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.
  • SEGGER - Nino wrote:

    1: The same works in ES but also even better as we have a virtual folder structure so you can have any folder tree in your project that you want independent of your harddrive structure. But you can mimic this as well.
    You can add whole folders by simply drag and dropping them into your project explorer and if you have set up a dynamic virtual folder it will even update automatically if you drop in new sources with your file manager.
    More information about this can be found in the ES user manual.
    Nino, I cannot get this to work. When I try to copy either a file, a folder, or a folder structure from MacOS Finder to the Project Explorer, it does not add the file or folder(s), instead it adds a link with the title id=[some number].[some number]. Importing only causes an error. I am on MacOS Mojave. Is this a bug?

    Thank you for the project renaming tip. It works great.

    I have removed the duplicate RTT files in my FreeRTOS project but it still has a lot of warnings and won't work properly. These warnings are caused because there are duplicate definitions in freeRTOS.h and in SEGGER_SYSVIEW_FreeRTOS.h. It seems that freeRTOS.h is being built first and then SEGGER_SYSVIEW_FreeRTOS.h. The SEGGER file redefines macros created in the FreeRTOS file.

    I have created a new thread in the SES forum for this problem but so far no one has responded to it. In the future I will try to use emBOS but for now I need to use FreeRTOS for a class I am taking. It seems to me that the instructions in the SystemView manual do not work for SES. The other thread has much more information in it.

    Again, thanks for your help. I must say I am becoming more excited about using SystemView and SES in my future projects. Hopefully one day, I will be able to purchase paid versions of your tools.

    The post was edited 1 time, last by ClarkS ().

  • Hello,

    ClarkS wrote:

    Nino, I cannot get this to work. When I try to copy either a file, a folder, or a folder structure from MacOS Finder to the Project Explorer, it does not add the file or folder(s), instead it adds a link with the title id=[some number].[some number]. Importing only causes an error. I am on MacOS Mojave. Is this a bug?
    This is indeed a bug which will be fixed. You can also create dynamic folders manually by creating a new folder and editing its preferences.


    ClarkS wrote:

    I have created a new thread in the SES forum for this problem but so far no one has responded to it. In the future I will try to use emBOS but for now I need to use FreeRTOS for a class I am taking. It seems to me that the instructions in the SystemView manual do not work for SES. The other thread has much more information in it.
    OK I will take a look at it.


    ClarkS wrote:

    Again, thanks for your help. I must say I am becoming more excited about using SystemView and SES in my future projects. Hopefully one day, I will be able to purchase paid versions of your tools.
    Great to hear. Have fun coding!

    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.