ESP32 – PreprocessorDefinitions does not compile

Sysprogs forums Forums VisualGDB ESP32 – PreprocessorDefinitions does not compile

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #20235
    flodis
    Participant

    Runing Microsoft Visual Studio Community 2017  Version 15.5.7  using VisualGDB 5.3 in Win7-64 and trying to compile the blink sample – much like in this sample https://visualgdb.com/tutorials/esp32/

    The strange thing is I get a few compile errors regarding some GCC settings automatically derived from the board support package (BSP) and found in the esp32.props project file

    Compiler complains about

    1>C:/SysGCC/esp32/esp32-bsp/esp-idf/components/esp32/system_api.c: In function 'esp_get_idf_version':
     1><command-line> : error : incompatible types when returning type 'double' but 'const char *' was expected
     1>C:\SysGCC\esp32\esp32-bsp\esp-idf\components\esp32\system_api.c(347,12): note : in expansion of macro 'IDF_VER'
     1> return IDF_VER;

    and

    1>C:\SysGCC\esp32\esp32-bsp\esp-idf\components\mbedtls\library\aesni.c(30,10): error : #include expects "FILENAME" or <FILENAME> 
    1> #include MBEDTLS_CONFIG_FILE

    and also a C compiler problem in vfs_uart.c  with  – Error “initializer element is not constant”  so I changed the code! to use a #define as  the initial code “const int NONE = -1;” is const only in C++ (Probably a compiler directive missing but not being an expert – what do you do?) :

    #define NONE -1
    static int buffered_char = NONE;
    if (buffered_char != NONE) {
    if (buffered_char =='\r'&& c =='\n') {
    buffered_char = NONE;
    ...

    Anyway the first two problems was eliminated by enclosing the string variables in esp32.props with single quotes (‘)</div>

    <PreprocessorDefinitions>HAVE_CONFIG_H;MBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"';ESP_PLATFORM;IDF_VER='"2.1"';%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>

    Why did I have to endure this?

    And secondly – Does anyone have a working sample on how to successfully upload the binary to the ESP32 using the espressif <b>esptool.py</b>? I sort of get it working, but with random results for every upload attempt and not sure about memory allocation.</div>

    • This topic was modified 6 years, 1 month ago by support. Reason: formatting
    #20236
    flodis
    Participant

    ..It is easier to edit your posts in https://stackoverflow.com. Why?

    #20245
    support
    Keymaster

    Hi,

    This looks like you are using GNU Make; please try creating an MSBuild-based project instead – it should have all arguments escaped properly. We are also working on an experimental ESP-IDF-based project subsystem that will eliminate the need to use a separate BSP and will be able to display the ESP-IDF project structure directly in Solution Explorer. Once we release a preview build with this feature (1-2 weeks from now), we will recommend using it as the primary way of building ESP32 projects.

    Regarding esptool.py, VisualGDB can do this automatically if you select “UART (program only)” in the debug method. VisualGDB can’t debug ESP32 devices over UART yet, however it will automatically invoke esptool.py to program your firmware.

    #20249
    flodis
    Participant

    Oki,

    The esp32.props file has a header <Project ToolsVersion=”4.0″ xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″&gt;

    And the VisualGDB project has an MSBuild tab. Could it still be GCC?

    If only weeks away, it sounds like a much better idea to be able to adapt directly to the ESP-IDF being in rapid development. Looking forward to trying the new concept as soon as it is released.

    Attachments:
    You must be logged in to view attached files.
    #20256
    support
    Keymaster

    Hi,

    This does look like a valid MSBuild-based project, so it should normally work (the problems you described are very similar to what happens when trying to generate a regular Makefile-based project). Please double-check that you are using the latest VisualGDB 5.3R8.

    Either way, we can help you get this to work if you could let us know how you created the project, or you could simply wait 1-2 weeks for a preview build with the new ESP-IDF advanced project subsystem that will eliminate the need to use the BSP infrastructure that constantly gets out-of-sync with the rapidly changing ESP-IDF.

     

    #20297
    flodis
    Participant

    Thank You,

    That would be much appreciated. I wanted to use the latest BLE advancements in the ESP32-IDF and thought maybe I turn to Eclipse while you work on the project subsystem.

    Kind of ranting but i think someone has to say no to poor solutions..

    My experience is that to fulfill ESP-IDF for Windows and IDE like Eclipse I had to bring in all the tools familiar to Linux developers made in the last 15 years.  My life is then spent in various blends of terminal windows and when finished you can hardly even build from within Eclipse. Bluetooth development has a high degree of complexity, but I never get there. Instead I end up dealing with if paths have slashes to the right or left or if a drive letter has a colon or not. Things that Bill Gates and his team created/caused the two first weeks after Microsoft was founded. What tools you install seems to be based on which can handle windows paths.

    So it is 2018 and we are cloud based and still on a level where you can not to tell programs where files are located.

    After installing all the tools in the world it is like moving back to 1985. I started to think – as this is no longer Windows, maybe I install a Linux environment and do what everyone else does?

    Please hurry with the project subsystem and grab me by my feet to pull me out of this mess.

     

    P.S My system builds fine in VS2017 and VGDB 5.3 and uploads to an ESP32 in less than 2 seconds. I just want to use the latest ESP-IDF and possibly stay up to date cloning the ESP-IDF repository now and then.

    #20302
    support
    Keymaster

    Hi,

    OK, we have released v5.4 Preview 1 that supports the new advanced ESP-IDF project subsystem. You can download the build here. You can read the announcement with the main highlights of the new subsystem here: https://sysprogs.com/w/announcing-visualgdb-5-4-preview-1/.

    • This reply was modified 6 years ago by support.
Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.