Writing and reading data - external flash memory

pappanita
Posts: 1
Joined: Fri Mar 23, 2018 9:42 am

Writing and reading data - external flash memory

Postby pappanita » Fri Mar 23, 2018 11:42 am

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! :)

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: Writing and reading data - external flash memory

Postby ESP_Sprite » Sat Mar 24, 2018 2:04 am

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.

Who is online

Users browsing this forum: No registered users and 123 guests