Content originally posted in LPCWare by stevenQS on Mon Dec 13 05:49:42 MST 2010hi LPC gurus!When creating a binary from the .afx file, we get a .bin of 524MEGAbyte.We assume this has to do with the linker file because we added an extra RAM section, according to http://support.code-red-tech.com/CodeRedWiki/PlacingData.We want to allocate memory in the RamAHB32 section.* device: LPC1768* debugger: LPCexpresso* suite: Red Suite 3.4.6, 256K licenseLinker memory description:
MEMORY
{
/* Define each memory region */
MFlash512 (rx) : ORIGIN = 0x00000, LENGTH = 0x80000 /* 512k */
RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32k */
RamAHB32 (rwx) : ORIGIN = 0x2007c000, LENGTH = 0x8000 /* 32k */
CANAccFilterRAM (rwx) : ORIGIN = 0x40038000, LENGTH = 0x800 /* 2k */
}
|
Linker description:
...
.AHBsection :
{
*(.AHBsection)
} > RamAHB32
...
|
in the code:
__attribute__ ((section(".AHBsection"))) unsigned char dataset0[4096*2]; //2 bytes per value (signed short)
__attribute__ ((section(".AHBsection"))) unsigned char dataset1[4096*2]; //2 bytes per value (signed short)
|
Running the debugger works fine but generating a binary yields the large file. It has to be related with the AHB section because 0x2007c000 = 524Mbyte. Is the linker trying to initialize all memory regions up to 0x2007c000 as FLASH code? Or how do you explicitly tell the linker this AHB section is RAM data and not FLASH code.Thank you!StevenOriginal Attachment has been moved to: 1100907_LPCXpresso.zip