I am developing small hello world app for Freescale iMX6 board, that will run from On-chip RAM. I am able to run the complete code from OCRAM but if I modify the linker script to generate a data section in external DDR ram's memory space, the output binary file suddenly increases in size from 114 KB to 259 MB. It works just fine if that section is created in OCRAM. It is surely related to linking but I cannot find the reason and how to avoid it. Below are selected portions from the linker script:
`MEMORY
{
OCRAM (rwx) : ORIGIN = 0x00900000, LENGTH = 256K
DDR (rwx) : ORIGIN = 0x10000000, LENGTH = 2048M
}`
.
.
..ex_ram (ORIGIN(DDR)) :
{
. = . + 0x10;
} > DDR
Looks like something related to huge gap between the OCRAM and DDR ram address space to me, but can't rectify it!
AT
command and the concepts of LMA and VMA. I am guessing that you will need to copy your code from DDR to OCRAM on startup as the OCRAM is limited. Your binary must be a solid chunk as dwelch notes. The initial loader will copy the OCRAM code from the load DDR location to the runnning VMA location. This is the standard way to reduce the size of a binary, where code runs from different memory devices. Unallocated sections likeBSS
(Ie, zero memory) do not create output and won't increase the size. – artless noise