#define boot_page_erase_safe(address) \
	do { \
    boot_spm_busy_wait();                       \
    eeprom_busy_wait();                         \
    boot_page_erase (address);                  \
} while (0) 

Same as boot_page_erase() except it waits for eeprom and spm operations to complete before erasing the page.