- labels: --> patches_welcome
I am putting this in as an enhancement, but it borders on being a bug.
If one selects to flash to a memory address that does not begin or end at a flash erase block boundary, currently UrJTag will leave the unaddressed portion of the block erased. This can be a problem when patching flash sections that the memory mapping wasn't designed to take block boundaries into account.
Ex. In my particular case, the last 3 or 4 bytes of the entire flash specifies to the bootloader where to find the app in the flash. If I only specify to UrJTag to write to that small location, the entire block gets left erased except for the change i am making, probably causing a failure to the system as now data is missing. To get around this currently, one must calulate the block boundary addresses affected, read to file the beginning/end blocks affected, and patch the soure data file appending the areas not of interest but will be affected.
This can be accomplished by reading in blocks to a block buffer before erase/write, write the intended data to the block buffer as if it were the flash itself, then write the buffer to flash. An option switch could be provided not to backfill in case that is the intent for the operator.