hal_serial_snor incorrect state when calling start erase all Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
faisal
Posts: 374
Joined: Wed Jul 19, 2017 12:44 am
Has thanked: 44 times
Been thanked: 60 times

hal_serial_snor incorrect state when calling start erase all  Topic is solved

Postby faisal » Sat Jan 22, 2022 2:37 am

Incorrectly sets devp->state = FLASH_READY after kicking off snor_device_start_erase_all(). The result is that it makes snor_query_erase() useless, as it checks if devp->state == FLASH_ERASE. If not, it always returns FLASH_NO_ERROR.

Patch below.

Code: Select all

diff --git a/os/hal/lib/complex/serial_nor/hal_serial_nor.c b/os/hal/lib/complex/serial_nor/hal_serial_nor.c
index 82d90835e..05f02eb63 100644
--- a/os/hal/lib/complex/serial_nor/hal_serial_nor.c
+++ b/os/hal/lib/complex/serial_nor/hal_serial_nor.c
@@ -169,9 +169,6 @@ static flash_error_t snor_start_erase_all(void *instance) {
   /* Actual erase implementation.*/
   err = snor_device_start_erase_all(devp);

-  /* Ready state again.*/
-  devp->state = FLASH_READY;
-
   /* Bus released.*/
   bus_release(devp->config->busp);

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: hal_serial_snor incorrect state when calling start erase all

Postby Giovanni » Sat Jan 22, 2022 7:38 am

Hi,

Fixed as bug #1212.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 13 guests