diff --git a/.cproject b/.cproject
index b975ced..d6fd25e 100644
--- a/.cproject
+++ b/.cproject
@@ -24,7 +24,7 @@
-
+
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
index 08968c0..605bf69 100644
--- a/.settings/language.settings.xml
+++ b/.settings/language.settings.xml
@@ -5,7 +5,7 @@
-
+
@@ -16,7 +16,7 @@
-
+
diff --git a/Core/Drivers/USFL_UserFlash.c b/Core/Drivers/USFL_UserFlash.c
index cc9c94b..5a6d1b9 100644
--- a/Core/Drivers/USFL_UserFlash.c
+++ b/Core/Drivers/USFL_UserFlash.c
@@ -76,8 +76,6 @@
// Description: Definition of local variables (visible by this module only).
//=================================================================================================
-__IO uint32_t ErasingOnGoing = 0;
-
LOCAL osMutexId_t m_pstMutexID = NULL;
//=================================================================================================
@@ -127,7 +125,7 @@ BOOL USFL_boInitializeModule( VOID )
//-------------------------------------------------------------------------------------------------
// Function: USFL_boGetVariable
// Description: Gets a variable out of the virtual eeprom
-// Parameters: U8 u8Variable -> virtual adress of variable
+// Parameters: U8 u8Variable -> virtual address of variable
// U32 * u32Variable -> pointer to data
// Returns: Boolean TRUE if successful
//-------------------------------------------------------------------------------------------------
@@ -136,15 +134,13 @@ BOOL USFL_boGetVariable ( U8 u8Variable, VARH_UVariable * uVariable ){
boOK &= EE_ReadVariable32bits( (U16) u8Variable, (PU32)uVariable ) == EE_OK ? TRUE : FALSE;
- //*u32Variable = UTIL_u32RevFLOAT( *u32Variable );
-
return boOK;
}
//-------------------------------------------------------------------------------------------------
// Function: USFL_boSetVariable
// Description: Writes a variable into the virtual eeprom
-// Parameters: U8 u8Variable -> virtual adress of variable
+// Parameters: U8 u8Variable -> virtual address of variable
// U32 u32Variable -> data to write
// Returns: Boolean TRUE if successful
//-------------------------------------------------------------------------------------------------
@@ -152,12 +148,13 @@ BOOL USFL_boSetVariable ( U8 u8Variable, VARH_UVariable uVariable ){
BOOL boOK = TRUE;
EE_Status ee_status = EE_OK;
- boOK &= (ee_status = EE_WriteVariable32bits( (U16) u8Variable, uVariable.u32Val )) == EE_OK ? TRUE : FALSE;
+ ee_status = EE_WriteVariable32bits( (U16) u8Variable, uVariable.u32Val );
/* Start cleanup mode, if cleanup is needed */
if ((ee_status & EE_STATUSMASK_CLEANUP) == EE_STATUSMASK_CLEANUP) {
- ErasingOnGoing = 1;
boOK &= (ee_status |= EE_CleanUp()) == EE_OK ? TRUE : FALSE;
+
+ boOK &= EE_WriteVariable32bits( (U16) u8Variable, uVariable.u32Val ) == EE_OK ? TRUE : FALSE;
}
if ((ee_status & EE_STATUSMASK_ERROR) == EE_STATUSMASK_ERROR) {boOK &= FALSE;}
diff --git a/Middlewares/ST/EEPROM_Emul/Core/eeprom_emul_conf.h b/Middlewares/ST/EEPROM_Emul/Core/eeprom_emul_conf.h
index c8c74ba..99bffce 100644
--- a/Middlewares/ST/EEPROM_Emul/Core/eeprom_emul_conf.h
+++ b/Middlewares/ST/EEPROM_Emul/Core/eeprom_emul_conf.h
@@ -41,8 +41,8 @@
*/
/* Configuration of eeprom emulation in flash, can be custom */
-#define START_PAGE_ADDRESS 0x0801F000U /*!< Start address of the second last page in flash, for EEPROM emulation */
-#define CYCLES_NUMBER 1U /*!< Number of 10Kcycles requested, minimum 1 for 10Kcycles (default), for instance 10 to reach 100Kcycles. This factor will increase pages number */
+#define START_PAGE_ADDRESS 0x0801E000U /*!< Start address of the second last page in flash, for EEPROM emulation */
+#define CYCLES_NUMBER 2U /*!< Number of 10Kcycles requested, minimum 1 for 10Kcycles (default), for instance 10 to reach 100Kcycles. This factor will increase pages number */
#define GUARD_PAGES_NUMBER 0U /*!< Number of guard pages avoiding frequent transfers (must be multiple of 2): 0,2,4.. */
/* Configuration of crc calculation for eeprom emulation in flash */
diff --git a/Middlewares/ST/EEPROM_Emul/Porting/STM32L4/flash_interface.c b/Middlewares/ST/EEPROM_Emul/Porting/STM32L4/flash_interface.c
index 8b04f80..c9a5a70 100644
--- a/Middlewares/ST/EEPROM_Emul/Porting/STM32L4/flash_interface.c
+++ b/Middlewares/ST/EEPROM_Emul/Porting/STM32L4/flash_interface.c
@@ -50,6 +50,9 @@ static uint32_t GetBankNumber(uint32_t Address);
*/
HAL_StatusTypeDef FI_WriteDoubleWord(uint32_t Address, uint64_t Data)
{
+ __HAL_FLASH_CLEAR_FLAG(FLASH_FLAG_EOP | FLASH_FLAG_OPERR | FLASH_FLAG_PROGERR | FLASH_FLAG_WRPERR |
+ FLASH_FLAG_PGAERR | FLASH_FLAG_SIZERR | FLASH_FLAG_PGSERR | FLASH_FLAG_MISERR | FLASH_FLAG_FASTERR |
+ FLASH_FLAG_RDERR | FLASH_FLAG_OPTVERR); // clear all Flags before write (USER modification)
return HAL_FLASH_Program(FLASH_TYPEPROGRAM_DOUBLEWORD, Address, Data);
}
diff --git a/tec Debug.launch b/tec Debug.launch
index 5ad4ea8..586bdaf 100644
--- a/tec Debug.launch
+++ b/tec Debug.launch
@@ -73,6 +73,6 @@
-
+