This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSPM0L1305: Build an MSPM0 project using bx-docker in linux ubuntu and iar build tools

Part Number: MSPM0L1305
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Tool/software:

We are still looking at how to build the TI project through the command line using bx-docker and ran into the following issue, It builds in windows using the following command  iarbuild c:\projectReset\Project-Reset-4000-Series.ewp -build Debug -parallel 4 -varfile c:\projectReset\Project-Reset-4000-Series.custom_argvars.

 This is the output I get running the following command in bx-docker

 docker run --rm -v LMS2:/usr/local/etc/IARSystems -v $PWD:/build iarsystems/bxarm:9.50.2 /opt/iarsystems/bxarm/common/bin/iarbuild Project-Reset-4000-Series.ewp -build Debug -parallel 4 -varfile Project-Reset-4000-Series.custom_argvars

      IAR Command Line Build Utility V9.3.2.390

     Copyright 2002-2023 IAR Systems AB.

 Project-Reset-4000-Series - Debug

Reading project nodes...

 Variable expansion failed.

  Offending text: "$MSPM0_SDK_INSTALL_DIR$/source/third_party/CMSIS/Core/Include/"

  Partial command line: ""$TOOLKIT_DIR$/bin/iccarm" "/build/EEPROM_EMULATION/eeprom_emulation_type_a.c" "-D" "__MSPM0L1305__" "-D" "BUILD_NUM_MSB=0" "-D" "MAJOR_SW_REV_LEVEL=0" "-D" "BUILD_NUM_LSB=1" "-o" "/build/Debug/Obj/$ROOT_REL_PATH$" "--no_unroll" "--no_inline" "--no_tbaa" "--no_scheduling" "--debug" "--endian=little" "--cpu=Cortex-M0+" "--debug" "--silent" "-e" "--aeabi" "--thumb" "--diag_suppress=Pa050" "-e" "--fpu=None" "--dlib_config" "$TOOLKIT_DIR$/inc/c/DLib_Config_Normal.h" "-I" "$PROJ_DIR$/" "-I" "$MSPM0_SDK_INSTALL_DIR$/source/third_party/CMSIS/Core/Include/" "-I" "$MSPM0_SDK_INSTALL_DIR$/source/" "-I" "$MSPM0_SDK_INSTALL_DIR$/source/ti/driverlib/" "-I" "$PROJ_DIR$/Core/Src/" "-I" "$PROJ_DIR$/Core/Inc/" "-I" "$PROJ_DIR$/EEPROM_EMULATION/" "-Om" "--vla" "

Failed to generate node description for C/C++ Compiler tool and file(s): eeprom_emulation_type_a.o

Failed to generate build node descriptions

Reading project nodes failed.

 We have the following setup in the following file /ti/mspm0_sdk_2_01_00_03/tools/iar# nano MSPM0_SDK.custom_argvars

 

<?xml version="1.0" encoding="iso-8859-1"?>
<iarUserArgVars>
  <group active="true" name="MSPM0_SDK">
    <variable>
      <name>SYSCONFIG_ROOT</name>
      <value>build/ti/sysconfig_1.20.0</value>
    </variable>
    <variable>
      <name>MSPM0_SDK_INSTALL_DIR</name>
      <value>build/ti/mspm0_sdk_2_01_00_03</value>
    </variable>
    <variable>
      <name>MSP_SDK_INSTALL_DIR</name>
      <value>build/ti/mspm0_sdk_2_01_00_03</value>
    </variable>
    <variable>
      <name>EXAMPLE_ROOT</name>
      <value>build/ti/mspm0_sdk_2_01_00_03/tools/iar</value>
    </variable>
  </group>
