November 10, 2018 at 13:01 #22660
Hello, our embedded team (5 peoples) seeking for IDE for commercial development (we used SW4STM32 that often crashes), and now I test VisualGDB 5.3/5.4, 6 days of evaluation period remains. When I make migration of project from SW4STM32 to VisualGDB i see many errors like:C++1"DMA_HandleTypeDef was not declared in this scope" - many timesC++1"HAL_LockTypeDef does not name a type; did you mean SAI_Block_TypeDef?" - many timesC++1"HAL_StatusTypeDef does not name a type; did you mean HAL_NOR_StatusTypeDef?" - many times
MCU is STM32F746BG, HAL library of project is older than HAL in VisualGDB packages, so I dont check that package in project settings and use HAL in our project. Its version is V1.1.0, 22-April-2016. Changing build system (MSBuild or GNU Make) dont solve problems.
Please help us to port our project to VisualGDB correctly, we hope to work with your product and buy it.
Our product includes these frameworks and libraries: fatfs, touchgfx, ST usb-host library, ST HAL library and FreeRTOS v8.
Also, please add feature to allow change names of sections of the user-defined memory regions from “Additional memories”, now I can change only region name, but I want to change names of all sections in that region (for ex. section .qspi_text in QSPI region). Thats is for touchgfx, where section named different.
And in VisualGDB the _WIN32 macro constant is equal to 1, so FatFS attempt to include <windows.h> and <tchar.h> to my project, what cause errors. _WIN32 must equal to 0.
And for solving configMAX_PRIORITIES problem i had to edit FreeRTOSConfig.h (change macro definition of configMAX_PRIORITIES from its default to “(7U)”)
And for proper FreeRTOS port.c compilation i had to switch FP support from software to hardware, because there was asm keywords like “vstmdbeq” that dont compile with SoftFP mode, but in SW4STM32 it compiles good (in SW4STM32 there are SoftFP in our project). Good that TouchGFX have two variants of its static lib – for softFP and for hardFP support.November 10, 2018 at 17:12 #22665
No problem, we can help you. First of all, please try to narrow down the problem to a specific source file (you can compile just one source by pressing Ctrl-F7 if using MSBuild). Then build just that file and check the error list (please turn off IntelliSense errors for the beginning and only look at build errors).
If you see a “header file not found” errors before the “DMA_HandleTypeDef” error, please locate the missing headers and add the corresponding paths to the project’s include directories. If no such errors are shown, please enable the “generate preprocessor output” option for that source file via Visual Studio Project Properties -> C/C++ -> Outputs and check the preprocessor output (.E file in the VisualGDB\Debug folder). It should list all headers included while building the file and the lines from those headers that were not #ifdef’ed out. If DMA_HandleTypeDef is not defined there, it might be due to including an incorrect header file, missing some HAL_XXX_ENABLED macros, that would exclude the actual definition, or missing #include<> directives altogether. If you need further help with this, please let us know your findings (build error messages, preprocessed file contents, etc) and we will provide further help.
We will consider supporting more detailed fine-tuning of additional memories in the next releases of VisualGDB. As a workaround, please consider adding any other memory (so that VisualGDB creates a local copy of the linker script) and then manually adding the QSPI sections there. Also if you already have a working GCC-based project in a different IDE, please consider simply copying an existing linker script from it and setting it via VisualGDB Project Properties. This should provide easier transition, as it will eliminate the differences between the linker scripts.
The _WIN32 macro is only shown if you are using the regular VC++ IntelliSense. Please consider switching to VisualGDB-provided Clang IntelliSense for better compatibility with GCC-specific code. Regarding FreeRTOS, if you were using the HAL/FreeRTOS packages that come with VisualGDB, it would display a more meaningful error message in case of HW/SW floating point incompatibility (we have added a check with an #error directive to our version of port.c), but using an incompatible 3rd-party copy of it unfortunately indeed results in cryptic error messages.November 12, 2018 at 10:44 #22673
Thanks a lot! I was able to run and debug my firmware with hard FP, both MSBuild and GNU Make systems. The problem was that one of TouchGFX hadrware file dont includes “stm32f7xx_hal.h”, but includes “stm32f7xx_sdram.h”, etc. Another problem was that I not add USE_FREERTOS8 to project macro definitions.
Also, i found a bug: if i try to abort flash downloading by clicking cancel button after some time, if file is too big, VS will crash. In that situation the file was big because I forgot to call your arm-eabi-objcopy.exe that I now use to divide output .elf to two files: binary for internal flash and binary for external microSD card, and delete big external flash constant data from .elf file. Now I finished it by your Custom build steps->After building, where I set up 4 different objcopy executes. Please add feature to save all custom build steps in one file, not only in many single action files (one file to one action) because its easy to get confused here, and add warning message if filenames match. Also I noticed that MSBuild is faster than GNU Make isnt it? I would like to write an article on porting the TouchGFX project on VisualGDB (also as an example of porting complex projects to VGDB).November 12, 2018 at 19:16 #22690
Good to know it works. We should be able to fix the crash with aborting the FLASH downloading if you could obtain the context of the crash as described here (alternatively we would need a detailed description of your configuration, as FLASH can be programmed using several different mechanisms and it’s hard to say which one is causing the crash).
We are actually working on a redesigned system of custom actions for the upcoming VisualGDB 5.4, that will include better support for reusing the actions.
MSBuild is indeed faster than GNU Make – we have spent considerable effort optimizing our MSBuild backend, so it uses heavy parallelization and minimizes the overhead of auxiliary tasks like managing dependencies.
The idea of writing an article about ToughGFX sounds great – feel free to share a link to it on our forum.November 14, 2018 at 10:13 #22703
How to disable that dotted style text when I use clang advanced Intellisense? It is very uncomfortable.November 14, 2018 at 19:42 #22708
Please use the following setting: Tools->Options->Text Editor->C/C++ (VisualGDB)->Other->Max. change-driven tags.
Simply set it to 0 in order to disable rename-triggered smart tags.November 20, 2018 at 14:46 #22776
I found another error in Clang, When clang finish project analyze, it sometimes highlights a field on 8 text lines below than cursor position line. As you see, I put cursor on “PneumaticSystem_AirPressure”, but clang highlight “EmEngineOilPressure”. If in that situation I change cursor position, highlighted line also changes its position accordingly to (cursor position + 8) lines. Generally, language plugin works fine, it quickly show popup with >2600 links of “uint8_t” type.November 20, 2018 at 21:26 #22786
It looks like VisualGDB loses synchronization between the source file contents in the VS editor and the contents as seen by the Clang engine.
Could you please check if closing the source file and reopening it solve the problem? Also is it specific to a certain source file, or does it occur randomly across the entire code base?November 21, 2018 at 08:51 #22795
Reopening file dont solve problem, switching to another intellisense engine and back dont solve problem. Reopening VisualStudio dont soilve problem. Problem starts in 217 line of code with cursor/highlight difference equal to 1. In according to consecutively written lines block size, the difference changes form 1 to 8. When I put cursor on single string, it will not highlight, because second string that should be highlighted not exist.
The problem seen only in one big file (700 lines of code, 50 commented lines). I put screenshots with problem.
UPDATE: Now I was distracted by another job for 15 minutes and the problem somehow miraculously disappeared even in big files.November 21, 2018 at 20:03 #22803
Thanks for the detailed description. Most likely this is caused by some invisible characters near the line breaks that are interpreted differently by VS and by Clang.
If you ever get this problem again, you might be able to reduce it as follows:
- Add a line “void testfunc();” at the beginning of the source file (after #include-s)
- Replace each of the problematic line contents (without touching the area near the ending of the line) with a call to testfunc().
- Confirm that the problem persists.
- Delete all lines between the declaration of testfunc() and the problematic lines, and also all lines after it
- Remove references to your #include-d files.
If the problem can be still reproduced after reducing it to the test code, simply send us the repro file and we will check for the characters causing it and should be able to add a workaround.November 23, 2018 at 06:41 #22831
Hi, I created an example project based on HAL LEDBlink. It reproduce advanced clang intellisense bug, and I think, it associated with cyrillic symbols in code comments.
To reproduce bug behavior you should:
- Write big multiline code block (>15 strings), there is need to make some strings unique to show wrong highlighting.
- Write russian comment on top or middle of that code block
- Close the file with [X] button on visual studio tabs, in promt window (Save file?) choose “Yes”.
- Open another file
- Open first file and try put cursor on line in big multiline code block.
- Highlighted entity or string does not match with line of cursor position.
I send my test project in archive.November 23, 2018 at 21:21 #22872
Thanks, looks like you are using a single-byte encoding for international characters that is not properly supported by the Clang engine. Please consider saving your source files in the UTF-8 encoding instead (via File->Save As).November 26, 2018 at 10:28 #22889
Yes, it works! Thanks!
Why “Updating cache” restarts if I changed one symbol in code, or write ” “? Its slow for that frequently calling. How to tell it that it should preprocess only changes of all code, not entire code files?November 26, 2018 at 17:01 #22892
Good to know it works. The IntelliSense cache uses incremental snapshots, so it will normally only reparse the changed files (if you are editing a header file included from multiple source files, it will invalidate all of those source files).
If you believe too many files are re-cached, please try the following:
December 6, 2018 at 13:41 #22987
- Open Clang IntelliSense Diagnostics Console and clear the log
- Edit one file and trigger the cache rebuild
- Let us know the file you edited and share the output shown in the Diagnostics Console. It should normally mention why the cache is being rebuilt, so we can help you understand what is going on.
You right, no problem with that.
I found another: when visual studio writes “5 references” after i scroll window up and back, but actually filterMA have only 3 references in project. If I click on this text “5 references”, then switch information to “Calls” and then back to “References”, the text updates to “3 references”, that is right for my project. Maybe if I scroll window it counts all strings in popup window, include hierachical nodes.
You must be logged in to reply to this topic.