Skip to content

Commit

Permalink
Merge pull request #447 from pu-cc/spiflashdb-mx25r643f
Browse files Browse the repository at this point in the history
spiFlashdb: add MX25R6435F and fix SPIFlash::bp_to_len
  • Loading branch information
trabucayre authored Mar 15, 2024
2 parents 63c19bc + 972ded1 commit 41ecac5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/spiFlash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,9 @@ std::map<std::string, uint32_t> SPIFlash::bp_to_len(uint8_t bp, uint8_t tb)
for (int i = 0; i < 4; i++)
if ((bp & _flash_model->bp_offset[i]))
tmp |= (1 << i);
/* 0 -> no block protected */
if (tmp == 0)
return protect_area;
/* bp code is 2^(bp-1) blocks */
uint16_t nr_sectors = (1 << (tmp-1));
printf("nr_sectors : %d\n", nr_sectors);
Expand Down
14 changes: 14 additions & 0 deletions src/spiFlashdb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,20 @@ static std::map <uint32_t, flash_t> flash_list = {
.bp_len = 5,
.bp_offset = {(1 << 2), (1 << 3), (1 << 4), (1 << 5)}}
},
{0xc22817, {
/* https://www.macronix.com/Lists/Datasheet/Attachments/8868/MX25R6435F,%20Wide%20Range,%2064Mb,%20v1.6.pdf */
.manufacturer = "Macronix",
.model = "MX25R6435F",
.nr_sector = 128,
.sector_erase = true,
.subsector_erase = true,
.has_extended = false,
.tb_otp = true,
.tb_offset = (1 << 3),
.tb_register = CONFR,
.bp_len = 4,
.bp_offset = {(1 << 2), (1 << 3), (1 << 4), 0}}
},
{0xef4014, {
/* https://cdn-shop.adafruit.com/datasheets/W25Q80BV.pdf */
.manufacturer = "Winbond",
Expand Down

0 comments on commit 41ecac5

Please sign in to comment.