</iarUserArgVars>

  • Hi Richard,

    Please refer to this posting.

  • Hi Denis, Thanks for the response would you be able to provide me with a way to build athis project on a linux host with sysconfig and the sdk installed. I can then use this to build the project in Docker. As there is a linux version of both available I presume this functionality is available. 

  • Hi Richard,

    Let me check with our SW tools team.

  • Hi Richard,

    I'm expanding my search for someone that might know, but from the folks I have asked so far, this is their response.

    If the same command works in Windows but its failing in Linux and they are using the same tool then sounds like there is something wrong with their Linux setup. But we don't support using IAR Build Tools just the IAR IDE. We also don't know anything about that Docker they are using.

  • Hi Denis, If there is something wrong with the Linux setup can we get information on how to setup the linux enviroment correctly, what is involved in the linux setup, it doesn't need to be in docker, can we see how it's built on the command line.

  • Hi Denis did you get any more updates on this issue?

  • Hi Richard,

    Yes, I super apologize for the delay.  I did get a response from one of tools expert familiar with Linux, IAR.  Here is his response:

    First, they must be aware we only support IAR in Windows, so any debug advice is purely going to be theoretical.

    That being said, from their description it seems pretty clear that the IAR compiler is unable to correctly evaluate our custom argument variables (i.e. $MSPM0_SDK_INSTALL_DIR$).  see screen capture

    Now ignoring Linux and Docker as potential variables, the most obvious reason you would run in to this issue is if you are not importing our custom variable file (MSPM0_SDK.custom_argvars).

    So a couple of debug suggestions:

    1. They should verify that they are passing our custom variable file to the IAR compiler invocation (via -varfile option).
      1. This is required, as IAR does not automatically find custom variables per project. It must be specified during invocation.
    2. If #1 is confirmed, and they still see the same error. They can try manually replacing all the custom variable paths in their project .ipcf file, with hard-coded paths (relative to their build environment). This is just a test, but it should remove the need for any custom variables, thus removing the immediate issue.
      1. If this builds successfully, then we have confirmed there is some issue with how the custom variables are being imported.
      2. If this still fails, then there may be a Linux and/or Docker specific cause to the issue.

     

    If these suggestion do not work, then it is possible there is some additional consideration when running IAR in Linux and/or Docker that we are not aware of. In this case, it may be more helpful for them to reach out to IAR for help running their tool in Linux.

     

    Does this help?

  • Hi Denis, Thanks for the feedback I will try out what was said from your tools expert and see how I get on.

  • Hi Richard,

    Yes, please do.  If you find a solution that works for you, this would be helpful to those who follow in your footsteps ;)

  • Hi Denis,

    I have run the following command in a docker container in interactive mode and got the following response can you confirm I have the command correct the way I am calling the MSPM0_SDK.custom_argvars file.

     

     

    root@6f4cdf336b59:~# /opt/iarsystems/bxarm/common/bin/iarbuild Project-Reset-4000-Series.ewp -build Debug -parallel 4 -varfile Project-Reset-4000-Series.custom_argvars -varfile ../ti/mspm0_sdk_2_01_00_03/tools/iar/MSPM0_SDK.custom_argvars

     

         IAR Command Line Build Utility V9.3.2.390

         Copyright 2002-2023 IAR Systems AB.

     

     

    Project-Reset-4000-Series - Debug

    Reading project nodes...

     

    Variable expansion failed.

      Offending text: "$MSPM0_SDK_INSTALL_DIR$/source/third_party/CMSIS/Core/Include/"

      Partial command line: ""$TOOLKIT_DIR$/bin/iccarm" "/build/EEPROM_EMULATION/eeprom_emulation_type_a.c" "-D" "__MSPM0L1305__" "-D" "BUILD_NUM_MSB=0" "-D" "MAJOR_SW_REV_LEVEL=0" "-D" "BUILD_NUM_LSB=1" "-o" "/build/Debug/Obj/$ROOT_REL_PATH$" "--no_unroll" "--no_inline" "--no_tbaa" "--no_scheduling" "--debug" "--endian=little" "--cpu=Cortex-M0+" "--debug" "--silent" "-e" "--aeabi" "--thumb" "--diag_suppress=Pa050" "-e" "--fpu=None" "--dlib_config" "$TOOLKIT_DIR$/inc/c/DLib_Config_Normal.h" "-I" "$PROJ_DIR$/" "-I" "$MSPM0_SDK_INSTALL_DIR$/source/third_party/CMSIS/Core/Include/" "-I" "$MSPM0_SDK_INSTALL_DIR$/source/" "-I" "$MSPM0_SDK_INSTALL_DIR$/source/ti/driverlib/" "-I" "$PROJ_DIR$/Core/Src/" "-I" "$PROJ_DIR$/Core/Inc/" "-I" "$PROJ_DIR$/EEPROM_EMULATION/" "-Om" "--vla" "

    Failed to generate node description for C/C++ Compiler tool and file(s): eeprom_emulation_type_a.o

    Failed to generate build node descriptions

    Reading project nodes failed.

     

     

     

    I have tried making a custom.args file  as follows:

    root@9aa3132da5ef:~# cat Project-Reset-4000-Series.custom_argvars
    <?xml version="1.0" encoding="UTF-8"?>
    <iarUserArgVars>
        <group name="MSPM0_SDK" active="true">
            <variable>
                <name>SYSCONFIG_ROOT</name>
                <value>/ti/sysconfig_1.20.0</value>
            </variable>
            <variable>
                <name>MSPM0_SDK_INSTALL_DIR</name>
                <value>/ti/mspm0_sdk_2_01_00_03</value>
            </variable>
            <variable>
                <name>MSP_SDK_INSTALL_DIR</name>
                <value>/ti/mspm0_sdk_2_01_00_03</value>
            </variable>
            <variable>
                <name>EXAMPLE_ROOT</name>
                <value>/ti/mspm0_sdk_2_01_00_03/tools/iar</value>
            </variable>
        </group>
    </iarUserArgVars>
    
    

    I got the following output:

    root@9aa3132da5ef:~# /opt/iarsystems/bxarm/common/bin/iarbuild Project-Reset-4000-Series.ewp -build Debug -parallel 4 -varfile Project-Reset-4000-Series.custom_argvars

     IAR Command Line Build Utility V9.3.2.390

     Copyright 2002-2023 IAR Systems AB.

     Project-Reset-4000-Series - Debug

    Reading project nodes...

     Cleaning... 0 files.

    SysConfig_Generated_Files.ipcf

    ebuilding 'build_ide.ninja': cannot make progress due to previous errors

    FAILED: /build/SysConfig_Generated_Files.ipcf

    cd /build && /ti/sysconfig_1.20.0/sysconfig_cli.bat -o /build -s "/ti/mspm0_sdk_2_01_00_03/.metadata/product.json" --compiler iar /build/Project-Reset-4000-Series.syscfg

    /bin/sh: 1: /ti/sysconfig_1.20.0/sysconfig_cli.bat: not found

     Total number of errors: 2

    Total number of warnings: 0

    Build failed

     

     

     

  • Hi Richard,

    Have you reached out to IAR by chance on this.  I'm curious to see what they might suggest.

  • Hi Denis,  Just letting you know this is able to build, I had to add a specific custom_argvars file that had the correct paths for a linux system and also use a python wrapper scxript to change the .ewp file to point to a bash script instead  of windows.