Yahoo Groups archive

Lpc2000

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

Message

Re: SOLVED! Re: [lpc2000] GNUARM weirdness ?

2005-07-21 by Arie de Muynck

> > DECwiz (Fred van Kempen) :
> > Further checking revealed, that something else was wrong: I was
> >
> > using bitfield structures to reference (and initialize) the BCFG2
> > register.  A printf() on its contents (both in the GNUARM and IAR
> > versions) showed a major difference.  I changed that code to just
> > ...
> >
> > So... the bitfield structures don't seem to work with GCC, which I can
> > live with now I know it...
>
> The order how the bits are stored in a bitfield is not defined by
standard.
> This might be the reason, why gcc writes a different value than IAR.
>
> -- 
> 42Bastian Schick


No, it is a different (and known) problem.

The GCC compiler will use a byte or word16 access to set/clear a small field
in the word32: and that will fail on an I/O register that can only be read
or written 32 bits at a time.
You could do the bitfield operations on a copy in RAM, then write the
complete value to the register.

Bit me too (pun intended).

Arie de Muynck

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.