diff options
author | Karl Palsson <karlp@tweak.net.au> | 2018-07-23 12:36:50 +0300 |
---|---|---|
committer | Karl Palsson <karlp@tweak.net.au> | 2018-07-29 23:31:17 +0300 |
commit | a949b223c35e8aa7e3dfa20cbd513490eb63562c (patch) | |
tree | d3e121b522f7eff5bca7678e6d49aa16af067721 | |
parent | b9448bff169114f8263d11a5b452e141a48c0448 (diff) |
stm32f3: flash: pgerr is not the same as pgperr
F3's flash interface is actually quite different, don't try and force
sharing code that isn't really related. The "PGERR" is a very different
bit than the parallelism error that f2/4/7 have.
-rw-r--r-- | include/libopencm3/stm32/common/flash_common_f234.h | 1 | ||||
-rw-r--r-- | include/libopencm3/stm32/common/flash_common_f24.h | 1 | ||||
-rw-r--r-- | include/libopencm3/stm32/f3/flash.h | 3 | ||||
-rw-r--r-- | lib/stm32/common/flash_common_f234.c | 10 | ||||
-rw-r--r-- | lib/stm32/common/flash_common_f24.c | 7 | ||||
-rw-r--r-- | lib/stm32/f3/flash.c | 7 |
6 files changed, 16 insertions, 13 deletions
diff --git a/include/libopencm3/stm32/common/flash_common_f234.h b/include/libopencm3/stm32/common/flash_common_f234.h index 50390c38..e1bb37d3 100644 --- a/include/libopencm3/stm32/common/flash_common_f234.h +++ b/include/libopencm3/stm32/common/flash_common_f234.h @@ -75,7 +75,6 @@ BEGIN_DECLS -void flash_clear_pgperr_flag(void); void flash_clear_status_flags(void); void flash_wait_for_last_operation(void); diff --git a/include/libopencm3/stm32/common/flash_common_f24.h b/include/libopencm3/stm32/common/flash_common_f24.h index 647f8413..706774b0 100644 --- a/include/libopencm3/stm32/common/flash_common_f24.h +++ b/include/libopencm3/stm32/common/flash_common_f24.h @@ -114,6 +114,7 @@ BEGIN_DECLS void flash_lock_option_bytes(void); void flash_clear_pgserr_flag(void); +void flash_clear_pgperr_flag(void); void flash_clear_wrperr_flag(void); void flash_clear_pgaerr_flag(void); void flash_erase_all_sectors(uint32_t program_size); diff --git a/include/libopencm3/stm32/f3/flash.h b/include/libopencm3/stm32/f3/flash.h index d73d215a..d66326da 100644 --- a/include/libopencm3/stm32/f3/flash.h +++ b/include/libopencm3/stm32/f3/flash.h @@ -54,7 +54,7 @@ #define FLASH_SR_BSY (1 << 0) #define FLASH_SR_ERLYBSY (1 << 1) -#define FLASH_SR_PGPERR (1 << 2) +#define FLASH_SR_PGERR (1 << 2) #define FLASH_SR_WRPRTERR (1 << 4) #define FLASH_SR_EOP (1 << 5) @@ -78,6 +78,7 @@ BEGIN_DECLS +void flash_clear_pgerr_flag(void); END_DECLS diff --git a/lib/stm32/common/flash_common_f234.c b/lib/stm32/common/flash_common_f234.c index 3f111444..d12baa29 100644 --- a/lib/stm32/common/flash_common_f234.c +++ b/lib/stm32/common/flash_common_f234.c @@ -27,16 +27,6 @@ #include <libopencm3/stm32/flash.h> /*---------------------------------------------------------------------------*/ -/** @brief Clear the Programming Error Status Flag - -*/ - -void flash_clear_pgperr_flag(void) -{ - FLASH_SR |= FLASH_SR_PGPERR; -} - -/*---------------------------------------------------------------------------*/ /** @brief Wait until Last Operation has Ended This loops indefinitely until an operation (write or erase) has completed by diff --git a/lib/stm32/common/flash_common_f24.c b/lib/stm32/common/flash_common_f24.c index 096409c7..366c9e74 100644 --- a/lib/stm32/common/flash_common_f24.c +++ b/lib/stm32/common/flash_common_f24.c @@ -62,6 +62,13 @@ void flash_clear_pgaerr_flag(void) FLASH_SR |= FLASH_SR_PGAERR; } +/** Clear programming parallelism error flag + */ +void flash_clear_pgperr_flag(void) +{ + FLASH_SR |= FLASH_SR_PGPERR; +} + /*---------------------------------------------------------------------------*/ /** @brief Clear the Write Protect Error Flag diff --git a/lib/stm32/f3/flash.c b/lib/stm32/f3/flash.c index 16fb8aac..f8aba91b 100644 --- a/lib/stm32/f3/flash.c +++ b/lib/stm32/f3/flash.c @@ -46,6 +46,11 @@ #include <libopencm3/stm32/flash.h> +void flash_clear_pgerr_flag(void) +{ + FLASH_SR |= FLASH_SR_PGERR; +} + /*---------------------------------------------------------------------------*/ /** @brief Clear All Status Flags @@ -54,7 +59,7 @@ Clears program error, end of operation, busy flags. void flash_clear_status_flags(void) { - flash_clear_pgperr_flag(); + flash_clear_pgerr_flag(); flash_clear_eop_flag(); } |