Forum Discussion

Balerion's avatar
Balerion
Icon for Occasional Contributor rankOccasional Contributor
3 months ago
Solved

Nios-V C++ Debug Problem

Hi all,

I am trying to debug a simple nios-v C++ app but I am getting an error while debugging. The problem is when I create a project with the following commands

niosv-bsp -c -p=niosv.qpf -s=niosv.qsys -t=hal software/bsp/settings.bsp

niosv-app -b=software/bsp -a=software/app -s=software/app/hello.cpp

it gives an error as "Launching app Default has encountered a problem. Error in services launch sequence GDB prompt not read." However, when I execute the following commands to create a project

niosv-bsp -c -p=niosv.qpf -s=niosv.qsys -t=hal software/bsp/settings.bsp

niosv-app -b=software/bsp -a=software/app -s=software/app/hello.c

I can debug it without a problem.

Could you please help me about how to debug a cpp application?

Thanks, Balerion



  • Hi Balerion,

    Our team have contacted with Ashling, and they have provided the solution to this issue. The latest Ashling* RiscFree* IDE v25.2.1 (version dated 09 May 2025) have resolved this issue.

    You may download it separately from Quartus® Prime Pro Edition Installer for software version 25.1.1 download link.

    1. Click on the link.
    2. Select your Operating System.
    3. Download and launch the Installer.
    4. Select and install these only:
    • Add-ons and Standalone Software > Ashling* RiscFree* IDE for Altera
    • Add-ons and Standalone Software > Quartus® Prime Pro Edition Programmer and Tools

     

    And use it with your Quartus® Prime Pro Edition software version 24.3.

    Note: Refrain from using the 25.3 installer. It is just discovered that it is packaged with an older RiscFree IDE (version dated 31st Jan 2025). Which still have this C++ debug issue. 

    Regards,
    Liang Yu

13 Replies

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi Balerion

    Please let me know if the provided solution resolves your issue.

    Regards
    tehjingy

    • Balerion's avatar
      Balerion
      Icon for Occasional Contributor rankOccasional Contributor

      Hi,
      The problem seems solved in Quartus 25.1.1 Pro. I tried to debug a simple C++ project and I am able to do it. However, It still exists in Quartus 25.3 Pro. What I don't understand is that the change you guys made in 25.1.1 will not be applied from that version on to newer versions? or it will be specific to this one? If so, we will not be able to use other version than 25.1.1 Pro?

      Thanks,
      Balerion

      • tehjingy_Altera's avatar
        tehjingy_Altera
        Icon for Regular Contributor rankRegular Contributor

        Dear Customer,

        Since a solution is provided and no further clarification is needed on this thread, it will be transitioned to community support for further help on doubts in this thread. 
        Please login to the Altera Community Forum and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.
        Thank you for the questions and as always pleasure having you here.

        Best Wishes
        Altera Tech Support

  • Hi Balerion,

    I spoke with a colleague and there is apparently a known issue in the Ashling Debugger for C++. As a work around, could you rename the file to .c but then in your CMAKE set the file property to set the language to C++?

    • Balerion's avatar
      Balerion
      Icon for Occasional Contributor rankOccasional Contributor

      Hi again,

      I tried what you said but it still didn't work. I will be adding the files that I am trying. Could you please tell me what to change in my CMakeLists.txt. I added the lines below.

      set_source_files_properties(
      main.c
      PROPERTIES LANGUAGE CXX
      )

      *********************************************************

      #include "MyCls.h"
      void MyCls::MyPrintf()
      {
      printf("HELLO FROM PRINTF\n");
      std::cout << "HELLO FROM COUT" << std::endl;
      }
      NOTE: I tried to add MyCls.cpp to the attachment but it didn't allow me to do so I added here

      Thanks,

      Balerion

      • LiangYuGooi's avatar
        LiangYuGooi
        Icon for New Contributor rankNew Contributor

        Hi Balerion,

        Our team have contacted with Ashling, and they have provided the solution to this issue. The latest Ashling* RiscFree* IDE v25.2.1 (version dated 09 May 2025) have resolved this issue.

        You may download it separately from Quartus® Prime Pro Edition Installer for software version 25.1.1 download link.

        1. Click on the link.
        2. Select your Operating System.
        3. Download and launch the Installer.
        4. Select and install these only:
        • Add-ons and Standalone Software > Ashling* RiscFree* IDE for Altera
        • Add-ons and Standalone Software > Quartus® Prime Pro Edition Programmer and Tools

         

        And use it with your Quartus® Prime Pro Edition software version 24.3.

        Note: Refrain from using the 25.3 installer. It is just discovered that it is packaged with an older RiscFree IDE (version dated 31st Jan 2025). Which still have this C++ debug issue. 

        Regards,
        Liang Yu

  • Hi Balerion,

    Sorry for the delay in getting back to you.

    Thanks for confirming you were able to generate the ELF for both your projects. I've asked a colleague Nios V team to help join us on this issue to debug this further.

  • Balerion's avatar
    Balerion
    Icon for Occasional Contributor rankOccasional Contributor

    Hi,

    Any news? I couldn't find anything. I just couldn't debug a cpp project and no idea about how to solve it.

  • Hi Balerion,

    Can you confirm that when you build your C++ App it has compiled correctly to generate an .elf and .hex file? Here I'm just looking to confirm that your CMake file correctly identifies c++ as the language, but also that your settings.bsp file was configured to enable c++.

    Thanks.

    • Balerion's avatar
      Balerion
      Icon for Occasional Contributor rankOccasional Contributor

      Hi,

      I just verified that my .elf file and .out file generated successfully. It says "Build Finished. 0 errors, 0 warnings. (took 10s.598ms). İt didn't generate .hex by default. It generated a .out and a .elf file.

      Thanks, Balerion

  • Balerion's avatar
    Balerion
    Icon for Occasional Contributor rankOccasional Contributor

    Hi,

    I am using Quartus 24.3 Pro and Windows 10. I added some ss to the attachment. The first one c.png shows the app project that is created with niosv-app command and hello.c. It is working I can debug it. However the second one cpp.png is not working I am not able to debug it. I created that with same command niosv-app but the source file was hello.cpp. I need to debug a cpp project. Could you please help me?

    Thanks,

    Balerion

      

  • Hi Balerion,

    Sorry to hear you are having issues. Can you help provide me some additional details?

    What version of Quartus are you using?

    What OS are you using?

    Does the error occur when you are running niosv-app, or is it from the debugger?