public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* ARM7TDMI problem
       [not found] <CANWn+yESRriP137hJHtL2J5oWTuQnq9t3a=paJSQvU-RyAbVAw@mail.gmail.com>
@ 2011-10-11 11:06 ` Hadi Aminzadeh
  2011-10-11 11:26   ` Pawel Sikora
  2011-10-11 11:29   ` Kai Ruottu
  0 siblings, 2 replies; 8+ messages in thread
From: Hadi Aminzadeh @ 2011-10-11 11:06 UTC (permalink / raw)
  To: gcc-help

Hi Dear,

I have a LPC2478 arm processor and want to use gcc to cross compile my
code in x86 for LPC2478
I use arm-linux-gnueabi-gcc to do that but (I think) the output of gcc
is an application that can be run in arm ported linux kernel but I
need Intel HEX-like format that can be programmed to micro controller
(I haven't any OS)
I haven't any idea what to do or what keyword I must search.

Regards,
Aminzadeh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ARM7TDMI problem
  2011-10-11 11:06 ` ARM7TDMI problem Hadi Aminzadeh
@ 2011-10-11 11:26   ` Pawel Sikora
  2011-10-12 16:42     ` Hadi Aminzadeh
  2011-10-11 11:29   ` Kai Ruottu
  1 sibling, 1 reply; 8+ messages in thread
From: Pawel Sikora @ 2011-10-11 11:26 UTC (permalink / raw)
  To: gcc-help; +Cc: Hadi Aminzadeh

On Tuesday 11 of October 2011 14:35:30 Hadi Aminzadeh wrote:
> Hi Dear,
> 
> I have a LPC2478 arm processor and want to use gcc to cross compile my
> code in x86 for LPC2478
> I use arm-linux-gnueabi-gcc to do that but (I think) the output of gcc
> is an application that can be run in arm ported linux kernel but I
> need Intel HEX-like format that can be programmed to micro controller
> (I haven't any OS)
> I haven't any idea what to do or what keyword I must search.

you basically need a proper linker script for small embedded device.
please, see an example at http://www.dreamislife.com/arm/ -> lpc2106_gcc.zip
and search arm groups for similar one tuned for LPC2478...

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ARM7TDMI problem
  2011-10-11 11:06 ` ARM7TDMI problem Hadi Aminzadeh
  2011-10-11 11:26   ` Pawel Sikora
@ 2011-10-11 11:29   ` Kai Ruottu
  1 sibling, 0 replies; 8+ messages in thread
From: Kai Ruottu @ 2011-10-11 11:29 UTC (permalink / raw)
  To: Hadi Aminzadeh; +Cc: gcc-help

