User Variables in Pre-processor macros

Sysprogs forums Forums VisualGDB User Variables in Pre-processor macros

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7174
    wobble
    Participant

    Hi, I’m using Visual GDB to do embedded firmware on an STM32 micro.

    I’ve using Version 4.3 release 4 (VisualGDB-4.3r4-trial.msi).

    In my project, I’ve created 2 user variables (MAJORVERSION and MINORVERSION) that contain the major and minor firmware version numbers of my project.

    I’m passing these values to the source code via a “Preprocessor macro:

    SWVER=”\”V$(MAJORVERSION).$(MINORVERSION)\””)

    I can see this being passed to GCC in the Output window during the build process. I can also see that this value gets tranferred to “gcc_Release.h”, when makefile settings are altered. My source code correctly evaluates the SWVER macro correctly (SWVER = “xVy”) – and all is well!

    However, if I change the value of the user variable (say MINORVERSION) via Visual GDB Project Properties and “Apply” the change, the gcc.Release.h file is not updated – even after a (re)Build. All I can do is to manually force the make file settings to be re-created and then the changes are passed across – but this is not ideal and I’ll forget!

    Any ideas on what to do / how to solve this.

    Thanks (in advance),

    #7181
    support
    Keymaster

    Hi,

    Do you get the ‘testing toolchain’ dialog? If no, try changing an arbitrary line on the Makefile Settings page (e.g. add a space to CFLAGS and remove it back) and clicking “Apply”.

    #7188
    wobble
    Participant

    Hi.

    Thanks for your reply. That is pretty much what I thought / found

    You said “Do you get the ‘testing toolchain’ dialog? ” – No I don’t

    You said “If no, try changing an arbitrary line on the Makefile Settings page (e.g. add a space to CFLAGS and remove it back) and clicking “Apply”.” – That’s exactly what I found that I have to do to get it to work. Is there anyway to make that automatic (i.e. when I change the user variable that is used in the Makefile Settings page)?

    Thanks

    #7199
    support
    Keymaster

    Hi,

    The logic of automatically detecting that would be probably too complex and error-prone given a fairly simple workaround. We could add a button to trigger retesting manually if that helps.

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