PhilippMolitor / waveshare-rp2040-roundlcd-boilerplate

A PlatformIO project to get started with the Waveshare RP2040 with the 1.28" round LCD display. Includes a driver for the IMU, as well as a display driver implementation with LovyanGFX.
20 stars 9 forks source link

Compile error questions #3

Closed AndreasSchutz closed 2 weeks ago

AndreasSchutz commented 2 weeks ago

Hi

Putting this question here as an issue... not sure if that is good...feel free to remove this if you dislike. My idea was that more could benefit from the answer.

I'm trying to extend my knowledge about the waveshare-rp2040-roundlcd. When I try to compile your code after download, I get some compile errors that I can't fix in the LovyanGFX library.


.pio/libdeps/release/LovyanGFX/src/lgfx/v1/platforms/rp2040/common.cpp:78:56: error: use of enum 'gpio_function' without previous declaration 78 | bool lgfx_gpio_set_function(int_fast16_t pin, enum gpio_function fn) | ^~~~~ Compiling .pio/build/release/lib405/LovyanGFX/lgfx/v1/touch/Touch_STMPE610.cpp.o *** [.pio/build/release/lib405/LovyanGFX/lgfx/v1/platforms/rp2040/common.cpp.o] Error 1

Environment Status Duration


debug FAILED 00:00:03.328 release FAILED 00:00:03.921

Did you also get that? How was it fixed?

Trying to compile using PlatformIO Core, version 6.1.16 I tried changing library LovyanGFX to version 1.1.16 (because there where similar problems for others) to no avail.

Grateful for any piece to the puzzle. Thanks!

PhilippMolitor commented 2 weeks ago

Thanks for bringing that up! I did not encounter that error yet. Not sure why this is happening, but as you noticed yourself it comes from inside the LGFX library, and it looks like some light HAL abstraction...

I just tried to compile a fresh copy, no issues there.

AndreasSchutz commented 2 weeks ago

Hi and thanx for the quick feedback.

Do you have the compile error now? What was the last mix of versions that you could compile? Would love to bring the RP2040 to use.

PhilippMolitor commented 2 weeks ago

Did you change any of the compiler flags or target definitions?

AndreasSchutz commented 2 weeks ago

I tried different targets after a while...but basically just a clean "pio run" gives me two errors;

Compiling .pio/build/debug/lib66a/LovyanGFX/lgfx/v1/platforms/spresense/Bus_SPI.cpp.o .pio/libdeps/debug/LovyanGFX/src/lgfx/v1/platforms/rp2040/common.cpp:78:56: error: use of enum 'gpio_function' without previous declaration 78 | bool lgfx_gpio_set_function(int_fast16_t pin, enum gpio_function fn) | ^~~~~ .pio/libdeps/debug/LovyanGFX/src/lgfx/v1/platforms/rp2040/common.cpp: In function 'bool lgfx::v1::{anonymous}::lgfx_gpio_set_function(int_fast16_t, int)': .pio/libdeps/debug/LovyanGFX/src/lgfx/v1/platforms/rp2040/common.cpp:92:16: error: 'iobank0_hw_t' does not name a type; did you mean 'io_bank0_hw_t'? 92 | volatile iobank0_hw_t iobank0_regs = reinterpret_cast<volatile iobank0_hw_t >(IO_BANK0_BASE); | ^~~~ | io_bank0_hw_t .pio/libdeps/debug/LovyanGFX/src/lgfx/v1/platforms/rp2040/common.cpp:93:7: error: 'iobank0_regs' was not declared in this scope; did you mean 'iobank0_hw'? 93 | iobank0_regs->io[pin].ctrl = fn << IO_BANK0_GPIO0_CTRL_FUNCSEL_LSB; | ^~~~ | iobank0_hw

Where I got around the "iobank" error by following the recommendation ('io_bank0_hw_t') but not sure that was a good thing to do.

Like I said... any tip that makes it compile is great!

AndreasSchutz commented 2 weeks ago

And yes.. I try to compile this on an OpenSuSE tumbleweed cli... if that could be an ingredient in the wok! :-D

PhilippMolitor commented 2 weeks ago

sadly i cannot really tell if this is related to this boilerplate.. can you create a MVP project for your target and see if lovyangfx compiles there?

if not, maybe open an issue at the LovyanGFX repo.

SHWotever commented 2 weeks ago

Hi !

I had the same issue, it's indeed tied to the newest rp2040 core. https://github.com/lovyan03/LovyanGFX/issues/613

To workaround it in the wait the fix is fully public you can use the develop branch : https://github.com/lovyan03/LovyanGFX.git#develop

image

PhilippMolitor commented 2 weeks ago

Thanks for sharing that!