Page 1 of 1

Writing and reading data - external flash memory

Posted: Fri Mar 23, 2018 11:42 am
by pappanita
Hi,

I have a confusion about working with external flash memory. I want to put some data in this and then I want to read them. When I flash a new version of a program, that is written in flash memory, am I right? Then my question is, if I want to write data in external flash memory, how can I know which part of the memory is free and is not used by the binary program?
I found some information in datasheet, about 4 MB of External SRAM that can be written and read, low address 0x3F40_0000 and high address 0x3FBF_FFFF, is that part of the memory what I have to use?


Thanks a lot,

Have a nice day! :)

Re: Writing and reading data - external flash memory

Posted: Sat Mar 24, 2018 2:04 am
by ESP_Sprite
For the flash memory where your application is located in: we have a partition table that allows you to indicate where everything should live. If you define your own partition table and use the partition-based flash routines, it's almost impossible to overwrite something you shouldn't overwrite.

For the external RAM: There are multiple modes to use this, but the easiest-to-use mode just hands the entire address range to the heap allocator. In this case, you can just use malloc() as usual, and that routine will return a chunk of memory located in external RAM when it makes sense.