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.
This commit is contained in:
Karl Palsson 2018-07-23 09:36:50 +00:00
parent b9448bff16
commit a949b223c3
6 changed files with 16 additions and 13 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -26,16 +26,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

View File

@ -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

View File

@ -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();
}