Patent ID: 8589522

Claim:
A method for incrementally updating a software stack stored on a flash memory device in a target device, the method comprising: receiving, at a server computer that is different from the target device, a modification to a function that is part of the software stack, wherein data or instructions for the function begin at a first memory location and end at a second memory location on the flash memory device, wherein additional memory locations are allocated after the second memory location on the flash memory device to allow the function to increase in size via a software update, and wherein the modification to the function decreases the size of the function; determining, by the server computer, a new memory layout for storing functions in the software stack based on the modification to the function, wherein said determining the new memory layout includes moving locations of functions stored in the flash memory device so that a minimum number of memory pages of the flash memory device are changed; determining, by the server computer, changes to a set of memory pages on the flash memory device based on the new memory layout, wherein the changes to the set of memory pages do not change the location of other functions that are located after the additional memory locations in the flash memory device; and sending, from the server computer to the target device, the changes to the set of memory pages.