VisualGDB + IAR compiler

Sysprogs forums Forums VisualGDB VisualGDB + IAR compiler

Tagged: ,

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #567
    Anonymous
    Participant

    Hi! Can I use VisualGDB + IAR compiler for MSP430 devices?

    #2414
    support
    Keymaster

    Unfortunately, IAR compiler generates debugging data in a format that is incompatible with GDB. Thus, VisualGDB cannot debug it.
    However, we could help you switch your project to the GCC toolchain. The toolchain is stable, widely used by community and we can answer your questions on GCC-specific syntax.

    #2419
    LostTime77
    Participant

    As far as I know, IAR for ARM produces ELF files that are in the same exact format as what the gcc toolchain produces. On top of that, you guys already support debugging with Segger Jlink. Many companies use IAR + Jlink. It would be a very awesome feature if you guys supported IAR as well.

    I am not sure if you were responding to his particular post with regards to the MSP430 series, but a huge number of IAR customers use ARM, which produces ELF files from the compiler.

    I for one would buy this product if IAR was supported for ARM.

    #2417
    support
    Keymaster

    Hi,

    Last time we checked, IAR for MSP430 did not support producing ELF files with GDB-compatible symbols. If the ARM version supports it, you should be able to switch from GCC to IAR compiler by simply modfying the makefile generated by VisualGDB. As long as the ELF files are GDB-readable, VisualGDB will automatically support them.

    Please let us know if you need more information on doing that.

    #2418
    LostTime77
    Participant

    Yes, IAR for ARM produces ELF files compatible with GDB. We use the JLink tool from segger, which takes as input our ELF files.

    This would be extremely cool if we could use IAR with visual GDB. I am assuming I am going to have to heavily modify the makefile so that it uses the IAR compiler and puts in the proper command switches. I think that after we produce a few of the make files, it will all just be copy and paste anyways.

    Now, there is only one issue to be resolved. I know for a fact the IAR compiler output is not in gcc format. However, I also understand that in order to populate the warning / error windows in visual studio you need to follow a certain output format for the output strings. If we simply parse the IAR output for strings from the compiler with a build step after running the compiler and put the strings in the proper format, will that populate the error / warning lists? Will we be able to click on an error / warning and be brought to the source file containing the item?

    Thanks

    #2416
    LostTime77
    Participant

    After doing a little more research, it seems like I was correct. All you should need to do is format the compiler output strings in a format visual studio understands, and they will automatically be picked up by the error and warning windows.

    I am going to check out makefile theory, because I am not familiar with them: I am a windows guy 😛

    #2415
    support
    Keymaster

    VisualGDB already does the error message conversion from GCC format to Visual Studio format. It relies on regular expressions do parse the messages. You can override those regular expressions by creating a file called BuildMessageTemplates.xml in the VisualGDB directory with the following content:



    ^([^:]+|[a-zA-Z]:[^:]+|):([0-9]+): (error|fatal error|warning|note|Error):(.*)$
    ^([^:]+|[a-zA-Z]:[^:]+):([0-9]+): (undefined reference to .*)$
    ^([^:]+|[a-zA-Z]:[^:]+):([0-9]+): (multiple definition of .*)$
    ^([^:]+|[a-zA-Z]:[^:]+|[a-zA-Z]:/[^:]+):([0-9]+):([0-9]+): (error|fatal error|warning|note):(.*)$
    make[([0-9]+)]: (Entering|Leaving) directory (.*)$
    ([^:]+):([0-9]+): *** (.*)$

    Simply update the regular expressions there to match the IAR output and VIsualGDB will understand them.

    #9599
    LostTime77
    Participant

    I am resurrecting this topic as VisualGDB has become an option again due to the latest 5.2 update. 3 or 4 years ago we investigated VisualGDB to replace the IAR + Eclipse solution we were using for development. There were 2 hanging items that caused us not to switch:

    1. VisualGDB only seems to fully support GCC. We need it to support IAR. This is a requirement; we cannot switch to GCC. There is not an issue with the compiler itself, but rather the crappy LD linker that GNU seems to use. IAR allows code objects to be placed inside non contiguous memory regions whereas LD requires you to explicitly place the objects by hand. This is a non negotiable feature in our development process as we are working on MCUs with non contiguous memory. Changes to the output memory map happen when each person compiles a new feature into the code base, and at times we have up to 10 developers working on the same code base, each with their own test setup. Imagine coordinating RAM memory placement across non contiguous memory with that many people. The IAR linker does this automatically – just tell the linker the memory regions and boom, its done.
    2. You could not specify per file / folder build options. For example, I want to exclude files / folders from specific build configurations for the build. It looks like this has changed with the migration to MSBuild; however, it does not look like you can do per folder options. This is not a breaking feature in the decision; we can work around that.

     

    We would really like to get away from Eclipse as our development IDE, because its got a massive number of issues that the developers seem to plainly ignore. Visual Studio would be ideal, because its just awesome. However, we require IAR support.

    Now, I am wondering if it is possible to put IAR support into VisualGDB manually by just building some of our own command line tools that can pre process the command line options being passed into and written out of the tools such as the compiler, assembler, and linker – basically ‘convert’ the gcc command lines to iar ones. Do you think this is possible or can you give me a place to start?

     

    Also is IAR support planned at all?

    • This reply was modified 7 years, 12 months ago by LostTime77.
    #9602
    support
    Keymaster

    Hi,

    As most of our users rely on GCC, we indeed do not directly support the IAR compiler. It is possible however to modify a VisualGDB project to use any 3rd-party compiler.

    We do have a detailed tutorial showing how to use the Keil ARM compiler with VisualGDB here: http://visualgdb.com/tutorials/arm/keil/; adding support for IAR should be very similar.
    The steps described there only work for Make projects; MSBuild would require slightly different steps, but we could guide you through them.

    As Visual Studio itself does not support per-folder options, VisualGDB can’t do that out-of-the-box. You can achieve this by adding a few custom targets to your MSBuild project, but it won’t be easily configurable via GUI. Let us know if you want to go that way and we could give you a basic example.

    P.S. If the only reason you are not using GCC is the lack of support for multiple memory regions, we could provide you with a custom tool that will re-link an existing ELF file to spread one data section across multiple regions using the relocation records generated by the compiler. If you are interested, please contact our sales and we will give you a quote for making this tool.

    We currently don’t have any plans for supporting IAR compiler directly as it is not very popular among our users. We could add it as a paid customization if you believe this could save time, or we could just help you support it on your side by customizing VisualGDB projects.

    #9757
    ewatson
    Participant

    Hi,

    We are also investigating the use of VisualGDB as a development solution and currently use IAR for ARM.VisualGDB is perfect for our development strategy, except for the compiler situation (only supports GCC). Who knows, maybe there are more users than you think that would like direct support for IAR ARM 🙂

    A detailed tutorial showing how to use the IAR ARM compiler with VisualGDB would be very useful. I will see how I get on with the Keil version.

    • This reply was modified 7 years, 11 months ago by ewatson.
    #9771
    support
    Keymaster

    Hi,

    Thanks, we will consider adding a tutorial specific to IAR.

    #19944
    Siva
    Participant

    Hi,

    Is there any support tutorial for Integrating IAR (Compiler,Assembler & Linker ) into VisualGDB.

    #19969
    support
    Keymaster

    Hi,

    Sorry, not yet. We have added support for automatic import of IAR projects (converting them to GCC projects), but we don’t have a tutorial for the IAR compiler yet.

    #19970
    Siva
    Participant

    Is it possible to include IAR toolchain into VisualGDB?

    Is there a way to get a *gdb.exe file for my IAR toolchain which was not listed in the toolchains, when we are creating a new embedded project.

    Can i get the link for how to import IAR projects by converting into GCC?

    #19972
    support
    Keymaster

    Hi,

    Sorry, VisualGDB would not automatically detect your IAR toolchain yet. Similar to the Keil tutorial, we recommend simply creating a project using the GCC toolchain first and then editing the Makefile to run the IAR compiler instead.

    No problem, we have published a tutorial about importing IAR projects here: https://visualgdb.com/tutorials/arm/import/iar/

     

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.