* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
if (retval != ERROR_OK)
goto reset_pg_and_lock;
- if ((first == 0) && (last == (bank->num_sectors - 1))) {
+ if ((first == 0) && (last == (bank->num_sectors - 1)) &&
+ !mdr_info->mem_type) {
retval = mdr_mass_erase(bank);
goto reset_pg_and_lock;
}
if (new_buffer)
free(new_buffer);
+ /* read some bytes bytes to flush buffer in flash accelerator.
+ * See errata for 1986VE1T and 1986VE3. Error 0007 */
+ if ((retval == ERROR_OK) && (!mdr_info->mem_type)) {
+ uint32_t tmp;
+ target_checksum_memory(bank->target, bank->base, 64, &tmp);
+ }
+
return retval;
}