Skip to content

Commit

Permalink
Merge pull request #432 from Teesmo/feat/spi_nand_flash_mt29f1
Browse files Browse the repository at this point in the history
Feat/spi nand flash mt29f1 (IEC-225)
  • Loading branch information
igrr authored Nov 1, 2024
2 parents 770ae74 + 16bdb50 commit a90ee7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spi_nand_flash/src/nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,24 @@ static esp_err_t spi_nand_micron_init(spi_nand_flash_device_t *dev)
.flags = SPI_TRANS_USE_RXDATA,
};
spi_nand_execute_transaction(dev->config.device_handle, &t);
dev->read_page_delay_us = 115;
dev->erase_block_delay_us = 2000;
dev->program_page_delay_us = 240;
ESP_LOGD(TAG, "%s: device_id: %x\n", __func__, device_id);
switch (device_id) {
case MICRON_DI_34:
dev->read_page_delay_us = 115;
dev->program_page_delay_us = 240;
dev->dhara_nand.num_blocks = 2048;
dev->dhara_nand.log2_ppb = 6; // 64 pages per block
dev->dhara_nand.log2_page_size = 12; // 4096 bytes per page
break;
case MICRON_DI_14:
case MICRON_DI_15:
dev->read_page_delay_us = 46;
dev->program_page_delay_us = 220;
dev->dhara_nand.num_blocks = 1024;
dev->dhara_nand.log2_ppb = 6; // 64 pages per block
dev->dhara_nand.log2_page_size = 11; // 2048 bytes per page
break;
default:
return ESP_ERR_INVALID_RESPONSE;
}
Expand Down
2 changes: 2 additions & 0 deletions spi_nand_flash/src/nand_flash_devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@
#define WINBOND_DI_BC21 0xBC21

#define MICRON_DI_34 0x34
#define MICRON_DI_14 0x14
#define MICRON_DI_15 0x15

0 comments on commit a90ee7b

Please sign in to comment.