STM32G431RB is part of examples EEPROM emulation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-03 8:13 AM
I try run on 431CB and have issues. EE_Init return error.
Work this X-Cube-EEPROM realy on CB or only on RB ??? Howto correct ?
- Labels:
-
Bug-report
-
STM32G4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-03 8:28 AM
@MM..1 wrote:I try run on 431CB and have issues. EE_Init return error.
So have you, eg, stepped in the debugger to find what causes that error?
@MM..1 wrote:Work this X-Cube-EEPROM realy on CB or only on RB ???
The only difference between Cx and Rx is the number of package pins:
so that shouldn't have any effect on the internal operation
@MM..1 wrote:Howto correct ?
First step, as always, is to find what's actually going wrong ...
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-03 10:04 AM - edited ‎2025-04-03 10:15 AM
HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout)
{
/* Wait for the FLASH operation to complete by polling on BUSY flag to be reset.
Even if the FLASH operation fails, the BUSY flag will be reset and an error
flag will be set */
uint32_t tickstart = HAL_GetTick();
uint32_t error;
while (__HAL_FLASH_GET_FLAG(FLASH_FLAG_BSY))
{
if ((HAL_GetTick() - tickstart) > Timeout)
{
return HAL_TIMEOUT;
}
}
/* Check FLASH operation error flags */
error = (FLASH->SR & FLASH_FLAG_SR_ERRORS);
if (error != 0u)
{
/* Save the error code */
pFlash.ErrorCode |= error;
/* Clear error programming flags */
__HAL_FLASH_CLEAR_FLAG(error);
return HAL_ERROR;
here is error and flag set is
case STATE_PAGE_ACTIVE:
{
/* Set new Page status to STATE_PAGE_ACTIVE status */
if (FI_WriteDoubleWord(header2, EE_PAGESTAT_ACTIVE) != HAL_OK)
{
return EE_WRITE_ERROR;
}
ubCurrentActivePage = Page;
}
break;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-04-04 1:00 AM
@mÆŽALLEm hmm i add unlock flash before init and start working. But now every boot MCU and EE_Init fill pages in emulated zone with zeroes. Can somebody explain
/*********************************************************************/
/* Step 8: Perform dummy write '0' to get rid of potential */
/* instability of line value 0xFFFFFFFF consecutive to a */
/* reset during write here */
/* Only needed if recovery transfer did not occured */
/*********************************************************************/
if (recoverytransfer == 0U)
{
#ifdef DUALCORE_FLASH_SHARING
status = VerifyPagesFullWriteVariable(0U, 0U, EE_INIT_WRITE);
// The dummy write can be skipped in case pages are full
// because in this case potential instability can not happen
if ((status != EE_OK) && (status != EE_PAGE_FULL))
{
return EE_WRITE_ERROR;
}
#else
#ifdef FLASH_LINES_128B
uint64_t to_write[2] = {0};
status = VerifyPagesFullWriteVariable(0U, to_write, EE_INIT_WRITE);
#else
status = VerifyPagesFullWriteVariable(0U, 0U);
#endif
// The dummy write can be skipped in case pages are full
// because in this case potential instability can not happen
if ((status != EE_OK) && (status != EE_PAGE_FULL))
{
return EE_WRITE_ERROR;
}
#endif
}
