This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Combining contiguous memory blocks to accomodate sections



I ran out of both program and data space in my project (.text and .ebss sections could not be allocated), and so after reading this thread I have combined RAML1 and RAML2 in program space and RAML4 and RAML5 in data space to give me big enough blocks to allocate these two sections. My linker command file now looks like this:

MEMORY
{
PAGE 0 :

... 

RAML1 : origin = 0x009000, length = 0x002000
//RAML2 : origin = 0x00A000, length = 0x001000 

...

PAGE 1 :

...

RAML4 : origin = 0x00C000, length = 0x002000
//RAML5 : origin = 0x00D000, length = 0x001000

}

SECTIONS
{
...
.text : > RAML1, PAGE = 0

...


.ebss : > RAML4, PAGE = 1
.econst : > RAML4, PAGE = 1 

...

}

The project now builds fine. My question is, is this an acceptable solution? If so, why is the memory broken down into small blocks in the first place?

Thanks,

Dave

  • Dave Winterborne said:
    why is the memory broken down into small blocks in the first place?

    Generally speaking, sometimes people will break it down simply better organization. Like partitioning a single hard drive into multiple partitions, each with their own drive letter so you can put specific data on each one (one for OS, one for programs, one for movies, etc). In this specific case for 28335, I don't know the exact reason but if the original two sections are contiguous and the same properties, I see no harm in combining it if that is what you want to do.

  • I suspected that was the case. It's a bit unnecessary to organise the memory to that degree for most applications, since you don't usually need to look at how code/data is stored in memory, but I guess in some cases you do. I'm glad what I'm doing works though, thanks for clarifying.

    Dave