11.10.2011 14:05, Hadi Aminzadeh kirjoitti:
> Hi Dear,
>
> I have a LPC2478 arm processor and want to use gcc to cross compile my
> code in x86 for LPC2478
> I use arm-linux-gnueabi-gcc to do that but (I think) the output of gcc
> is an application that can be run in arm ported linux kernel but I
> need Intel HEX-like format that can be programmed to micro controller
> (I haven't any OS)
> I haven't any idea what to do or what keyword I must search.

What about using "gcc for arm" ?  Doing that in Google gave as the 2nd
hit:

http://www.gnuarm.com/

which is one of the many sites in the net providing prebuilt GCCs for
the embedded (no-opsys) ARM systems. Another site coming into my mind
was CodeSourcery which now seemed to be a part of Mentor Graphics:

http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/lite-edition

Of course all us NIH-attitude people will try to produce our own
toolchains from pristine FSF sources but for some the pre-made tools
may be acceptable... :)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ARM7TDMI problem
  2011-10-11 11:26   ` Pawel Sikora
@ 2011-10-12 16:42     ` Hadi Aminzadeh
  2011-10-12 17:51       ` Paweł Sikora
  0 siblings, 1 reply; 8+ messages in thread
From: Hadi Aminzadeh @ 2011-10-12 16:42 UTC (permalink / raw)
  To: gcc-help; +Cc: Pawel Sikora

On Tue, Oct 11, 2011 at 2:55 PM, Pawel Sikora <pluto@agmk.net> wrote:
> On Tuesday 11 of October 2011 14:35:30 Hadi Aminzadeh wrote:
>> Hi Dear,
>>
>> I have a LPC2478 arm processor and want to use gcc to cross compile my
>> code in x86 for LPC2478
>> I use arm-linux-gnueabi-gcc to do that but (I think) the output of gcc
>> is an application that can be run in arm ported linux kernel but I
>> need Intel HEX-like format that can be programmed to micro controller
>> (I haven't any OS)
>> I haven't any idea what to do or what keyword I must search.
>
> you basically need a proper linker script for small embedded device.
> please, see an example at http://www.dreamislife.com/arm/ -> lpc2106_gcc.zip
> and search arm groups for similar one tuned for LPC2478...
>
>

Thanks for your replay
I find a linker script for my device (that tested with my board) and
used gnuarm pre-compiled binary and eclipse to compile my tested
simple LED flasher program. but no success :-(
you can see the output of eclipse. have any idea?

make all
Building file: ../main.c
Invoking: GCC C Compiler
/home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-gcc -O3 -g -Wall -c
-fmessage-length=0 -mcpu=arm7tdmi-s -MMD -MP -MF"main.d" -MT"main.d"
-o"main.o" "../main.c"
Finished building: ../main.c

Building target: lpc2478
Invoking: GCC C Linker
/home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-gcc -mcpu=arm7tdmi-s
-nostartfiles -T /home/hadi/workspace/lpc2478/LPC2478.ld -o"lpc2478"
./main.o
Finished building target: lpc2478

make --no-print-directory post-build
/home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-objcopy --output-target
ihex lpc2478 lpc2478.hex

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ARM7TDMI problem
  2011-10-12 16:42     ` Hadi Aminzadeh
@ 2011-10-12 17:51       ` Paweł Sikora
       [not found]         ` <CANWn+yEDQyw9_LKfsxeNLHo6_EYdyg1pbnfFGSv442bnwq=bWQ@mail.gmail.com>
  0 siblings, 1 reply; 8+ messages in thread
From: Paweł Sikora @ 2011-10-12 17:51 UTC (permalink / raw)
  To: Hadi Aminzadeh; +Cc: gcc-help

