startup_lpc17xx.s GNU

Moderator #1660250
Stefano wrote:
> I have installed Sourcery G++ Lite compiler in Keil IDE.
> Now I start to try to compile a simple Keil example (IOTest) for LPC1768
> Cortex M3.
> The assembler language is different and I need to replace the file
> startup_lpc17xx.s, where can I find the correct version for Sourcery
> assembler ?

NXP provides a "CMSIS-Complient Driver Library" on it's web-site. 
Filename is lpc17xx.cmsis.driver.library.zip. There is startup-code for 
gcc in this package (search .../gcc/startup_LPC17xx.s).
If have not worked with LPC17xx so far but please note that the 
startup-code in the Keil/ARM-examples often includes additional 
instructions in the assembler-setup (e.g. for PLL, clocks). But there is 
initialistaion-code for these settings available in system_LPC17xx.c in 
NXP's archive so porting should be easy.
Guest #1663244
OK, now I can compile without problem, but when link with ld.exe I have 
the following errors:

startup_LPC17xx.s:132: undefined reference to `__cs3_stack'
startup_LPC17xx.s:132: undefined reference to `__cs3_reset'
startup_LPC17xx.s:132: undefined reference to `__start'

Perhaps I should add some parameters .......
What can I do for solve this error ?

Thanks
Moderator #1663480
It seems that the used linker-script is incompatible with the 
startup-code. The undefined symbols get defined by the linker since 
there are instructions for this in the linker-script. The symbols are 
basically variables which hold memory-addresses (for example top of 
stack) and are later used during assembly of the startup-code.
Did you use one of the linker-scripts which come with NXP's package 
(*_gnu.ld)?
Guest #1663521
OK, now I have in added the linker-scrpt file *.ld, the syntax is very 
complex and the example file is very long.
Do you have a simple script-file for base configuration that can send to 
me.

Thanks
Moderator #1663911
Sorry. I do not have a simple ready-made linker-scripts which are 
compatible with the LPC17xx startup-code from NXP. I do not own a board 
with such a controller so I had no reason to create anything for it. But 
if the scripts and startup from NXP work just use them for now. You can 
read more about linker-scripts an the instructions in it in the binutils 
ld manual. The scripts from NXP seem to be based on the Codesourcery 
"standard" for linker-scripts and startup. IRC there is some information 
on this in the "getting-started" PDF-file included in CS G++ lite.

Maybe this is useful for you: 
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/arm_memcards/index.html#chanfat_stm32
It's for another controller also with Cortex-M3 core and it should be 
rather easy to port the linker-script and startup-code to LPC17xx. 
Decide yourself if it's "simple" enough

Maybe someone else can jump in here and provide "simple" an tested 
examples for LPC17xx.
Guest #1664641
OK, now I am near able to work.
I have an other question about CodeSourcery in Keil:
- The "download code to flash memory" is no longer enabled, then I 
cannot program the target, is possible enable this function ?
- The debugger function remain limited to 32K ? or is possible to debug 
code long more then 32k ?


Thanks in advance
Moderator #1664699
Stefano wrote:
> OK, now I am near able to work.
> I have an other question about CodeSourcery in Keil:

The forum/support-request-form at keil.com might be a better place to 
ask questions on µVision.

> - The "download code to flash memory" is no longer enabled, then I
> cannot program the target, is possible enable this function ?

Did you verify that Options for Target/Utilities is configured correctly 
for the used interface? Is an elf-file generated? Did you try with 
"generate hex-file" enabled in the project settings. The download 
function worked for me even when using the GNU cross-toolchain at least 
with older versions of the evaluation-software. I have not played with 
the latest version.

> - The debugger function remain limited to 32K ?

As far as I know: yes. The limiation of the debugger and simulator is 
not related to the used cross-compiler.

> or is possible to debug code long more then 32k ?

Keil/ARM sells unlimited versions and IRC also a less expensive package 
with 256kBytes limitation.

Reply

A question of your own? This thread is over 16 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.