Content originally posted in LPCWare by oingo456 on Mon Apr 05 09:29:48 MST 2010
Hello,
The Linker files created by LPCXpresso code red are incorrect for the LPC1754 and will crash as there isn't ram where the stack is placed. This chip has 32K SRAM, but it is split in 2 blocks. I suspect all 32K linker files are wrong as well. Can this please be fixed?
The SRAM should be 16K located at 0x1000 0000 - 0x1000 3FFF for the local sram, and an addtional 16K block at 0x2007 c000 - 0x2007 ffff for the AHB sram bank 0.
The linker script "projectname_Debug_mem.ld" incorrectly specifies a single ram block 32K starting from 0x1000 0000
In the mean time if anyone else has this problem, you can edit your projectname_Debug_mem.ld and projectname_Release_mem.ld to reduce the sram from 32k to 16K and it will at least work.
1. Change to your DEBUG configuration
2. Change the project settings so it won't overwrite the linker script.
Right click on project, select properties
Go to C/C++ build, SETTINGS in the tree
On the right hand panel, TOOL SETTINGS TAB, MCU Linker, TARGET, **UNCHECK** the box "Manage Linker Script"
3. Change your RELEASE configuration, and repeat #2
4. Now go to your RELEASE & DEBUG subfolders and edit your "projectname_Debug_mem.ld" and "projectname_Release_mem.ld"
Change the ram to reduce it's size to 16K, and save the files
RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x4000 /* 16k */
Now you can at least build & run things. I'm not sure if it's as easy as just adding another ram block here to get the second 16K block to work.
Regards,
Dave in AZ