A library with drivers for different peripherals on the LPC4088 QuickStart Board or related add-on boards.
Dependents: LPC4088test LPC4088test_ledonly LPC4088test_deleteall LPC4088_RAMtest ... more
Revision 18:9f1f1a8b4729, committed 2014-10-27
- Comitter:
- embeddedartists
- Date:
- Mon Oct 27 10:18:08 2014 +0000
- Parent:
- 17:b3a179cc3d88
- Child:
- 19:74540582e639
- Commit message:
- Added support for Macronix QSPI flash
Changed in this revision
--- a/QSPIFileSystem.cpp Wed Aug 27 14:24:16 2014 +0000 +++ b/QSPIFileSystem.cpp Mon Oct 27 10:18:08 2014 +0000 @@ -215,6 +215,20 @@ memInfo.tocBlockAddr = SPIFI_MEM_BASE + (NUM_BLOCKS * ERASE_SIZE) - (memInfo.numTocs * memInfo.tocSizeInBytes); break; + case SPIFI::Macronix_MX25L6435EM2I: + /* For the Macronix memory the TOC occupies 8192 bytes and that is bigger than + one erase block (which is 4096 bytes). It is possible to either keep only + one TOC or to create a couple to reduce wear on the memory. In this case + the multiple TOCs option is used. */ + strcpy(memInfo.memName, "Macronix_MX25L6435EM2I"); + memInfo.memSize = obj->memSize; + memInfo.eraseBlockSize = 4*1024; + memInfo.numEraseBlocks = memInfo.memSize / memInfo.eraseBlockSize; + memInfo.tocSizeInBytes = sizeof(toc_entry_t) * memInfo.numEraseBlocks; + memInfo.numTocs = 8; + memInfo.tocBlockAddr = SPIFI_MEM_BASE + (NUM_BLOCKS * ERASE_SIZE) - (memInfo.numTocs * memInfo.tocSizeInBytes); + break; + case SPIFI::UnknownDevice: default: debug("INIT: Memory is unknown and may not work as expected\n");
--- a/SPIFI.cpp Wed Aug 27 14:24:16 2014 +0000 +++ b/SPIFI.cpp Mon Oct 27 10:18:08 2014 +0000 @@ -158,6 +158,12 @@ _memorySize = _romData->memSize; _eraseBlockSize = 4*1024; } + else if ((_romData->mfger == 0xc2) && (_romData->devType == 0x20) && (_romData->devID == 0x17) && (_romData->memSize > 0x100000)) + { + _device = Macronix_MX25L6435EM2I; + _memorySize = _romData->memSize; + _eraseBlockSize = 4*1024; + } else { debug("SPIFI::init(): Memory is unknown and may not work as expected\n");
--- a/SPIFI.h Wed Aug 27 14:24:16 2014 +0000 +++ b/SPIFI.h Mon Oct 27 10:18:08 2014 +0000 @@ -83,8 +83,9 @@ }; enum Device { - Spansion_S25FL032, /* Manufacturer: 0x01, devType: 0x02, devID: 0x15 */ - Winbond_W25Q64FV, /* Manufacturer: 0xEF, devType: 0x40, devID: 0x17 */ + Spansion_S25FL032, /* Manufacturer: 0x01, devType: 0x02, devID: 0x15 */ + Winbond_W25Q64FV, /* Manufacturer: 0xEF, devType: 0x40, devID: 0x17 */ + Macronix_MX25L6435EM2I, /* Manufacturer: 0xC2, devType: 0x20, devID: 0x17 */ UnknownDevice };