Merge branch 'bugfix/ESP_PARTITION_TABLE_OFFSET' into 'master'

spi_flash: Fix error unit tests on host

See merge request idf/esp-idf!2573
pull/2093/head
Ivan Grokhotkov 2018-06-19 19:13:30 +08:00
commit 7933b75416
3 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -17,11 +17,12 @@
#include "esp_err.h"
#include "esp_flash_data_types.h"
#include <stdbool.h>
#include "sdkconfig.h"
/* Pre-partition table fixed flash offsets */
#define ESP_BOOTLOADER_DIGEST_OFFSET 0x0
#define ESP_BOOTLOADER_OFFSET 0x1000 /* Offset of bootloader image. Has matching value in bootloader KConfig.projbuild file. */
#define ESP_PARTITION_TABLE_OFFSET CONFIG_PARTITION_TABLE_OFFSET /* Offset of partition table. */
#define ESP_PARTITION_TABLE_OFFSET CONFIG_PARTITION_TABLE_OFFSET /* Offset of partition table. Backwards-compatible name.*/
#define ESP_PARTITION_TABLE_MAX_LEN 0xC00 /* Maximum length of partition table data */
#define ESP_PARTITION_TABLE_MAX_ENTRIES (ESP_PARTITION_TABLE_MAX_LEN / sizeof(esp_partition_info_t)) /* Maximum length of partition table data, including terminating entry */

Wyświetl plik

@ -22,6 +22,7 @@
#include <vector>
#include <string>
#include "sdkconfig.h"
#include "esp_flash_data_types.h"
using namespace std;
@ -59,7 +60,7 @@ void SpiFlash::init(size_t chip_size, size_t block_size, size_t sector_size, siz
ifd.read(buffer.data(), size);
memcpy(&this->memory[ESP_PARTITION_TABLE_ADDR], buffer.data(), buffer.size());
memcpy(&this->memory[CONFIG_PARTITION_TABLE_OFFSET], buffer.data(), buffer.size());
}
void SpiFlash::deinit()

Wyświetl plik

@ -1,2 +1,3 @@
#pragma once
#define CONFIG_PARTITION_TABLE_OFFSET 0x8000