Renesas board with IAR compiler

Sysprogs forums Forums VisualGDB Renesas board with IAR compiler

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #29399
    Michael123
    Participant

    Hello,

    is there a way to develop projects for a Renesas board with the IAR compiler in VisualGDB  ? I looked at this Tutorial but it only shows how to set up a project in VisualGDB with the GCC for Renesas toolchain. My problem is that dispite having the Embedded Workbench 8.1 for Renesas installed, VisualGDB doesn’t list it in the toolchain selection.
    If I create a project in VSGDB there is also an option “Locate an IAR/Keil compiler installation” but I can’t select the IAR compiler because VisualGDB expects it to have the name “armcc.exe, armclang.exe, or iccarm.exe”. That is obviously not what i want.

    So my question: Is there support for developing Reneas projects with the IAR compiler ? And if so, how can I tell VisualGDB to use the compiler in the Embedded Workbench 8.1 directoy (“iccrl78.exe”)

     

    Thanks in advance

     

     

    #29400
    support
    Keymaster

    Hi,

    Indeed, as the overwhelming majority of devices targeted by our users are ARM-based, VisualGDB was only tested with IAR for ARM. That said, we will be happy to extend this to Renesas targets if you could run a few tests on your side.

    Please try searching for IAR in the <VisualGDB Directory>\KnownToolchains.xml file. You will locate a ToolchainLoader element that specifies the exact registry key where VisualGDB searches for the IAR toolchain, and also the names of the compiler/linker and predefined include directories.

    You can then copy the <ToolchainLoader> element into another instance and change its contents to match your Renesas toolchain. Then simply restart Visual Studio, or reopen Tools->VisualGDB->Manage VisualGDB Packages, and VisualGDB will detect the new compiler.

    We can also do the necessary research and testing on our side, however as the Renesas devices are much more rarely used compared to ARM targets, we would have to charge a customization fee for it (the fee would be credited towards future VisualGDB license purchases).

    #29405
    Michael123
    Participant

    Thanks for the fast replay. Here is some testing I have done with your proposed solution:

    I have added a new <ToolchainLoader> element (i copied the one from the IAR-ARM toolchain) and changed the <PathDetectionKey> to the Embedded Workbench for Renesas. I also changed the compiler, linker and assembler as well as the <BinaryDirectory> and the <IncludeDirectories>. As far as I can see, there shouldn’t be anything left which points to something ARM related.

    If I create a new Project with the Embedded Project Wizard, the Embedd Workbench 8.1 (it’s the one for Renesas) is indeed recognized and can be selected in the dropdown menu. The Microcontroller type can also be selected in the “supported device” list below.

    A problem occurs if I click “Next”. VisualGDB trys to test the compiler and returns with an error message: “Failed to launch iccrl78.exe. VisualGDB has tried to test your settings by building a simple project and encountered following errors:”:

    Run “C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.1\rl78\bin\iccrl78.exe ” in directory “” on local computer
    ————————–

    IAR C/C++ Compiler V4.10.1.2197 for RL78
    Copyright 2011-2018 IAR Systems AB.
    PC-locked license – IAR Embedded Workbench for Renesas RL78, 16K KickStart Edition 4.10

    Available command line options:
    –c++ C++
    –c89 Use C89 standard
    –calling_convention [v1|v2]
    Select calling convention (default: v2)
    –char_is_signed
    ‘Plain’ char is treated as signed char
    –char_is_unsigned
    ‘plain’ char is treated as unsigned char
    –code_model [n|near|f|far]
    Select code model (default: near)
    –code_section section-name
    Select default code section name
    –core [s1|s2|s3]
    Select core (default: s3)
    -D symbol[=value]
    Define macro (same as #define symbol [value])
    –data_model [n|near|f|far|h|huge]
    Select data model (default: near)
    –debug
    -r Insert debug info in object file
    –dependencies=[i|m|n][s][lw][b] file|directory|+
    List file dependencies
    i Include filename only (default)
    m Makefile style (multiple rules)
    n Makefile style (one rule)
    s Don’t include system file dependencies
    l Use locale encoding instead of UTF-8
    w Use little endian UTF-16 instead of UTF-8
    b Use a Byte Order Mark in UTF-8 output
    (+: output same as -o, only with .d extension)
    –deprecated_feature_warnings [+|-]feature,[+|-]feature,…
    Enable (+) or disable (-) warnings about deprecated features:
    attribute_syntax Warn about attribute syntax that
    will change
    preprocessor_extensions Warn about use of migration
    preprocessor extensions
    segment_pragmas Warn about use of #pragma constseg/
    dataseg/memory
    –diagnostics_tables file|directory
    Dump diagnostic message tables to file
    –diag_error tag,tag,…
    Treat the list of tags as error diagnostics
    –diag_remark tag,tag,…
    Treat the list of tags as remark diagnostics
    –diag_suppress tag,tag,…
    Suppress the list of tags as diagnostics
    –diag_warning tag,tag,…
    Treat the list of tags as warning diagnostics
    –disable_div_mod_instructions
    Disable generation of div instructions
    –discard_unused_publics
    Discard unused public functions and variables
    –dlib_config name|path
    Specify DLib library configuration
    –double bits double size
    32 type double is 32 bits wide (default)
    64 type double is 64 bits wide
    –do_explicit_zero_opt_in_named_sections
    Allow zero init optimization for variables in named
    sections/segments
    -e Enable IAR C/C++ language extensions
    –enable_restrict
    Enable the restrict keyword
    –error_limit limit
    Stop after this many errors (0 = no limit)
    -f file Read command line options from file
    –f file Read command line options from file and report dependency
    –generate_callt_runtime_library_calls
    Generate callt runtime library calls
    –generate_far_runtime_library_calls
    Generate far runtime library calls
    –guard_calls Use a guard call for a function static initialization
    –header_context
    Adds include file context to diagnostics
    -I directory Add #include search directory
    -l[c|C|D|E|a|A|b|B][N][H] file|directory
    Output list file
    c C source listing
    C with assembly code
    D with pure assembly code
    E with non-sequential assembly code
    a Assembler file
    A with C source
    b Basic assembler file
    B with C source
    N Do not include diagnostics
    H Include header file source lines
    –macro_positions_in_diagnostics
    Use positions inside macros in diagnostics
    –max_cost_constexpr_call limit
    Maximum cost (number of calls/number of loop iterations) when
    evaluating a top-level constexpr call
    –max_depth_constexpr_call limit
    Maximum depth of recursion when evaluating a top-level
    constexpr call
    –mfc Enable multiple file compilation
    –misrac1998 Enable MISRA C diagnostics (not available)
    –misrac2004 Enable MISRA C diagnostics (not available)
    –near_const_location [RAM|ROM0|ROM1]
    Select near const location (default: ROM0)
    –nonportable_path_warnings
    Enable warning for non-matching case in paths
    –no_bom Don’t use a Byte Order Mark in Unicode output
    –no_call_frame_info
    Suppress output of call frame information
    –no_clustering Disable clustering optimizations
    –no_code_motion
    Disable code motion
    –no_cross_call Disable cross call optimization
    –no_cse Disable common sub-expression elimination
    –no_exceptions Disable C++ exception support
    –no_fragments Do not generate section fragments
    –no_inline Disable function inlining
    –no_path_in_file_macros
    Strip path from __FILE__ and __BASE_FILE__ macros
    –no_rtti Disable C++ runtime type information support
    –no_scheduling No scheduling
    –no_size_constraints
    Remove limits for code expansion
    –no_static_destruction
    Do not emit code to destroy C++ static variables
    –no_system_include
    Do not search in the default system header directory
    –no_tbaa Disable type based alias analysis
    –no_typedefs_in_diagnostics
    Do not use typedefs when printing types
    –no_uniform_attribute_syntax
    Use old meaning for IAR type attributes before initial type
    –no_unroll Disable loop unrolling
    –no_warnings Disable generation of warnings
    –no_wrap_diagnostics
    Don’t wrap long lines in diagnostic messages
    -O[n|l|m|h|hs|hz]
    Select level of optimization:
    n No optimizations
    l Low optimizations (default)
    m Medium optimizations
    h High optimizations
    hz High optimizations, tuned for small code size
    hs High optimizations, tuned for high speed
    (-O without argument) The same setting as -Oh
    –only_stdout Use stdout only (no console output on stderr)
    –output file|path
    -o file|path Specify object file
    –pending_instantiations limit
    Maximum number of instantiations of a given template in
    progress at a time (0 -> no limit)
    –predef_macros file|directory
    Output predefined macros
    –preinclude filename
    Include file before normal source
    –preprocess=[c][n][s] file|directory
    Preprocessor output
    c Include comments
    n Preprocess only
    s Suppress #line directives
    –public_equ symbol[=value]
    Define public assembler symbol (EQU)
    –relaxed_fp Enable floating point optimizations that may affect the result
    –remarks Enable generation of remarks
    –require_prototypes
    Require prototypes for all called or public functions
    –silent Silent operation
    –source_encoding {locale|utf8}
    Encoding to use for source files with no BOM
    –stack_protection
    Enable stack smashing protection
    –strict Strict C/C++ standard language rules
    –system_include_dir directory
    Set system header directory
    –text_out encoding
    Encoding to use for text output files
    utf8 UTF-8
    utf16le Little-endian UTF-16
    utf16be Big-endian UTF-16
    locale Locale specific encoding
    –uniform_attribute_syntax
    Same syntax for IAR type attributes as for const/volatile
    –use_c++_inline
    Use C++ inline semantics in C mode
    –use_paths_as_written
    Use paths as written in debug information
    (normally absolute paths are used)
    –use_unix_directory_separators
    Use forward slashes in paths in debug information
    –utf8_text_in Non-source text input files with no BOM use UTF-8 encoding
    –version Output version information and exit
    –vla Allow variable length arrays
    –warnings_affect_exit_code
    Warnings affect exit code
    –warnings_are_errors
    All warnings are errors
    –warn_about_c_style_casts
    Warn about uses of C-style casts in EC++/C++
    –workseg_area[=20]
    Enable short address workseg area with optional size
    –workseg_area[=30] (default: 20)
    ————————–
    Command exited with code 0

    —– contents of (version regex) —–
    IAR (.* Compiler|ELF Linker) (V[^ /]+)/.*
    ———————————–

    That is the normal output if you call iccrl78.exe with no arguments from the console. Could it be that VisaulGDB starts the iccrl78 compiler with no, or wrong arguments ? I have looked for a file which defines the compiler arguments used by VisualGDB but I couldn’t find one.

    Besides that I am curious if VisualGDB’s Intellisense would still work with the code for the Renesas IAR compiler ?

     

    If there are any ideas/solutions to the above problem you can let me know, if not it seems like I’m stuck with ARM devices 🙂

     

     

     

    #29411
    support
    Keymaster

    No problem,

    It looks like the IAR for RL78 reports its version slightly differently from IAR for ARM. You can work around it by changing IARToolProductVersion element in the %VISUALGDB_DIR%\Rules\RegularExpressions.xml file. The version below should cover both variants:

    IAR (.* Compiler|ELF Linker) (V[^ /]+).* for.*

    Then simply restart Visual Studio and VisualGDB should pick up the new regex.

    #29414
    Michael123
    Participant

    Thank you very much. The modification of the RegularExpressions.xml file works great and the error is gone.

    At the risk of trying your patience, I have one more problem left. After checking the compiler, VisualGDB runs “Detecting conditional settings” and returns with a System.ArgumentNullException. I guess it’s because the ROM and RAM sizes of all detected Renesas devices are set to zero.
    I’m not sure if this is important, but if I select a Renesas device it shows the correct file path to the device folder under “Shared file locations” in the bottom of the window (in my case it’s C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.1\rl78\config\devices\RL78 – G13).
    I checked that folder and it seems like the .menu files are all there.

    Is there some way to specify the ROM and RAM sizes of a device manualy ?

    #29419
    support
    Keymaster

    No worries, the RAM/ROM sizes should not have any effect on this, most likely the issue is caused by inconsistent modifications to some files.

    Please try this build: VisualGDB-5.5.102.3879.msi. It contains a definition for the RL78 toolchain.

    If the problem persists, please let us know the stack trace from the “details” view of the exception message box, and also try enabling diagnostic logging via View->Other Windows->VisualGDB Diagnostics Console. It should explain where exactly the problem is triggered.

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