Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails for Heltec_ESP32/examples/VMT190/tft1_9 /tft1_9.ino #175

Open
bmmcwhirt opened this issue Dec 3, 2024 · 0 comments
Open

Build fails for Heltec_ESP32/examples/VMT190/tft1_9 /tft1_9.ino #175

bmmcwhirt opened this issue Dec 3, 2024 · 0 comments

Comments

@bmmcwhirt
Copy link

I am unable to build your code.
There are numerous instances of #define constants being redefined as well as several other violations of the ISO C++ standard.

There are obviously issues with not knowing which versions of the needed libraries you using. This is a major issue with the Arduino IDE and why pretty much everyone has moved to PlatformIO.

The closest I've come to getting this to compile is with these settings. There are still some illegal type conversions and redefines. You probably need to make use of #if {definition name} to prevent redeffinitions.

[platformio.ini]

[env:heltec_wifi_lora_32]
platform = espressif32
board = heltec_wifi_lora_32_V3
framework = arduino
lib_deps = 
	https://github.com/HelTecAutomation/Heltec_ESP32.git
	adafruit/Adafruit GFX Library@^1.0
	SPI@^1.0
	Wire@^1.0
	bblanchon/ArduinoJson@^6.0

[Build output]


 *  Executing task in folder Heltec_test001: C:\Users\user\.platformio\penv\Scripts\platformio.exe run 

