Getting up to speed with VisualGDB

Sysprogs forums Forums VisualGDB Getting up to speed with VisualGDB

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #25804
    GeneM
    Participant

    I just downloaded VisualGDB and got my first LED blinking on a STM32L4R9 Discovery Kit using the on-line tutorials.  It was exceptionally easy which is very encouraging.  Now comes the hard part: writing my actual application.  I’m starting with an example FatFS project from the ST Micro L4 firmware library.  Unfortunately, every example in that library uses dozens of .h and .c files from a bunch of different folders.  Rather than find every one and include it in my VisualGDB project, is there a way to point VisualGDB at a few folders and have it look there anytime it can’t find a required file? For example, one of the #includes is

    #include "../Components/mfxstm32l152/mfxstm32l152.h"

    Can I just point VisualGDB at the Components folder and it will always look there if it needs a file and can’t find it anywhere else?

    I’ve been doing embedded programming using Visual Studio, C# and the .Net Micro Framework.  It has been incredibly effective for me since that tool chain hides all most all of the gory details under the hood which is a really good thing since since I’m not a super experienced embedded programmer .  Now I have some applications that require the performance of compiled C/C++ and unfortunately need to understand all those gory details.

    Thanks in advance for the help.

    • This topic was modified 4 years, 6 months ago by GeneM.
    #25806
    support
    Keymaster

    Hi,

    Please try using VisualGDB Project Properties -> Embedded Frameworks.  This page allows automatically referencing many commonly used frameworks from the STM32 ecosystem (the corresponding sources and settings will be automatically added to the project). Note that the filter on that page also allows searching for frameworks providing a specific source file or a preprocessor macro.

    For libraries that are not available as embedded frameworks, VisualGDB offers 2 mechanisms:

    1. Right-click in Solution Explorer -> Add -> Import Folder Recursively. This will import the entire folder into the project, and optionally add directories of all header files to the header search path.
    2. Header discovery can semi-automatically locate the headers as you reference them and update the project settings accordingly.

    If it doesn’t help, please let us know more details on what you are trying to accomplish and we will suggest a better technique.

    #25807
    GeneM
    Participant

    Thanks for the quick response, I’ll give those suggestions a try and get back to you if I need more help.

    #25856
    GeneM
    Participant

    Thanks again for the help, that got me past the first step in the learning curve.  Next question: I’m starting to add the code I need to use the SD card and this code

    FATFS SDFatFs; /* File system object for SD card logical drive */
    FIL MyFile; /* File object */

    Gives this error

    1 [Clang IntelliSense] Error: unknown type name ‘FATFS’ C:\Users\gene\Documents\VisualGDB\EmbeddedProject1\EmbeddedProject1\EmbeddedProject1.cpp 10 1 EmbeddedProject1″

    and a similar error for the “FIL” type. FATFS and FIL are structures defined in ff.h which is included in my solution as shown in the attached file. What do I need to do so the compiler can find FATFS and FIL?

    Like I said earlier, I’m moving to C from C#.  I have a decent amount of experience with Visual Studio and I know where to look to get help with C programming but I’m struggling with how to set up an embedded C project using VisualGDB.  My current workflow is to start with an example from the STM32 firmware library.  I can look at it using the STM32CubeIDE and am trying to recreate the example in VisualGDB. The problem is the CubeIDE examples are really complicated and all the library and header files are scattered/hidden in dozens of different places.  Is there a  book, tutorial, website or whatever where I can get up to speed on issues like this one?  VisualGDB looks like a great solution for me if I can get past these initial learning curve hurdles but I wish I didn’t have to take up everyone’s time with my newbie questions.

    And 1 more related question.  Does it make sense to start a project with STMCubeMX and then import that into VisualGDB?

    Thanks

     

     

     

     

     

     

    • This reply was modified 4 years, 6 months ago by GeneM.
    • This reply was modified 4 years, 6 months ago by GeneM.
    Attachments:
    You must be logged in to view attached files.
    #25862
    support
    Keymaster

    This looks like some headers or configuration parameters might be missing in the project.

    Generally, the best way to get started would be to select “STM32CubeMX Samples” when creating a new project (see this announcement) and let VisualGDB automatically clone one of the numerous examples that come with the STM32 SDKs, so you won’t need to configure anything manually. We do check that each of those examples compiles out-of-the-box without any errors as a part of the automated pre-release tests, so there should not be any complications along the way.

    We can also help you understand various VisualGDB settings and their relation to the underlying C/C++ parameters, however unfortunately we are not able to provide help for generic C/C++ issues, or project-specific issues within our regular support (we do offer a paid consulting service with hourly billing in case you prefer personalized help).

    Regarding the STM32CubeMX, please see the following detailed tutorial: https://visualgdb.com/tutorials/arm/stm32/cube/

     

    #25872
    GeneM
    Participant

    That was the answer, for sure.  I was already trying to clone one of the SMM32 SKD examples and, now that I know where to look, VisualGDB does it for me and in a way where I can find most (maybe all) of the required include .c and .h files.  Thanks for the help.

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