GCC Linker Script for LPC54608

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

GCC Linker Script for LPC54608

1,388 Views
mattp1
Contributor I

Hi All,

I'm working with the gcc-arm-none-eabi toolchain to target the LPC54608. This is the first time I've compiled for bare metal and could use some guidance.

First I modified mem.ld to reflect the Flash and RAM Banks of the LPC54608 as follows:

MEMORY
{
FLASH (rx) : ORIGIN = 0x0, LENGTH = 0x80000 /* 512KB */
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20028000 /* 160KB */
}

A generic Cortex-M4 startup script is included in the toolchain distribution and linker script to layout sections (startup_ARMCM4.s and gcc.ld). Will this be enough to correctly link C code? Can I compile the SystemInit(); function from the LPC54608 Keil SDK with this toolchain to setup my PLL and being writing my own code?

With the upcoming release of the XpressoIDE support for this device is there a publicly available linker script to use?

Thanks,

Matt

Labels (1)
0 Kudos
3 Replies

870 Views
thefallguy
Contributor IV

Will this be enough to correctly link C code?

- for a basic script, yes.

Can I compile the SystemInit(); function from the LPC54608 Keil SDK with this toolchain to setup my PLL and being writing my own code?

- no. Use the one for LPCXpresso (which uses GCC) from LPCOpen

With the upcoming release of the XpressoIDE support for this device is there a publicly available linker script to use?

- LPCXpresso generates the linker script 'on the fly'. It works with the startup file to correctly place and initialise your code (i.e. move initialised from flash to ram etc) and handle multiple memory regions

Why not just use LPCXpresso? It takes a lot of hassle out of your coding and debug...

0 Kudos

870 Views
mattp1
Contributor I

LPCXpresso support for the board is coming later in March, as of right now there is no LPCOpen for the LPC54608.

Thanks for the help, what specifically prevents GCC from compiling system_LPC54608.c?

0 Kudos

870 Views
thefallguy
Contributor IV

Sorry, I don't have direct experience of LPC546xx, so my answers really apply to all earlier LPC parts.

All (previous) version of LPCOpen have specific version for different toolchain because of differences in compilers - essentially how compiler deal with things that are outside of the C standard, such as accessing registers, compiler directives for interrupt handlers etc etc. LPCOpen tended to wrap these differences up in pre-processor macros, where possible, so th actual source code was virtually identical, and the macros, in header files, handled the differences.

So, the only thing I can suggest is for you to try compiling LPC54608.c and then fix the errors as they occur (probably with reference to other versions of LPCOpen to see how they handled the differences between Keil/IAR/GCC/etc compilers.

Given how much NXP have been promoting LPC546xx, I should think NXP will release a new version of LPCXpresso that supports it soon...

0 Kudos