Setting build parameters for a sub-tree of RTEMS sources

John M. Mills jmills at tga.com
Mon Apr 24 14:33:18 UTC 2000


Nick,

On Mon, 24 Apr 2000 Nick.SIMON at syntegra.bt.co.uk wrote:
> 'Fraid I don't know the answer to John's question, but I'm most concerned
> about problems with 'volatile' - can anyone shed any light on this?

I don't know how general might be the problems, but the specifics are:
1) I am using Joel's 'rpms' for the sh-rtems toolset, essentially
   gcc-2.95.2, I believe. I have not observed other problems with these
   tools. (Thanks, Joel.)
2) I am staying close to Ralf Crosepius' SH-1 BSP, which provides macros
   to read and write on-chip register. For example:
   'c/src/exec/score/cpu/sh/rtems/score/sh_io.h' defines:
'#define read8(addr)  (*(volatile unsigned8 *) (addr))'

so a line like:
   'temp8 = read8(SOME_ONCHIP_REG);' should try to read the named byte.

My typical code then goes on to set and clear bits, then rewrites the
register from 'temp8'.

I was failing to set some registers when (in gensh2.cfg) I used:
CFLAGS_DEBUG_V= -O1

while the were being set successfully by:
CFLAGS_DEBUG_V= -O4

Declaring 'volatile unsigned8 temp8;' had no effect on the failure.

I found the problem with enabling serial output, but I must assume it
could be affecting my other hardware setup routines.

I haven't tried to see what '-O1' really implies, but it seems very
aggressive with this processor ('-m2'), and does produce very compact
executables. (A "_Good_Thing_"[TM]). It just seems toxic to my hardware
setup. !(A "_Good_Thing_"[8-(])

I can send anyone snippets of the assembly-language results for the SCI
registers; they're pretty short, but I didn't think they would be of
general interest for such a specific case.

Thanks -

   John Mills
   Sr. Software Engineer
   TGA Technologies, Inc.
   100 Pinnacle Way, Suite 140
   Norcross, GA 30071-3633
   e-mail: jmills at tga.com
   Phone: 770-441-2100 ext.124 (voice)
          770-449-7740 (FAX)




More information about the users mailing list