Skip to content

esp32-hal-spi.c doesn't compile with 3.2.0 #528

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

Closed
lucadentella opened this issue Apr 7, 2021 · 8 comments
Closed

esp32-hal-spi.c doesn't compile with 3.2.0 #528

lucadentella opened this issue Apr 7, 2021 · 8 comments

Comments

@lucadentella
Copy link

lucadentella commented Apr 7, 2021

Hi!

I've recently updated the platform to release 3.2.0 and my code doesnt' compile:

C:\Users\luca\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-spi.c: In function 'spiTransferBytesNL':
C:\Users\luca\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-spi.c:922:39: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
                 uint8_t * last_out8 = &result[c_longs-1];
                                       ^
C:\Users\luca\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-spi.c:923:40: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
Compiling .pio\build\lolin32\FrameworkArduino\main.cpp.o
                 uint8_t * last_data8 = &last_data;

If I revert to 3.1.1, everything works fine.
Thanks

@valeros
Copy link
Member

valeros commented Apr 8, 2021

Hi @lucadentella ! Is there any chance you have the -Werror flag in your configuration?

@lucadentella
Copy link
Author

Hi @valeros

thanks! yes, I had -Werror:

build_flags =
    -Werror

if I comment that flag out, I can compile my code (the error is now a warning):

C:\Users\luca\.platformio\packages\framework-arduinoespressif32\cores\esp32\esp32-hal-spi.c:922:39: warning: initialization from incompatible pointer 
type [-Wincompatible-pointer-types]
                 uint8_t * last_out8 = &result[c_longs-1];

is it an expected behavior?
Thanks

@valeros
Copy link
Member

valeros commented Apr 8, 2021

Yes, I guess that's expected behavior. The warning comes from the framework itself and the reason why it's not visible in the Arduino IDE is because they use -w flag that suppresses all warnings.

@Blend3rman
Copy link

@valeros It seems like arduino-esp32 has fixed this bug in April 2021? Can this simple change to esp-hal-spi.c be applied to the platformio codebase as well?

@kernelpanic85
Copy link

kernelpanic85 commented Feb 28, 2022

I have this same issue when compiling with ESPHome and espressif 3.5. I second @Blend3rman, can the simple fix from arduino-esp32 be included in this codebase or bumped to use the new 2.0+ framework @valeros?

@FPMilan
Copy link

FPMilan commented Nov 6, 2022

Compiling hangs for me also on this warning, is there a solution yet?

@Jason2866
Copy link
Contributor

@FPMilan Yes, use latest framework.

@FPMilan
Copy link

FPMilan commented Nov 6, 2022

thanks @Jason2866 just rerunning it solved it at some point

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

No branches or pull requests

6 participants