10000 Resolve flash address issues with SDK v3.0.0 by mhightower83 · Pull Request #8755 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Resolve flash address issues with SDK v3.0.0 #8755

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

Merged
merged 11 commits into from
Dec 19, 2022
Prev Previous commit
requested changes
  • Loading branch information
mhightower83 committed Dec 17, 2022
commit c3e22f070be1fbf5a695673c56d0d464519afe2f
14 changes: 7 additions & 7 deletions cores/esp8266/core_esp8266_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ extern "C" void ICACHE_FLASH_ATTR user_pre_init(void)
uint32_t phy_data = 0;
uint32_t rf_cal = 0;
uint32_t system_parameter = 0;
[[maybe_unused]] partition_item_t *_at_partition_table = NULL;
[[maybe_unused]] const partition_item_t *_at_partition_table = NULL;
size_t _at_partition_table_sz = 0;

do {
Expand Down Expand Up @@ -479,7 +479,7 @@ extern "C" void ICACHE_FLASH_ATTR user_pre_init(void)
// -DALLOW_SMALL_FLASH_SIZE=1
// Allows for small flash-size builds targeted for multiple devices,
// commonly IoT, of varying flash sizes.
#if !defined(FLASH_MAP_SUPPORT) & !defined(ALLOW_SMALL_FLASH_SIZE)
#if !defined(FLASH_MAP_SUPPORT) && !defined(ALLOW_SMALL_FLASH_SIZE)
// Note, system_partition_table_regist will only catch when the build
// flash size value set by the Arduino IDE Tools menu is larger than
// the firmware image value detected and updated on the fly by esptool.
Expand All @@ -497,7 +497,7 @@ extern "C" void ICACHE_FLASH_ATTR user_pre_init(void)
// .bin image.
#endif

#if FLASH_MAP_SUPPORT & defined(DEBUG_ESP_PORT)
#if FLASH_MAP_SUPPORT && defined(DEBUG_ESP_PORT)
// I don't think this will ever fail. Everything traces back to the results of spi_flash_get_id()
if (flash_size != flashchip->chip_size) {
chip_sz_str = PSTR("Flash size mismatch, check that the build setting matches the device.\n");
Expand All @@ -506,14 +506,14 @@ extern "C" void ICACHE_FLASH_ATTR user_pre_init(void)
#endif

// All the examples I find, show the partition table in the global address space.
static partition_item_t at_partition_table[] =
static const partition_item_t at_partition_table[] =
{
{ SYSTEM_PARTITION_PHY_DATA, phy_data, 0x1000 }, // type 5
{ SYSTEM_PARTITION_RF_CAL, rf_cal, 0x1000 }, // type 4
{ SYSTEM_PARTITION_SYSTEM_PARAMETER, system_parameter, 0x3000 }, // type 6
};
_at_partition_table = at_partition_table;
_at_partition_table_sz = sizeof(at_partition_table) / sizeof(at_partition_table[0]);
_at_partition_table_sz = std::size(at_partition_table);
// SDK 3.0's `system_partition_table_regist` is FOTA-centric. It will report
// on BOOT, OTA1, and OTA2 being missing. We are Non-FOTA. I don't see
// anything we can do about this. Other than maybe turning off os_print.
Expand Down Expand Up @@ -554,7 +554,7 @@ extern "C" void ICACHE_FLASH_ATTR user_pre_init(void)
ETS_PRINTF("\n\n");
// Because SDK v3.0.x always has a non-32-bit wide exception handler
// installed, we can use PROGMEM strings with Boot ROM print functions.
#if defined(DEBUG_ESP_CORE) | defined(DEBUG_ESP_PORT) // DEBUG_ESP_CORE => verbose
#if defined(DEBUG_ESP_CORE) || defined(DEBUG_ESP_PORT) // DEBUG_ESP_CORE => verbose
#if FLASH_MAP_SUPPORT
if (flash_map_str) {
ETS_PRINTF(flash_map_str);
Expand Down Expand Up @@ -654,7 +654,7 @@ extern "C" void user_init(void) {
#if defined(MMU_IRAM_HEAP)
umm_init_iram();
#endif
#if FLASH_MAP_SUPPORT & (NONOSDK < 0x30000)
#if FLASH_MAP_SUPPORT && (NONOSDK < 0x30000)
if (!flashinit()) {
panic();
}
Expand Down
0