Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: Problem with GNUARM 3.4.3

2005-02-15 by Anton Erasmus

On 15 Feb 2005 at 20:02, Rick Collins wrote:

> 
> 
> Why don't you ask this in the gnuarm group?  
> 
> http://groups.yahoo.com/group/gnuarm
> 
> There are tons of good people who can likely answer your question. 

I am not sure if it is an actual compiler problem, and not some linker script 
problem or some other finger problem. Since the example code is LPC
specific, I thought others might have compiled it succesfully with gcc 3.4.3.
If it is not some LPC specific problem, I will ask in the gnuarm group.


> Also, I am curious, which web site did you use to download the code?
> Did you do your own compile of the tools?  

I used the binary tools from http://www.gnuarm.com. Both the Windows/cygwin
binary and the linux binary. I also built the compiler using the script and sources
from Rod Moffitt's site. The problem is the same, both when compiled as ARM
only code and ARM/THUMB code. 

Regards
   Anton Erasmus

> 
> --- In lpc2000@yahoogroups.com, "Anton Erasmus" <antone@s...> wrote: >
> Hi, > > I have installed the latest GNUARM which is based on gcc
> 3.4.3. > I downloaded the UT040803A.zip uart example from the files >
> area. > I compiled and downloaded the code to a LPC2292 board. The
> code > runs as expected except for one thing. In stead of printing
> "Hello World!", > it displays garbage. > The main routine is as
> follows: > > int main(void) > { >   uint32_t startTime; > >  
> sysInit(); > #if defined(UART0_TX_INT_MODE) ||
> defined(UART0_RX_INT_MODE) >   enableIRQ(); > #endif >   startTime =
> getSysTICs(); >   uart0Puts("\r\nHello World!\r\n"); > >   for (;;) > 
>    { >     do >       { >       int ch; > >       if ((ch =
> uart0Getch()) >= 0) >         uart0Putch(ch); >       } >     while
> (getElapsedSysTICs(startTime) < HALF_SEC); > >     IOPIN ^= LED2_BIT;
> > >     startTime += HALF_SEC; >     } > >   return 0; > } > > The
> section after the uart0Puts works. When I press a key on the serial
> terminal, it is > echoed correctly back. So it seems that the baud
> rate etc. is correct. If I compile the > code with no optimisation 
> (Default is set to O2), then it prints the "Hello World!" as >
> expected. If I add a uart0Putch('U') before the uart0Puts, the U is
> printed. If I add more, > then sometimes the "Hello World!" is printed
> correctly. I have looked in the hex file > generated, and the ASCII
> data is put in the .rodata section as expected. It looks as if > the
> ASCII strings are aligned at 4 byte boundaries, so I do not think it
> is an alignment > problem. > Has anyone else had problems with literal
> strings using gcc 3.4.3 ? Any suggestions on > where I can look to
> find the problem would be appreciated. > > Regards >    Anton Erasmus
> > > > -- > A J Erasmus
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 

-- 
A J Erasmus

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.