ESP32-S3 LilyGO AmoLED

I am trying to wrap my head around why I get this error. Watching Volos project Youtube video on the Lilygo ESP32 AmoLED display. I have Arduino IDE 2.2 installed. I download the simple Hello World sketch and I get an error in the video driver rm67162.cpp.

here is the error

Compilation error: narrowing conversion of '(((int)x1) >> 8)' from 'int' to 'uint8_t' {aka 'unsigned char'} inside { } [-Werror=narrowing]

Downgraded to Arduino ver 1.8.18 the sketch works fine

WTF
What am I missing

Hi @msousa1

Please do this:

  1. Select File > Preferences (or Arduino IDE > Settings... for macOS users) from the Arduino IDE 2.2 menus.
  2. Take note of the setting of the "Compiler warnings" preference.
  3. Repeat the above steps using Arduino IDE 1.8.18

Is there a difference between the settings of the "Compiler warnings" preference between the two IDE versions? If so, that is likely the reason for the different results; nothing to do with the IDE version.

The ESP32 boards platform is unique in that the compilation result is affected by the setting of Arduino IDE's "Compiler warnings" preference.

Traditionally this preference has only influenced how many warnings we see in the compilation output, but the Arduino boards platform framework allows each platform developer to decide exactly what effect they want each of the levels of this preference to have. The ESP32 developers decided to add the -Werror=all flag to the compilation command when you set the "Compiler warnings" preference to the "More" or "All" levels. This flag causes compilation to fail when the sketch code produces a compilation warning.

There are two possible approaches to resolve the error:

Fix Warnings

The ESP32 developers configured their boards platform this way to encourage writing code that does not produce warnings. Compiler warnings often indicate a problem with the code so it is a good idea to pay attention to them and fix them.

Even in cases where the warning does not indicate a problem in the code, an accumulation of such warnings makes it difficult to spot the significant warnings in the output so it is a good idea to adjust the code to suppress these warnings as well.

If you would like advice on how to best address specific warnings produced by your code, the helpers here can assist with that.

You may find that some warnings come from code you didn't write (e.g., a library used by your sketch). If you decide to fix those warnings, it's a good idea to submit the fix to the source of the code (e.g., a pull request to the GitHub repository where it is hosted). This benefits you by avoiding having to fix the warnings all over again whenever you update to a new release of the code. This will also benefit all the other users of the code.

Reduce Warning Level

You should pay attention to warnings and fix them in your own code whenever possible. Unfortunately you may find that some warnings come from code you didn't write (e.g., a library used by your sketch). These warnings can also be fixed, but you may decide that it isn't worth the effort to fix problems in other people's code. If so, you can reduce the level of the "Compiler warnings" preference to avoid the warnings causing a compilation error:

  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Select "Default" from the "Compiler warnings" menu in the "Preferences" dialog.
  3. Click the "OK" button.

Thanks so much for your quick and accurate solution.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.