> > typedef struct {
> > reg32 MR0INT :1;
> > reg32 MR0RES :1;
> > reg32 MR0STOP :1;
> > reg32 MR1INT :1;
> > reg32 MR1RES :1;
> > reg32 MR1STOP :1;
> > reg32 MR2INT :1;
> > reg32 MR2RES :1;
> > reg32 MR2STOP :1;
> > reg32 MR3INT :1;
> > reg32 MR3RES :1;
> > reg32 MR3STOP :1;
> > reg32 :20;
> > } __mcr_bits;
The problem here is that gcc for bit field access will generate 8/16/32 bits
access depending on the width of the bit field. This is allowed for memory
based operations if the memeory accepts 8/1/632 bit transfers (most
configurations do), but deadly in case of I/O registers that can only be
written 32 bits at a time.
We have seen large projects where the original sources with I/O as bitfields
(ADS or Greenhills compiler) were all rewritten into macro's for use with
the GCC toolchain.
We also stay safely with that method ;-)
Regards,
Arie de MuynckMessage
Re: [lpc2000] [LPC2104] hardware bug...
2004-09-09 by Arie de Muynck
Attachments
- No local attachments were found for this message.