This flash is only 2Mx16. However, in my hardware, I can only handle 1Mx16. The sector size are all the same. And I am using a 16bit wide data bus. Are my settings below correct? #define MXI_29LV320AT_FLASH_SECTORS 0x020U #define MXI_29LV320AT_FLASH_SECTOR_SIZE 0x8000U #define MXI_29LV320AT_PROG_SECTOR_SIZE 0x0002U const flash_cmd_t MXI_29LV320AT_flash_sector_erase_cmd[32] = { { 0x30, 0x00000}, /* Command to erase the first sector */ { 0x30, 0x08000}, { 0x30, 0x10000}, { 0x30, 0x18000}, { 0x30, 0x20000}, { 0x30, 0x28000}, { 0x30, 0x30000}, { 0x30, 0x38000}, { 0x30, 0x40000}, { 0x30, 0x48000}, { 0x30, 0x50000}, { 0x30, 0x58000}, { 0x30, 0x60000}, { 0x30, 0x68000}, { 0x30, 0x70000}, { 0x30, 0x78000}, { 0x30, 0x80000}, { 0x30, 0x88000}, { 0x30, 0x90000}, { 0x30, 0x98000}, { 0x30, 0xA0000}, { 0x30, 0xA8000}, { 0x30, 0xB0000}, { 0x30, 0xB8000}, { 0x30, 0xC0000}, { 0x30, 0xC8000}, { 0x30, 0xD0000}, { 0x30, 0xD8000}, { 0x30, 0xE0000}, { 0x30, 0xE8000}, { 0x30, 0xF0000}, { 0x30, 0xF8000} }; I am only using 32 sectors and size of 0x8000 since each is 32 Kwords. However, I am not able to run my debugger with this setting. It seems like I can only run with 16 sectors (0x10) for MXI_29LV320AT_FLASH_SECTORS. Therefore, am I losing 512K of my flash or is my configurations incorrect? Also, ADDR[24:23]=2’b11 to configure 16 bit SRAM on CS0.
actually, I double checked again and I found out that I am not using MXI_29LV320AT_FLASH_SECTOR_SIZE in my code. So, I fixed that and I am able to run my debugger now. However, when I try to write to the flash with the sample naftpapp code, it is telling my that I exceeded storage allocation. I checked my code and it is exceeding on currentSector=2 and it is returning a -2 which is Flash write error. In my customize.ldr file the settings are: #define FLASH_SIZE 1M #define FLASH_START 0x2000000 The reason I use 1M of my 2M flash is no connection for the last address line. Also, the file that I’m downloading is the same naftpapp file which is 397Kbytes