Skip to content

Commit d6aff6d

Browse files
author
Jiang Jiang Jian
committed
Merge branch 'bugfix/fix_cache_count_flash_pages_patchs_return_wrong_value' into 'master'
fix(rom): Fix s2 and s3 Cache_Count_Flash_Pages rom function wrapper Closes IDFGH-14494 See merge request espressif/esp-idf!36594
2 parents e57f02e + af7b6b7 commit d6aff6d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

components/esp_rom/patches/esp_rom_cache_esp32s2_esp32s3.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
extern uint32_t rom_Cache_Count_Flash_Pages(uint32_t bus, uint32_t * page0_mapped);
2222
uint32_t Cache_Count_Flash_Pages(uint32_t bus, uint32_t * page0_mapped)
2323
{
24-
uint32_t page0_before_count = *page0_mapped;
2524
uint32_t flash_pages = 0;
2625
flash_pages = rom_Cache_Count_Flash_Pages(bus, page0_mapped);
2726

28-
/* No page mapped to page0, in this condition, the rom api will return
27+
/* No page mapped to page0 yet, in this condition, the rom api will return
2928
* unexpected value + 1.
3029
*/
31-
if (page0_before_count == *page0_mapped) {
30+
if (*page0_mapped == 0) {
3231
flash_pages--;
3332
}
3433
return flash_pages;

0 commit comments

Comments
 (0)