cancel
Showing results for 
Search instead for 
Did you mean: 

Sectioning STM32F779II Flash Memory

Ahmed Tolba
Associate II

I'm trying to allocate 768KB For the Flash for the user program. at address 0x08000000

And also save constant data starting from address 0x08100000 consuming 1024 K bytes

Now from my understanding I should have free space for example sector 10,11.

I'm trying to erase and write to these sections, but there are write protections error, sector 11 can be erased sucessfully but data can not be written to, section 10 can neither be erased nor written to it.

What would be the problem ?

ENTRY(Reset_Handler)

/* Highest address of the user mode stack */

_estack = 0x20080000; /* end of RAM */

/* Generate a link error if heap and stack don't fit into RAM */

_Min_Heap_Size = 0x1000; /* required amount of heap */

_Min_Stack_Size = 0x2000; /* required amount of stack */

/* Specify the memory areas */

MEMORY

{

FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 768K

FLASH2 (r) : ORIGIN = 0x08100000, LENGTH = 1024K

SRAM1 (xrw) : ORIGIN = 0x20020000, LENGTH = 368K

SRAM2 (xrw) : ORIGIN = 0x2007C000, LENGTH = 16K

DTCMRAM (wal) : ORIGIN = 0x20000000, LENGTH = 128K

MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K

}

9 REPLIES 9
Ahmed Tolba
Associate II

That's strange that no one answered, is it that hard question ?

Lacking in usable information.

The flashing tools reporting the error, or your own code?

If your own code, nothing here to review.

Check .MAP to confirm linker​ is building what you expect.

Check flash banking settings.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

My own code can't erase the flash, it says write protection error. The flash is configured in dual banking code.

The erase and writing flash is correct. I really don't know what's wrong.

Hard to guess from here.

You'll need to instrument your code, and dump out memory and register contents as the code is encountering them. Confirm your expectations and reality.

Ideally test outside of debugger.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Which steps do I need to make for testing outside the debugger ?

is it possible to erase, program, erase program, at runtime many times ? or it's just one time possible ?

Outside debugger you'd use a serial channel, and instrument code to see what it is doing, and the memory/register context is sees.

The memory should permit page/sector level erase and write, multiple times, and depending on the settings/options selected.

Dump out the write protect bits, and follow the logic returning the write protect error. You're trying to understand why, so you need to look at what the code is looking at and doing.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..