From fa1c081a94647d7cb2386af1eb7598798ba233ae Mon Sep 17 00:00:00 2001
From: Dawid Buchwald <dawid.buchwald@hotmail.com>
Date: Sun, 23 Oct 2022 15:06:06 +0200
Subject: [PATCH] Implemented page erase operation for SerialUPDI

---
 src/serialupdi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/serialupdi.c b/src/serialupdi.c
index c5869e4f..cdff0a0a 100644
--- a/src/serialupdi.c
+++ b/src/serialupdi.c
@@ -881,8 +881,7 @@ static int serialupdi_chip_erase(const PROGRAMMER *pgm, const AVRPART *p) {
 static int serialupdi_page_erase(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m,
                                  unsigned int baseaddr)
 {
-  pmsg_error("page erase not implemented yet\n");
-  return -1;
+  return updi_nvm_erase_flash_page(pgm, p, m->offset + baseaddr);
 }
 
 static int serialupdi_read_signature(const PROGRAMMER *pgm, const AVRPART *p, const AVRMEM *m) {