Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32F429IIT issue #30

Open
rrouterr opened this issue Jul 20, 2024 · 5 comments
Open

STM32F429IIT issue #30

rrouterr opened this issue Jul 20, 2024 · 5 comments

Comments

@rrouterr
Copy link

rrouterr commented Jul 20, 2024

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.

@nimaltd
Copy link
Owner

nimaltd commented Jul 21, 2024

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

@rrouterr
Copy link
Author

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)

@nimaltd
Copy link
Owner

nimaltd commented Jul 21, 2024

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

@rrouterr
Copy link
Author

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

@nimaltd
Copy link
Owner

nimaltd commented Aug 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants