Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/spi nand flash mt29f1 (IEC-225) #432

Merged
merged 1 commit into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
igrr marked this conversation as resolved.
Show resolved Hide resolved
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
Loading