From 06d0e44f71d317f99d60f9fb14a81d3e17e042b5 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Fri, 9 Oct 2020 21:22:03 +0200 Subject: [PATCH] gowin: eraseFLASH(): fix buffer size, set this to 0 --- src/gowin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gowin.cpp b/src/gowin.cpp index 160a4e8..70db72e 100644 --- a/src/gowin.cpp +++ b/src/gowin.cpp @@ -468,7 +468,8 @@ bool Gowin::flashSRAM(uint8_t *data, int length) */ bool Gowin::eraseFLASH() { - uint8_t tt[37500]; + uint8_t tt[37500 * 8]; + memset(tt, 0, 37500 * 8); unsigned char tx[4] = {0, 0, 0, 0}; printInfo("erase Flash ", false); wr_rd(EFLASH_ERASE, NULL, 0, NULL, 0);