Skip to content

Commit

Permalink
Add support for building esp32 demo under IDF 5.x (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
anujdeshpande authored Apr 22, 2024
1 parent 24305a9 commit 77801ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion demos/esp32_spi_flash/components/FlashDB/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
idf_component_register(SRCS "porting/fal_flash_esp32_port.c"
INCLUDE_DIRS "inc" "../../../../port/fal/inc"
REQUIRES "spi_flash")
REQUIRES "spi_flash" "esp_partition" "esp_rom")
8 changes: 6 additions & 2 deletions demos/esp32_spi_flash/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#include "esp_flash_spi_init.h"
#include "spi_flash_mmap.h"
#include "esp_chip_info.h"

#include <flashdb.h>

Expand Down Expand Up @@ -144,8 +146,10 @@ void app_main()
chip_info.cores);

printf("silicon revision %d, ", chip_info.revision);
uint32_t size_flash_chip;
esp_flash_get_size(NULL, &size_flash_chip);

printf("%dMB %s flash\n", spi_flash_get_chip_size() / (1024 * 1024),
printf("%ldMB %s flash\n", size_flash_chip / (1024 * 1024),
(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");

flashdb_demo();
Expand Down

0 comments on commit 77801ce

Please sign in to comment.