maxgerhardt / pio-esp-adf-example

An example how to use ESP-ADF with PIO.
28 stars 14 forks source link

error: 'CONFIG_D2WD_PSRAM_CLK_IO' undeclared #3

Closed don41382 closed 4 years ago

don41382 commented 4 years ago

I am pretty new to esp-idf / esp-adf development. I always walked in the safe Arduino waters, now it's time to move on ;-)

I tried to compile your project, but it's missing definition CONFIG_D2WD_PSRAM_CLK_IO.

~/.platformio/packages/framework-espidf/components/esp32/spiram_psram.c: In function 'psram_enable':
~/.platformio/packages/framework-espidf/components/esp32/spiram_psram.c:119:36: error: 'CONFIG_D2WD_PSRAM_CLK_IO' undeclared (first use in this function)
 #define D2WD_PSRAM_CLK_IO          CONFIG_D2WD_PSRAM_CLK_IO  // Default value is 9

I had to add the following definition to the sdkconfig.h

#define CONFIG_D0WD_PSRAM_CLK_IO 17
#define CONFIG_D0WD_PSRAM_CS_IO  16

#define CONFIG_D2WD_PSRAM_CLK_IO 9
#define CONFIG_D2WD_PSRAM_CS_IO 10

#define CONFIG_SPIRAM_SPIWP_SD3_PIN 18

Do you know why they are needed?

maxgerhardt commented 4 years ago

This probably comes from a mismatch of the sdkconfig.h with the latest ESP-IDF requierments since the project was created using ana older esp-idf version. Removing sdkconfig.h should also recreate it according to the newest options. Can you confirm whether this fixes the issue too?

don41382 commented 4 years ago

I deleted sdkconfig.h and got generated on compile time.

Still the same error.


~/.platformio/packages/framework-espidf/components/esp32/spiram_psram.c: In function 'psram_enable':
~/.platformio/packages/framework-espidf/components/esp32/spiram_psram.c:119:36: error: 'CONFIG_D2WD_PSRAM_CLK_IO' undeclared (first use in this function)```
maxgerhardt commented 4 years ago

You're right, that's because those build flags are put into via the platformio.ini when SPI RAM needs to be enabled. But these flags are missing that requiered flag due to targeting an older version.

https://github.com/maxgerhardt/pio-esp-adf-example/blob/64fc26200d2c0a731c57e09e70ac535c0c72a689/platformio.ini#L12-L26

I will add your defined pins in there as a fix.

don41382 commented 4 years ago

thanks for fixing!