Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Split flash block smaller #540

Open
techcap opened this issue Mar 17, 2017 · 0 comments
Open

Split flash block smaller #540

techcap opened this issue Mar 17, 2017 · 0 comments

Comments

@techcap
Copy link
Contributor

techcap commented Mar 17, 2017

Can I split flash block smaller?

I'm porting for STM32F411 and it has 512kb flash memory.
On the reference manual, it has 16kb x 4, 64kb x 1, 128kb x 3.
So the configuration is like this.

#define FLASH_BASE_ADDRESS1 0x08000000 // 4x 16K
#define FLASH_BLOCK_COUNT1 4
#define FLASH_BYTES_PER_BLOCK1 0x04000
#define FLASH_BASE_ADDRESS2 0x08010000 // 1x 64K
#define FLASH_BLOCK_COUNT2 1
#define FLASH_BYTES_PER_BLOCK2 0x10000
#define FLASH_BASE_ADDRESS3 0x08020000 // 3x 128K
#define FLASH_BLOCK_COUNT3 3
#define FLASH_BYTES_PER_BLOCK3 0x20000

Now I need some space for storing configuration using ExtendedWeakReference, so I have to set small BLOCKTYPE_STORAGE_A and BLOCKTYPE_STORAGE_B BlockRange.
I need only very small space for configuration.
Can I split 128kb block size to smaller like this?

#define FLASH_BASE_ADDRESS3 0x08020000 // 24x 16k
#define FLASH_BLOCK_COUNT3 24
#define FLASH_BYTES_PER_BLOCK3 0x4000

I changed BlockRange3 configuration like this.

const BlockRange g_STM32F4_BlockRange3[] =
{
{ BlockRange::BLOCKTYPE_CODE , 0, 13 }, // 08020000 CLR 224k
{ BlockRange::BLOCKTYPE_DEPLOYMENT, 14, 21 }, // 08060000 deployment 128k
{ BlockRange::BLOCKTYPE_STORAGE_A, 22, 22 }, //16k
{ BlockRange::BLOCKTYPE_STORAGE_B, 23, 23 }, //16k
}

But ExtendedWeakReference still doesn't work.
I'm curious if it has right flash memory setting.

And is there anyone who used STM32F411 OTP flash memory which has 512bytes size?

Thanks in advance.

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

No branches or pull requests

1 participant