This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit 175272647931512686ff2a6cfce1d927e4d08ea1
Author: wangjianyu3 <[email protected]>
AuthorDate: Tue Dec 5 20:36:19 2023 +0800

    system/fastboot: Complete the erase command
    
    Signed-off-by: wangjianyu3 <[email protected]>
---
 system/fastboot/fastboot.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c
index f1d1a19de..1d4786889 100644
--- a/system/fastboot/fastboot.c
+++ b/system/fastboot/fastboot.c
@@ -23,6 +23,7 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
+#include <nuttx/mtd/mtd.h>
 #include <nuttx/version.h>
 
 #include <errno.h>
@@ -296,7 +297,15 @@ out:
 
 static int fastboot_flash_erase(int fd)
 {
-  return OK;
+  int ret;
+
+  ret = ioctl(fd, MTDIOC_BULKERASE, 0);
+  if (ret < 0)
+    {
+      printf("Erase device failed\n");
+    }
+
+  return ret;
 }
 
 static int

Reply via email to