Working on dumping a bin file read from a USB drive into the LPC2648 flash. IAP erase and write functions are working and data is properly getting written in the Flash with following configurations.
CCLKCFG = 0x05;
// Disable PLL
PLLCON = 0x00;
PLLFEED = 0xAA; // Feed Sequence Part #1
PLLFEED = 0x55; // Feed Sequence Part #2
// User flash mode
MEMMAP = 0x01; // User Flash Mode
But after the flash update is done, I have to soft reset the controller since the PLL has been disabled for flash writing and no other peripherals are working post this. Moreover, with this approach, I need to copy whole file data from the USB drive to a global buffer, which will work until the file data is not too much and we don't out of RAM.
I want to have a design like we can read data from USB drive in multiple reads and write into the flash in multiple writes which will give advantage of not going out of RAM. But with the current configuration, this cycle of reading a chunk of data from USB and writing into the flash is not working.
How to achieve this?