"vscode:/vscode.git/clone" did not exist on "41075202489c1327777e94947a1be324860ec20b"
Commit 484a7721 authored by h2zero's avatar h2zero Committed by Johny Mattsson
Browse files

Ensure flash address is set before obtaining memory mapped address.

Before this change the struck member add_phys would contain random data and the call to spi_flash_phys2cache
could return an incorrect memory address.
parent c75ec760
...@@ -31,8 +31,8 @@ bool lfs_get_location(lfs_location_info_t *out) ...@@ -31,8 +31,8 @@ bool lfs_get_location(lfs_location_info_t *out)
return false; // Nothing to do if no LFS partition available return false; // Nothing to do if no LFS partition available
out->size = part->size; // in bytes out->size = part->size; // in bytes
out->addr_mem = spi_flash_phys2cache(out->addr_phys, SPI_FLASH_MMAP_DATA);
out->addr_phys = part->address; out->addr_phys = part->address;
out->addr_mem = spi_flash_phys2cache(out->addr_phys, SPI_FLASH_MMAP_DATA);
if (!out->addr_mem) { // not already mmap'd, have to do it ourselves if (!out->addr_mem) { // not already mmap'd, have to do it ourselves
spi_flash_mmap_handle_t ignored; spi_flash_mmap_handle_t ignored;
esp_err_t err = spi_flash_mmap( esp_err_t err = spi_flash_mmap(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment