Skip to content

Commit

Permalink
spi_flash: support working on differnt buses and frequency
Browse files Browse the repository at this point in the history
  • Loading branch information
ginkgm authored and espressif-bot committed Jun 18, 2019
1 parent ce4de86 commit 1036a09
Show file tree
Hide file tree
Showing 52 changed files with 3,975 additions and 1,728 deletions.
6 changes: 6 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,12 @@ UT_001_43:
- ESP32_IDF
- UT_T1_1

UT_001_44:
<<: *unit_test_template
tags:
- ESP32_IDF
- UT_T1_1

UT_002_01:
<<: *unit_test_template
tags:
Expand Down
11 changes: 11 additions & 0 deletions components/bootloader_support/include/esp_flash_partitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ inline static __attribute__((deprecated)) esp_err_t esp_partition_table_basic_ve
{
return esp_partition_table_verify(partition_table, log_errors, num_partitions);
}

/**
* Check whether the region on the main flash is safe to write.
*
* @param addr Start address of the region
* @param size Size of the region
*
* @return true if the region is safe to write, otherwise false.
*/
bool esp_partition_main_flash_region_safe(size_t addr, size_t size);

#ifdef __cplusplus
}
#endif
10 changes: 6 additions & 4 deletions components/esp32/cpu_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "sdkconfig.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#include "spi_flash_lowlevel.h"
#include "esp_flash.h"
#include "nvs_flash.h"
#include "esp_event.h"
#include "esp_spi_flash.h"
Expand Down Expand Up @@ -389,9 +389,10 @@ void start_cpu0_default(void)
spi_flash_init();
/* init default OS-aware flash access critical section */
spi_flash_guard_set(&g_flash_guard_default_ops);
/* Todo the following needs to be properly integrated */
esp_flash_low_level_app_init();
esp_flash_init_default_chip();

esp_flash_app_init();
esp_err_t flash_ret = esp_flash_init_default_chip();
assert(flash_ret == ESP_OK);
#ifdef CONFIG_PM_ENABLE
esp_pm_impl_init();
#ifdef CONFIG_PM_DFS_INIT_AUTO
Expand All @@ -403,6 +404,7 @@ void start_cpu0_default(void)
esp_pm_configure(&cfg);
#endif //CONFIG_PM_DFS_INIT_AUTO
#endif //CONFIG_PM_ENABLE

#if CONFIG_ESP32_ENABLE_COREDUMP
esp_core_dump_init();
size_t core_data_sz = 0;
Expand Down
1 change: 1 addition & 0 deletions components/esp_common/include/esp_err.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef int32_t esp_err_t;

#define ESP_ERR_WIFI_BASE 0x3000 /*!< Starting number of WiFi error codes */
#define ESP_ERR_MESH_BASE 0x4000 /*!< Starting number of MESH error codes */
#define ESP_ERR_FLASH_BASE 0x6000 /*!< Starting number of flash error codes */

/**
* @brief Returns string for esp_err_t error codes
Expand Down
2 changes: 2 additions & 0 deletions components/fatfs/test_fatfs_host/sdkconfig/sdkconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
#define CONFIG_LOG_DEFAULT_LEVEL 3
#define CONFIG_PARTITION_TABLE_OFFSET 0x8000
#define CONFIG_ESPTOOLPY_FLASHSIZE "8MB"
//currently use the legacy implementation, since the stubs for new HAL are not done yet
#define CONFIG_SPI_FLASH_USE_LEGACY_IMPL
2 changes: 2 additions & 0 deletions components/soc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ list(APPEND COMPONENT_SRCS "src/memory_layout_utils.c"
"src/hal/spi_slave_hal.c"
"src/hal/spi_slave_hal_iram.c"
"src/soc_include_legacy_warn.c"
"src/hal/spi_flash_hal.c"
"src/hal/spi_flash_hal_iram.c"
)

set(COMPONENT_ADD_LDFRAGMENTS linker.lf)
Expand Down
Loading

0 comments on commit 1036a09

Please sign in to comment.