On Wednesday 12 of October 2011 18:41:42 Hadi Aminzadeh wrote:
> On Tue, Oct 11, 2011 at 2:55 PM, Pawel Sikora <pluto@agmk.net> wrote:
> > On Tuesday 11 of October 2011 14:35:30 Hadi Aminzadeh wrote:
> >> Hi Dear,
> >>
> >> I have a LPC2478 arm processor and want to use gcc to cross compile my
> >> code in x86 for LPC2478
> >> I use arm-linux-gnueabi-gcc to do that but (I think) the output of gcc
> >> is an application that can be run in arm ported linux kernel but I
> >> need Intel HEX-like format that can be programmed to micro controller
> >> (I haven't any OS)
> >> I haven't any idea what to do or what keyword I must search.
> >
> > you basically need a proper linker script for small embedded device.
> > please, see an example at http://www.dreamislife.com/arm/ -> lpc2106_gcc.zip
> > and search arm groups for similar one tuned for LPC2478...
> >
> >
> 
> Thanks for your replay
> I find a linker script for my device (that tested with my board) and
> used gnuarm pre-compiled binary and eclipse to compile my tested
> simple LED flasher program. but no success :-(
> you can see the output of eclipse. have any idea?
> 
> make all
> Building file: ../main.c
> Invoking: GCC C Compiler
> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-gcc -O3 -g -Wall -c
> -fmessage-length=0 -mcpu=arm7tdmi-s -MMD -MP -MF"main.d" -MT"main.d"
> -o"main.o" "../main.c"
> Finished building: ../main.c
> 
> Building target: lpc2478
> Invoking: GCC C Linker
> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-gcc -mcpu=arm7tdmi-s
> -nostartfiles -T /home/hadi/workspace/lpc2478/LPC2478.ld -o"lpc2478"
> ./main.o
> Finished building target: lpc2478
> 
> make --no-print-directory post-build
> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-objcopy --output-target
> ihex lpc2478 lpc2478.hex
> 

please show the 'simple LED flasher' source and 'arm-elf-objdump -hw lpc2478'.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ARM7TDMI problem
       [not found]         ` <CANWn+yEDQyw9_LKfsxeNLHo6_EYdyg1pbnfFGSv442bnwq=bWQ@mail.gmail.com>
@ 2011-10-13  5:50           ` Paweł Sikora
  2011-10-13 11:11             ` Hadi Aminzadeh
  0 siblings, 1 reply; 8+ messages in thread
From: Paweł Sikora @ 2011-10-13  5:50 UTC (permalink / raw)
  To: Hadi Aminzadeh; +Cc: gcc-help

On Thursday 13 of October 2011 07:37:26 Hadi Aminzadeh wrote:
> 2011/10/12 PaweÂł Sikora <pluto@agmk.net>:
> > On Wednesday 12 of October 2011 18:41:42 Hadi Aminzadeh wrote:
> >> On Tue, Oct 11, 2011 at 2:55 PM, Pawel Sikora <pluto@agmk.net> wrote:
> >> > On Tuesday 11 of October 2011 14:35:30 Hadi Aminzadeh wrote:
> >> >> Hi Dear,
> >> >>
> >> >> I have a LPC2478 arm processor and want to use gcc to cross compile my
> >> >> code in x86 for LPC2478
> >> >> I use arm-linux-gnueabi-gcc to do that but (I think) the output of gcc
> >> >> is an application that can be run in arm ported linux kernel but I
> >> >> need Intel HEX-like format that can be programmed to micro controller
> >> >> (I haven't any OS)
> >> >> I haven't any idea what to do or what keyword I must search.
> >> >
> >> > you basically need a proper linker script for small embedded device.
> >> > please, see an example at http://www.dreamislife.com/arm/ -> lpc2106_gcc.zip
> >> > and search arm groups for similar one tuned for LPC2478...
> >> >
> >> >
> >>
> >> Thanks for your replay
> >> I find a linker script for my device (that tested with my board) and
> >> used gnuarm pre-compiled binary and eclipse to compile my tested
> >> simple LED flasher program. but no success :-(
> >> you can see the output of eclipse. have any idea?
> >>
> >> make all
> >> Building file: ../main.c
> >> Invoking: GCC C Compiler
> >> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-gcc -O3 -g -Wall -c
> >> -fmessage-length=0 -mcpu=arm7tdmi-s -MMD -MP -MF"main.d" -MT"main.d"
> >> -o"main.o" "../main.c"
> >> Finished building: ../main.c
> >>
> >> Building target: lpc2478
> >> Invoking: GCC C Linker
> >> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-gcc -mcpu=arm7tdmi-s
> >> -nostartfiles -T /home/hadi/workspace/lpc2478/LPC2478.ld -o"lpc2478"
> >> ./main.o
> >> Finished building target: lpc2478
> >>
> >> make --no-print-directory post-build
> >> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-objcopy --output-target
> >> ihex lpc2478 lpc2478.hex
> >>
> >
> > please show the 'simple LED flasher' source and 'arm-elf-objdump -hw lpc2478'.
> >
> 
> I attach all of them.
> Thanks for your time.
> 


the delay_ms() function was optimized at compile time to plain 'return'
you can see this with -fdump-tree-optimized gcc option.
and finally the hexdump shows .debug* sections in binary - there's no need
to waste eeprom resources with debuginfo.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ARM7TDMI problem
  2011-10-13  5:50           ` Paweł Sikora
@ 2011-10-13 11:11             ` Hadi Aminzadeh
  2011-10-13 11:18               ` Pawel Sikora
  0 siblings, 1 reply; 8+ messages in thread
From: Hadi Aminzadeh @ 2011-10-13 11:11 UTC (permalink / raw)
  To: Paweł Sikora; +Cc: gcc-help

2011/10/13 Paweł Sikora <pluto@agmk.net>:
> On Thursday 13 of October 2011 07:37:26 Hadi Aminzadeh wrote:
>> 2011/10/12 Paweł Sikora <pluto@agmk.net>:
>> > On Wednesday 12 of October 2011 18:41:42 Hadi Aminzadeh wrote:
>> >> On Tue, Oct 11, 2011 at 2:55 PM, Pawel Sikora <pluto@agmk.net> wrote:
>> >> > On Tuesday 11 of October 2011 14:35:30 Hadi Aminzadeh wrote:
>> >> >> Hi Dear,
>> >> >>
>> >> >> I have a LPC2478 arm processor and want to use gcc to cross compile my
>> >> >> code in x86 for LPC2478
>> >> >> I use arm-linux-gnueabi-gcc to do that but (I think) the output of gcc
>> >> >> is an application that can be run in arm ported linux kernel but I
>> >> >> need Intel HEX-like format that can be programmed to micro controller
>> >> >> (I haven't any OS)
>> >> >> I haven't any idea what to do or what keyword I must search.
>> >> >
>> >> > you basically need a proper linker script for small embedded device.
>> >> > please, see an example at http://www.dreamislife.com/arm/ -> lpc2106_gcc.zip
>> >> > and search arm groups for similar one tuned for LPC2478...
>> >> >
>> >> >
>> >>
>> >> Thanks for your replay
>> >> I find a linker script for my device (that tested with my board) and
>> >> used gnuarm pre-compiled binary and eclipse to compile my tested
>> >> simple LED flasher program. but no success :-(
>> >> you can see the output of eclipse. have any idea?
>> >>
>> >> make all
>> >> Building file: ../main.c
>> >> Invoking: GCC C Compiler
>> >> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-gcc -O3 -g -Wall -c
>> >> -fmessage-length=0 -mcpu=arm7tdmi-s -MMD -MP -MF"main.d" -MT"main.d"
>> >> -o"main.o" "../main.c"
>> >> Finished building: ../main.c
>> >>
>> >> Building target: lpc2478
>> >> Invoking: GCC C Linker
>> >> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-gcc -mcpu=arm7tdmi-s
>> >> -nostartfiles -T /home/hadi/workspace/lpc2478/LPC2478.ld -o"lpc2478"
>> >> ./main.o
>> >> Finished building target: lpc2478
>> >>
>> >> make --no-print-directory post-build
>> >> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-objcopy --output-target
>> >> ihex lpc2478 lpc2478.hex
>> >>
>> >
>> > please show the 'simple LED flasher' source and 'arm-elf-objdump -hw lpc2478'.
>> >
>>
>> I attach all of them.
>> Thanks for your time.
>>
>
>
> the delay_ms() function was optimized at compile time to plain 'return'
> you can see this with -fdump-tree-optimized gcc option.
> and finally the hexdump shows .debug* sections in binary - there's no need
> to waste eeprom resources with debuginfo.
>

ok I disable the optimization ( -O0 ) but nothing happend :-(
Is it possible to generate an lst file ? I think it can help to find problem.

Regards,
Aminzadeh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: ARM7TDMI problem
  2011-10-13 11:11             ` Hadi Aminzadeh
@ 2011-10-13 11:18               ` Pawel Sikora
  0 siblings, 0 replies; 8+ messages in thread
From: Pawel Sikora @ 2011-10-13 11:18 UTC (permalink / raw)
  To: Hadi Aminzadeh; +Cc: gcc-help

On Thursday 13 of October 2011 14:40:50 Hadi Aminzadeh wrote:
> 2011/10/13 Paweł Sikora <pluto@agmk.net>:
> > On Thursday 13 of October 2011 07:37:26 Hadi Aminzadeh wrote:
> >> 2011/10/12 Paweł Sikora <pluto@agmk.net>:
> >> > On Wednesday 12 of October 2011 18:41:42 Hadi Aminzadeh wrote:
> >> >> On Tue, Oct 11, 2011 at 2:55 PM, Pawel Sikora <pluto@agmk.net> wrote:
> >> >> > On Tuesday 11 of October 2011 14:35:30 Hadi Aminzadeh wrote:
> >> >> >> Hi Dear,
> >> >> >>
> >> >> >> I have a LPC2478 arm processor and want to use gcc to cross compile my
> >> >> >> code in x86 for LPC2478
> >> >> >> I use arm-linux-gnueabi-gcc to do that but (I think) the output of gcc
> >> >> >> is an application that can be run in arm ported linux kernel but I
> >> >> >> need Intel HEX-like format that can be programmed to micro controller
> >> >> >> (I haven't any OS)
> >> >> >> I haven't any idea what to do or what keyword I must search.
> >> >> >
> >> >> > you basically need a proper linker script for small embedded device.
> >> >> > please, see an example at http://www.dreamislife.com/arm/ -> lpc2106_gcc.zip
> >> >> > and search arm groups for similar one tuned for LPC2478...
> >> >> >
> >> >> >
> >> >>
> >> >> Thanks for your replay
> >> >> I find a linker script for my device (that tested with my board) and
> >> >> used gnuarm pre-compiled binary and eclipse to compile my tested
> >> >> simple LED flasher program. but no success :-(
> >> >> you can see the output of eclipse. have any idea?
> >> >>
> >> >> make all
> >> >> Building file: ../main.c
> >> >> Invoking: GCC C Compiler
> >> >> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-gcc -O3 -g -Wall -c
> >> >> -fmessage-length=0 -mcpu=arm7tdmi-s -MMD -MP -MF"main.d" -MT"main.d"
> >> >> -o"main.o" "../main.c"
> >> >> Finished building: ../main.c
> >> >>
> >> >> Building target: lpc2478
> >> >> Invoking: GCC C Linker
> >> >> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-gcc -mcpu=arm7tdmi-s
> >> >> -nostartfiles -T /home/hadi/workspace/lpc2478/LPC2478.ld -o"lpc2478"
> >> >> ./main.o
> >> >> Finished building target: lpc2478
> >> >>
> >> >> make --no-print-directory post-build
> >> >> /home/noBackup/arm/gnuarm-4.0.2/bin/arm-elf-objcopy --output-target
> >> >> ihex lpc2478 lpc2478.hex
> >> >>
> >> >
> >> > please show the 'simple LED flasher' source and 'arm-elf-objdump -hw lpc2478'.
> >> >
> >>
> >> I attach all of them.
> >> Thanks for your time.
> >>
> >
> >
> > the delay_ms() function was optimized at compile time to plain 'return'
> > you can see this with -fdump-tree-optimized gcc option.
> > and finally the hexdump shows .debug* sections in binary - there's no need
> > to waste eeprom resources with debuginfo.
> >
> 
> ok I disable the optimization ( -O0 ) but nothing happend :-(
> Is it possible to generate an lst file ? I think it can help to find problem.

man gcc: --save-temps, -fverbose-asm

> 
> Regards,
> Aminzadeh

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-10-13 11:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CANWn+yESRriP137hJHtL2J5oWTuQnq9t3a=paJSQvU-RyAbVAw@mail.gmail.com>
2011-10-11 11:06 ` ARM7TDMI problem Hadi Aminzadeh
2011-10-11 11:26   ` Pawel Sikora
2011-10-12 16:42     ` Hadi Aminzadeh
2011-10-12 17:51       ` Paweł Sikora
     [not found]         ` <CANWn+yEDQyw9_LKfsxeNLHo6_EYdyg1pbnfFGSv442bnwq=bWQ@mail.gmail.com>
2011-10-13  5:50           ` Paweł Sikora
2011-10-13 11:11             ` Hadi Aminzadeh
2011-10-13 11:18               ` Pawel Sikora
2011-10-11 11:29   ` Kai Ruottu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).