]> granicus.if.org Git - esp-idf/commitdiff
esp_partition_mmap could map a page less than needed because it did not take the...
authorJeroen Domburg <jeroen@espressif.com>
Mon, 3 Jul 2017 10:00:25 +0000 (18:00 +0800)
committerJeroen Domburg <jeroen@espressif.com>
Mon, 3 Jul 2017 10:02:28 +0000 (18:02 +0800)
components/spi_flash/partition.c

index 94d6ff6a66c34780a58d7b9bab52870ff4baeb38..1c3ac610fa2ac5143fdbf9138ec7686db52f4fb3 100644 (file)
@@ -315,7 +315,7 @@ esp_err_t esp_partition_mmap(const esp_partition_t* partition, uint32_t offset,
     // offset within 64kB block
     size_t region_offset = phys_addr & 0xffff;
     size_t mmap_addr = phys_addr & 0xffff0000;
-    esp_err_t rc = spi_flash_mmap(mmap_addr, size, memory, out_ptr, out_handle);
+    esp_err_t rc = spi_flash_mmap(mmap_addr, size+region_offset, memory, out_ptr, out_handle);
     // adjust returned pointer to point to the correct offset
     if (rc == ESP_OK) {
         *out_ptr = (void*) (((ptrdiff_t) *out_ptr) + region_offset);