ee icon indicating copy to clipboard operation
ee copied to clipboard

STM32F429IIT issue

Open rrouterr opened this issue 1 year ago • 5 comments

I have a problem with this library on the STM32F429IIT processor. When trying to erase the last, 23rd sector, nothing happens (the erasure does not occur). So far, I've discovered that the problem lies in calculating the last sector. When I replace:

#else
    flashErase.TypeErase = FLASH_TYPEERASE_SECTORS;
    flashErase.Sector = EE_PAGE_SECTOR + FLASH_F4_OFFSET;
    flashErase.NbSectors = 1;
#endif
#ifdef EE_BANK_SELECT
    flashErase.Banks = EE_BANK_SELECT;

with

    #else
    flashErase.TypeErase = FLASH_TYPEERASE_SECTORS;
    flashErase.Sector = 23;  // EE_PAGE_SECTOR + FLASH_F4_OFFSET;
    flashErase.NbSectors = 1;
#endif
#ifdef EE_BANK_SELECT
    // flashErase.Banks = EE_BANK_SELECT;

The last, 23rd sector is erased, and the write operation can proceed correctly.

rrouterr avatar Jul 20 '24 00:07 rrouterr

hello. can you debug it please and tell me the value of FLASH_SIZE and EE_PAGE_SECTOR

nimaltd avatar Jul 21 '24 08:07 nimaltd

Thank you for your answer. In debug:

flashErase.Banks = 2

#define EE_PAGE_SECTOR ((FLASH_SIZE / EE_SIZE / 2) - 1) ((((((uint32_t)(*((uint16_t *)0x1FFF7A22UL)) & (0xFFFFU))) * 1024) / 0x20000 / 2) - 1)

rrouterr avatar Jul 21 '24 08:07 rrouterr

i mean actual value, integer FLASH_SIZE EE_PAGE_SECTOR printf("%d, %d", FLASH_SIZE , EE_PAGE_SECTOR)

nimaltd avatar Jul 21 '24 08:07 nimaltd

yes sorry, the correct answer is: FLASH_SIZE = 0x200000 EE_PAGE_SECTOR = 7

rrouterr avatar Jul 21 '24 09:07 rrouterr

@rrouterr I have updated the repository. please try again.

nimaltd avatar Aug 16 '24 06:08 nimaltd