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

ESP32 Harware SPI is not documneted but is recommended by compiler #1387

Open
burner- opened this issue May 8, 2022 · 4 comments
Open

ESP32 Harware SPI is not documneted but is recommended by compiler #1387

burner- opened this issue May 8, 2022 · 4 comments

Comments

@burner-
Copy link

burner- commented May 8, 2022

https://github.com/FastLED/FastLED/wiki/SPI-Hardware-or-Bit-banging tells that some of hardware support harware SPI.
With esp32 compiler says pragma message "No hardware SPI pins defined. All SPI access will default to bitbanged output"
By googling that I find tickets after tickes and frustrated people mashing their heads to wall by trying use that HW SPI. Anyway looks that there is no documentation that and most of them had find mostly workarounds. So I recommend to documents following things:

  • What defines user need to set to get it work
  • What pins are supported for that purpose.
@RudolfAtHome
Copy link

There are no comments yet for this 6-week-old entry. Is the problem that difficult to solve or describe?
I get the same message and mean that SPI is not used on the ESP32 for FastLED.

@braddo99
Copy link

I also don't yet have this working, but at least to get closer, one add a couple of defines prior to including fastled.h. This is in the comments of the pull request that added hardware SPI support for ESP32:
#1047

Like so: (but beyond that it's still not working for me, anyone have a link to a working example with hardware SPI on ESP32?)

#define FASTLED_ALL_PINS_HARDWARE_SPI
#define FASTLED_ESP32_SPI_BUS HSPI

#include <FastLED.h>
...

@Subcode
Copy link

Subcode commented Jan 9, 2023

I'm looking for an answer on this aswel. Following the advice in tickets does not work.
using it in platformio gives linker errors.

edit:

I got it working by changing changing this file: https://github.com/ntwallace/FastLED/blob/4214118d9610bd83fc8055d404fa9c0d54a31b84/platforms/esp/32/fastspi_esp32.h

and setting the following defines above the FastLED.h include:
#define FASTLED_ALL_PINS_HARDWARE_SPI
#define FASTLED_ESP32_SPI_BUS HSPI

@zackees
Copy link
Member

zackees commented Jan 9, 2023

I'm working with ESP32 and I can say that it's likely you guys are trying to use the ESP32 on either Arduino or Platformio. Both of these programs use the arduino as a component system which includes a copy of the idf toolchain which actually manages configuration, compilation, flashing and monitoring.

The issue here is that the all important sdkconfig file which manages global configuration of esp32 projects (Defines/include paths etc) is hidden from the developer and it's difficult to change. This is a major oversight of the espressif and hopefully it will be solved one day so that configs in a local setting (platformio.ini and whatever the heck arduino ide uses) will be imported into the sdkconfig file.

My advice is to try and figure out how to get access to this sdkconfig file and change it without the arduino/platformio version of the idf.py toolchain resetting it, which it loves to do.

Otherwise, it might be time to try installing the idf.py toolchain, then install the arduino as a component so that you get access to the familiar arduino library functions. Make sure you are using the idf v4.X toolchain. If you go to the 5.X series then the arduino component won't compile as of this writing.

Also, I really like the idf.py toolchain. Its pretty quick to learn and unlocks all the great features of the chip, including PSRAM, which gives you > 4MB heap. Whatever it is that you want to do, the idf.py toolchain will give you what you want. Arduino and platformio is a crap shoot for any particular feature.

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

5 participants