Processing heltec_wifi_lora_32 (platform: espressif32; board: heltec_wifi_lora_32_V3; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/heltec_wifi_lora_32_V3.html
PLATFORM: Espressif 32 (6.3.2) > Heltec WiFi LoRa 32 (V3)
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20009.0 (2.0.9) 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Library Manager: Installing SPI @ ^1.0
Warning! Could not find the package with 'SPI @ ^1.0' requirements for your system 'windows_amd64'
Library Manager: Installing Wire @ ^1.0
Warning! Could not find the package with 'Wire @ ^1.0' requirements for your system 'windows_amd64'
Found 37 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Heltec ESP32 Dev-Boards @ 2.1.2+sha.adea0f5
|-- Adafruit GFX Library @ 1.11.11
|-- ArduinoJson @ 6.21.5
|-- SPI @ 2.0.0
|-- Wire @ 2.0.0
|-- HTTPClient @ 2.0.0
|-- WiFi @ 2.0.0
Building in release mode
Compiling .pio\build\heltec_wifi_lora_32\src\main.cpp.o
Building .pio\build\heltec_wifi_lora_32\bootloader.bin
Generating partitions .pio\build\heltec_wifi_lora_32\partitions.bin
esptool.py v4.5.1
Creating esp32s3 image...
Merged 1 ELF section
Successfully created esp32s3 image.
Compiling .pio\build\heltec_wifi_lora_32\libf36\Wire\Wire.cpp.o
Compiling .pio\build\heltec_wifi_lora_32\liba03\SPI\SPI.cpp.o
Compiling .pio\build\heltec_wifi_lora_32\libf9a\Adafruit BusIO\Adafruit_BusIO_Register.cpp.o
Compiling .pio\build\heltec_wifi_lora_32\libf9a\Adafruit BusIO\Adafruit_I2CDevice.cpp.o
Compiling .pio\build\heltec_wifi_lora_32\libf9a\Adafruit BusIO\Adafruit_SPIDevice.cpp.o
In file included from .pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:10,
                 from src/main.cpp:17:
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/loramac/LoRaMac.h:141: warning: "LORA_MAC_PRIVATE_SYNCWORD" redefined
 #define LORA_MAC_PRIVATE_SYNCWORD                   0x12

In file included from .pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/ESP32_Mcu.h:13,
                 from .pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:8,
                 from src/main.cpp:17:
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/driver/sx126x.h:122: note: this is the location of the previous definition        
 #define LORA_MAC_PRIVATE_SYNCWORD                   0x1424

In file included from .pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:10,
                 from src/main.cpp:17:
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/loramac/LoRaMac.h:146: warning: "LORA_MAC_PUBLIC_SYNCWORD" redefined
 #define LORA_MAC_PUBLIC_SYNCWORD                    0x34

In file included from .pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/ESP32_Mcu.h:13,
                 from .pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:8,
                 from src/main.cpp:17:
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/driver/sx126x.h:127: note: this is the location of the previous definition        
 #define LORA_MAC_PUBLIC_SYNCWORD                    0x3444

Compiling .pio\build\heltec_wifi_lora_32\lib609\Adafruit GFX Library\Adafruit_GFX.cpp.o
Archiving .pio\build\heltec_wifi_lora_32\liba03\libSPI.a
Compiling .pio\build\heltec_wifi_lora_32\lib609\Adafruit GFX Library\Adafruit_GrayOLED.cpp.o
Compiling .pio\build\heltec_wifi_lora_32\lib609\Adafruit GFX Library\Adafruit_SPITFT.cpp.o
Compiling .pio\build\heltec_wifi_lora_32\lib609\Adafruit GFX Library\glcdfont.c.o
Compiling .pio\build\heltec_wifi_lora_32\libb90\Heltec ESP32 Dev-Boards\BH1750.cpp.o
Compiling .pio\build\heltec_wifi_lora_32\libb90\Heltec ESP32 Dev-Boards\BMP180.cpp.o
Compiling .pio\build\heltec_wifi_lora_32\libb90\Heltec ESP32 Dev-Boards\GXHTC.cpp.o
Compiling .pio\build\heltec_wifi_lora_32\libb90\Heltec ESP32 Dev-Boards\HT_Display.cpp.o
Archiving .pio\build\heltec_wifi_lora_32\libf36\libWire.a
Compiling .pio\build\heltec_wifi_lora_32\libb90\Heltec ESP32 Dev-Boards\HT_DisplayUi.cpp.o
Compiling .pio\build\heltec_wifi_lora_32\libb90\Heltec ESP32 Dev-Boards\HT_TinyGPS++.cpp.o
Compiling .pio\build\heltec_wifi_lora_32\libb90\Heltec ESP32 Dev-Boards\HT_st7735.cpp.o
src/main.cpp:51:14: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 char *ssid = "Heltec-RD";
              ^~~~~~~~~~~
src/main.cpp:52:18: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 char *password = "hunter_3120";
                  ^~~~~~~~~~~~~
Archiving .pio\build\heltec_wifi_lora_32\libf9a\libAdafruit BusIO.a
src/main.cpp: In function 'void GetWeather()':
src/main.cpp:128:18: error: too few arguments to function 'int select(int, _types_fd_set*, _types_fd_set*, _types_fd_set*, timeval*)'
   select(code_day);
                  ^
In file included from C:/Users/user/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/include/newlib/platform_include/sys/select.h:21,
                 from c:\users\user\.platformio\packages\toolchain-xtensa-esp32s3\xtensa-esp32s3-elf\sys-include\sys\types.h:50,
                 from c:\users\user\.platformio\packages\toolchain-xtensa-esp32s3\xtensa-esp32s3-elf\sys-include\stdio.h:61,
                 from C:/Users/user/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:27,
                 from .pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/LoRaWan_APP.h:6,
                 from src/main.cpp:17:
c:\users\user\.platformio\packages\toolchain-xtensa-esp32s3\xtensa-esp32s3-elf\sys-include\sys\select.h:62:5: note: declared here
 int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
     ^~~~~~
src/main.cpp:142:3: error: 'testdrawtext' was not declared in this scope
   testdrawtext(50, 100, buffer, ST7789_RED);
   ^~~~~~~~~~~~
src/main.cpp:142:3: note: suggested alternative: 'mbstate_t'
   testdrawtext(50, 100, buffer, ST7789_RED);
   ^~~~~~~~~~~~
   mbstate_t
src/main.cpp: In function 'void printLocalTime()':
src/main.cpp:175:3: error: 'testdrawtext' was not declared in this scope
   testdrawtext(140, 50, buffer, ST7789_WHITE);
   ^~~~~~~~~~~~
src/main.cpp:175:3: note: suggested alternative: 'mbstate_t'
   testdrawtext(140, 50, buffer, ST7789_WHITE);
   ^~~~~~~~~~~~
   mbstate_t
src/main.cpp: In function 'void setup()':
src/main.cpp:427:47: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   testdrawtext(0, 0, "init >>> ", ST7789_WHITE);
                                               ^
src/main.cpp:436:57: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   testdrawtext(0, 30, "Connecting to ... ", ST7789_WHITE);
                                                         ^
src/main.cpp:448:43: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
       testdrawtext(i, j, ".", ST7789_WHITE);
                                           ^
src/main.cpp:453:43: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
       testdrawtext(i, j, ".", ST7789_WHITE);
                                           ^
src/main.cpp:460:53: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   testdrawtext(0, 90, "WiFi connected", ST7789_WHITE);
                                                     ^
src/main.cpp:462:52: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
   testdrawtext(0, 120, "IP address: ", ST7789_WHITE);
                                                    ^
src/main.cpp:472:7: error: 'tasktwo' was not declared in this scope
       tasktwo,   /* Task function. */
       ^~~~~~~
src/main.cpp:481:7: error: 'taskOne' was not declared in this scope
       taskOne,   /* Task function. */
       ^~~~~~~
src/main.cpp: In function 'void tasktwo(void*)':
src/main.cpp:527:52: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     testdrawtext(140, 100, "I am a bicycle", 0x07FF);
                                                    ^
Compiling .pio\build\heltec_wifi_lora_32\libb90\Heltec ESP32 Dev-Boards\HT_st7735_fonts.cpp.o
*** [.pio\build\heltec_wifi_lora_32\src\main.cpp.o] Error 1
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp: In member function 'void HT_st7735::st7735_set_address_window(uint8_t, uint8_t, uint8_t, uint8_t)':
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp:171:33: warning: narrowing conversion of '(((int)x0) + ((int)((HT_st7735*)this)->HT_st7735::_x_start))' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
     uint8_t data[] = { 0x00, x0 + _x_start, 0x00, x1 + _x_start };
                              ~~~^~~~~~~~~~
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp:171:54: warning: narrowing conversion of '(((int)x1) + ((int)((HT_st7735*)this)->HT_st7735::_x_start))' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
     uint8_t data[] = { 0x00, x0 + _x_start, 0x00, x1 + _x_start };
                                                   ~~~^~~~~~~~~~
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp: In member function 'void HT_st7735::st7735_draw_pixel(uint16_t, uint16_t, uint16_t)':
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp:224:30: warning: narrowing conversion of '(((int)color) >> 8)' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
     uint8_t data[] = { color >> 8, color & 0xFF };
                        ~~~~~~^~~~
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp:224:42: warning: narrowing conversion of '(int)(((short unsigned int)((int)color)) & 255)' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
     uint8_t data[] = { color >> 8, color & 0xFF };
                                    ~~~~~~^~~~~~
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp: In member function 'void HT_st7735::st7735_write_char(uint16_t, uint16_t, char, FontDef, uint16_t, uint16_t)':
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp:240:42: warning: narrowing conversion of '(((int)color) >> 8)' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
                 uint8_t data[] = { color >> 8, color & 0xFF };
                                    ~~~~~~^~~~
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp:240:54: warning: narrowing conversion of '(int)(((short unsigned int)((int)color)) & 255)' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
                 uint8_t data[] = { color >> 8, color & 0xFF };
                                                ~~~~~~^~~~~~
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp:243:44: warning: narrowing conversion of '(((int)bgcolor) >> 8)' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
                 uint8_t data[] = { bgcolor >> 8, bgcolor & 0xFF };
                                    ~~~~~~~~^~~~
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp:243:58: warning: narrowing conversion of '(int)(((short unsigned int)((int)bgcolor)) & 255)' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
                 uint8_t data[] = { bgcolor >> 8, bgcolor & 0xFF };
                                                  ~~~~~~~~^~~~~~
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp: In member function 'void HT_st7735::st7735_fill_rectangle(uint16_t, uint16_t, uint16_t, uint16_t, uint16_t)':
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp:288:30: warning: narrowing conversion of '(((int)color) >> 8)' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
     uint8_t data[] = { color >> 8, color & 0xFF };
                        ~~~~~~^~~~
.pio/libdeps/heltec_wifi_lora_32/Heltec ESP32 Dev-Boards/src/HT_st7735.cpp:288:42: warning: narrowing conversion of '(int)(((short unsigned int)((int)color)) & 255)' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Wnarrowing]
     uint8_t data[] = { color >> 8, color & 0xFF };
                                    ~~~~~~^~~~~~
========================================================= [FAILED] Took 8.00 seconds =========================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant