Intellisense not working for STM32L1 projects

Sysprogs forums Forums VisualGDB Intellisense not working for STM32L1 projects

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11551
    jeremyvnc
    Participant

    Hello,

    I’m trying to program using the STM32L151C6 microcontroller and branch into the lower power series of microcontrollers.  However, any new project I make for embedded projects using this series of chips (stm32L1), intellisense does not work.  I’m not a fan of Clang Intellisense as I really like the “peek” feature and the line completion popup of the built-in intellisense as well as the fact it feels more “integrated”.  I have checked that the vs intellisense does work with the stm32F4 chips and in new c# and other c++ project types (MFC, Win32, etc).  It appears to only not work in the newly created visual gdb projects (even examples) for the stm32L1 devices.  The first thing I see when opening the main of a stm32L1 project is this error at the very first character of line 1: #include <stm32l1xx_hal.h>: “Error (active) command-line error: invalid macro definition: $$com.sysprogs.bspoptions.stm32.hal_legacy$$”

    I tracked the error to the stm32.props file at line 18:
    <PreprocessorDefinitions>ARM_MATH_CM3;STM32L151C6;flash_layout;STM32L151xB;$$com.sysprogs.bspoptions.stm32.hal_legacy$$;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>

    Comparing to stm32.props of a stm32F4:
    <PreprocessorDefinitions>ARM_MATH_CM4;STM32F407VG;flash_layout;STM32F407xx;%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>

    I’m trying to remove the offending macro but the top of the file says that it is automatically generated and I should “Use VisualGDB Project Properties dialog or modify Makefile or per-configuration .mak files instead.”  I have searched through those places and cannot find the macro specified.  However, I tried deleting the macro from the stm32.props line but the error persists even after I clean-rebuild the solution even though after re-opening the file, the macro is still gone.

    Can someone help me?  Is there something else I need to modify?

    Thanks,
    Jeremy

    #11559
    support
    Keymaster

    Hi,

    This actually looks like a bug in our STM32 BSP. Please try locating the following lines in the BSP.XML file:

          <AdditionalIncludeDirs>
            <string>$$SYS:BSP_ROOT$$/STM32L1xxxx/STM32L1xx_HAL_Driver/Inc</string>
            <string>$$SYS:BSP_ROOT$$/STM32L1xxxx/STM32L1xx_HAL_Driver/Inc/Legacy</string>
            <string>$$SYS:BSP_ROOT$$/STM32L1xxxx/CMSIS_HAL/Device/ST/STM32L1xx/Include</string>
            <string>$$SYS:BSP_ROOT$$/STM32L1xxxx/CMSIS_HAL/Include</string>
          </AdditionalIncludeDirs>
          <AdditionalPreprocessorMacros>
            <string>$$com.sysprogs.bspoptions.primary_memory$$_layout</string>
            <string>$$com.sysprogs.stm32.hal_device_family$$</string>
            <string>$$com.sysprogs.bspoptions.stm32.hal_legacy$$</string>
          </AdditionalPreprocessorMacros>

    Then simply remove the line with $$com.sysprogs.bspoptions.stm32.hal_legacy$$ (ensure that you do it for the L1 definition, not F1 definition).

    We will also fix this in the upcoming STM32 BSP refresh.

    #11561
    jeremyvnc
    Participant

    Thanks for this.  I did some additional digging and F1 also has the same issue with intellisense.  I went ahead and removed both lines and all works now.

    Thanks again!
    Jeremy

    #11570
    support
    Keymaster

    Hi,

    Good to know it works. BTW, we have added support for the “Peek definition” feature to the Clang IntelliSense in the upcoming VisualGDB 5.2 Preview 2, and also significantly improved performance and added a special mode for diagnosing parsing time. If this sounds like something worth giving a try, let us know and we can share a build with this feature.

    #11586
    jeremyvnc
    Participant

    I would definitely be up to trying out the new “peek” mode in Clang especially if it operates faster than before with variable completion.

    #11601
    support
    Keymaster

    Hi,

    No problem. We have just released the Preview 2 that supports Peek Definition and has improved performance. You can download it here: http://visualgdb.com/download/

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