[SOLVED] post-build esternal linting macro problem

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

  • [SOLVED] post-build esternal linting macro problem

    Hi!


    I am trying to set up automatic external linting as part of a CI pipeline, using PClint plus, that will run post build.


    To do this i need to produce a lnt file that has paths to all the files, the variable sizes, definitions etc.


    Using the external tools configuration for linting, as described here: studio.segger.com/index.htm?ht…nal_tools_file_format.htm, the below macros are expanded, which produce all the information i need. These are the default macros for linting, and the linter works inside SES.


    -v -incvar(__CW_ARM) -i$(LINTDIR)/lnt co-gcc.lnt $(DEFINES) $(INCLUDES) -D__GNUC__ -u -b +macros +macros -w2 -e537 +fie +ffn -width(0,4) -hF1 "-format=%f:%l:%C:\s%t:\s%m [-e%n]" "$(InputPath)"


    However, when i run a python script as part of a pre or post build command, these macros are not expanded.


    This python script (dump_parameters.py) saves all the parameters fed into it as a text file so i can see what the arguments being passed into the program are. Attached is a side-by-side comparison of the output of the same scripts called from the external tools XML command (LEFT) and the pre-build command (RIGHT). The XML command expands the macros but the pre-build command doesn't.


    What am i doing wrong? Thanks!
    Images
    • external tools and pre-build comparison.png

      108.63 kB, 1,182×878, viewed 300 times
    • set pre-build command.png

      19.25 kB, 691×622, viewed 267 times
    • xml tools.png

      30.77 kB, 1,478×422, viewed 314 times
  • Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.
    Which version of Embedded Studio are you using? Could you try the latest version?
    When opening the project options and editing the Pre-Build-Command you can see a little drop down arror on the right hand side (your screenshot 2). If you click that it will show you which macros can be used for this options.

    Can you find the macros INCLUDES and DEFINES there?

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

    Thanks for your response!

    I have had this problem on versions 6.2 and 5.7a of SES. When i check that dropdown menu, there is no option for include or define macros (as shown in pictures). These macros aren't there in both pre-build and post-build command menus. This is the same in both my project and the example project i've tried (ble_app_blinky_pca10056_s140).

    I've included the list of available macros from the dropdown if that helps!

    Thanks,
    Ed
    Images
    • no-define macro.png

      38.26 kB, 701×633, viewed 217 times
    • no-include macro.png

      42.42 kB, 700×634, viewed 224 times
    Files
  • Hello Ed,

    Thank you for clarifying.
    The reported behaviour is reproducible.

    For now we recommend to set a user defined analyze command in the Tools.xml

    We will investigate if the tools macros could also be used on project level but can't estimate if and when this would be available.

    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.