Linker SRAM not correct for LPC1754, code crashes

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linker SRAM not correct for LPC1754, code crashes

769 Views
lpcware
NXP Employee
NXP Employee
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
0 Kudos
Reply
3 Replies

750 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Tue Apr 06 00:34:08 MST 2010
Hi,

Thanks for reporting this. It has been fixed and will be available in the next release.
0 Kudos
Reply

750 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Mon Apr 05 10:19:27 MST 2010
Hi,

I can't comment on the LPC1754 linker scripts, as I've only used the LPC1768. But the linker scripts for that seem fine. There is some info on using your own scripts which might be of use to you in the CodeRed software knowledgebase (which requires you to login before accessing) at:

http://lpcxpresso.code-red-tech.com/LPCXpresso/node/31

However, I'm a bit confused as to why you think the I/O include files are missing. These are all contained in the CMSIS project files that you can find in the examples that come with your lpcxpresso installation. There is more info on CMSIS at:

http://lpcxpresso.code-red-tech.com/LPCXpresso/node/21

HTH :)
0 Kudos
Reply

750 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by oingo456 on Mon Apr 05 09:36:08 MST 2010
I also forgot to mention that LPCXpresso is still missing include files for most of the I/O on the LPC1754.. I'm not sure were to get them from NXP but found them from Keil.   The NXP CMIS files don't have the I/O.    So far it has been difficult working with the incomplete tools.
0 Kudos
Reply