public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Building rommable images for the AEB-1C
@ 2000-01-06  4:38 Nicholas_Clarey
  2000-01-06  5:00 ` Gary Thomas
  0 siblings, 1 reply; 10+ messages in thread
From: Nicholas_Clarey @ 2000-01-06  4:38 UTC (permalink / raw)
  To: ecos-discuss

Howdy all,

I've been trying to create an image that I can put into the Arm Evaluation 
Board flash rom so that I can take over the serial port and play with it. 
Unfortunately, it's not working.

I have managed the first stage of producing the CVS gdb stubs and flashed 
them successfully, and have written test programs, downloaded them and 
played with them fine. I followed all the necessary instructions in the 
documentation to do this.

Here's what I've done so far;

- produced the build directory with the following command;

tclsh BASE_DIR/packages/pkgconf.tcl --target=arm --platform=aebC--startup=rom

which I figured would do what was necessary to give me libraries and stuff 
I could link with and place in ROM rather than RAM.

- edited the pkgconf/serial_io.h header file to enable the serial port(s) 
by #defining the aeb serial port stuff
- run "make"
- wrote a simple c program that opened the serial port and dumped some 
trivial data to it

When I try to compile the c program in the last step, I did the following;

arm-elf-gcc -Iinstall/include testfile.c -Linstall/lib -Ttarget.ld -nostdlib

and I get two errors and two warnings;

testfile.c: In function `cyg_user_start':
testfile.c:32: warning: passing arg 4 of `cyg_io_set_config' makes pointer 
from integer without a cast
testfile.c:37: warning: passing arg 3 of `cyg_io_write' makes pointer from 
integer without a cast
/usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
-ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: address 0x40219ac of 
a.out section .text is not within region rom
/usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
-ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: address 0x4021c34 of 
a.out section .rodata is not within region rom
/usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
-ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory 
region specified for section `.glue_7'
/usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
-ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory 
region specified for section `.glue_7t'
collect2: ld returned 1 exit status

Can someone tell me what I have to do to produce an image that I can stick 
in flash rom and run instead of the gdb stubs? Also, what do the two *link* 
warnings mean?

Thanks,

Nick

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

* RE: [ECOS] Building rommable images for the AEB-1C
  2000-01-06  4:38 [ECOS] Building rommable images for the AEB-1C Nicholas_Clarey
@ 2000-01-06  5:00 ` Gary Thomas
  2000-01-06  6:50   ` Grant Edwards
  0 siblings, 1 reply; 10+ messages in thread
From: Gary Thomas @ 2000-01-06  5:00 UTC (permalink / raw)
  To: Nicholas_Clarey; +Cc: ecos-discuss

On 06-Jan-00 Nicholas_Clarey@ivesco.co.uk wrote:
> Howdy all,
> 
> I've been trying to create an image that I can put into the Arm Evaluation 
> 
> Board flash rom so that I can take over the serial port and play with it. 
> Unfortunately, it's not working.
> 
> I have managed the first stage of producing the CVS gdb stubs and flashed 
> them successfully, and have written test programs, downloaded them and 
> played with them fine. I followed all the necessary instructions in the 
> documentation to do this.
> 
> Here's what I've done so far;
> 
> - produced the build directory with the following command;
> 
> tclsh BASE_DIR/packages/pkgconf.tcl --target=arm 
> --platform=aebC--startup=rom
> 
> which I figured would do what was necessary to give me libraries and stuff 
> 
> I could link with and place in ROM rather than RAM.
> 
> - edited the pkgconf/serial_io.h header file to enable the serial port(s) 
> by #defining the aeb serial port stuff
> - run "make"
> - wrote a simple c program that opened the serial port and dumped some 
> trivial data to it
> 
> When I try to compile the c program in the last step, I did the following;
> 
> arm-elf-gcc -Iinstall/include testfile.c -Linstall/lib -Ttarget.ld 
> -nostdlib
> 
> and I get two errors and two warnings;
> 
> testfile.c: In function `cyg_user_start':
> testfile.c:32: warning: passing arg 4 of `cyg_io_set_config' makes pointer 
> 
> from integer without a cast
> testfile.c:37: warning: passing arg 3 of `cyg_io_write' makes pointer from 
> 
> integer without a cast

I'd have to see your sources to know exactly why you get these warnings.
However, they are from the compiler, telling you that you are apparently not
passing the correct "type" of information to the cyg_io_XXX() functions.

The severity of such missuse can range from being totally benign to complete
failure.  In particular, the second warning says that you've passed an integer
and not a pointer as the third parameter to 'cyg_io_write()'.  This parameter
must be a pointer to the length, not the length itself.  This is because the
function returns the actual number of bytes written in the variable, in case
it differed for some reason from the requested number.

> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
> 
> -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: address 0x40219ac of 
> a.out section .text is not within region rom
> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
> 
> -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: address 0x4021c34 of 
> a.out section .rodata is not within region rom

If you look at the ROM layout, you'll see that it is only set up to handle
small programs in the flash/ROM.  The default setup is for 32K (0x8000) bytes
at the end of the flash.  The flash on that board is quite limited (128K) and
we didn't want to destroy what was already there (the boot loader, etc).

> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
> 
> -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory 
> region specified for section `.glue_7'
> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
> 
> -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory 
> region specified for section `.glue_7t'

I don't understand these warnings at all [yes, I know what they mean, I just
don't know how you created them].  

What compiler/toolset are you using?
Did you use any special compiler options when building the program?

The other thing to note about running programs in flash/ROM on the AEB is that
eCos assumes that the ARM bootloader is in place, even for these.  This means
that you'll need to set up a flash image "module" which follows the ARM rules.
This is a rather tricky process and not terribly simple to automate.  You
can look at ".../hal/arm/aeb/XXX/misc/PKGconf.mak" to see how it is done for
the GDB stubs.

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

* Re: [ECOS] Building rommable images for the AEB-1C
  2000-01-06  5:00 ` Gary Thomas
@ 2000-01-06  6:50   ` Grant Edwards
  2000-01-06  7:01     ` Gary Thomas
  2000-01-06  7:03     ` Dan Hovang
  0 siblings, 2 replies; 10+ messages in thread
From: Grant Edwards @ 2000-01-06  6:50 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Nicholas_Clarey, ecos-discuss

> > /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
> > 
> > -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory 
> > region specified for section `.glue_7'
> > /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
> > 
> > -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory 
> > region specified for section `.glue_7t'
> 
> I don't understand these warnings at all [yes, I know what they mean, I just
> don't know how you created them].  

I've always gotten the "glue" sections when I build stuff for the ARM.
I had to add an output section to the target.ld file to make the
linker happy:

    .glue   ALIGN (0x1)  :      { . = . ; *(.glue*) } >  ram

The "glue" sections are empty, IIRC.

I'm using:

$ arm-elf-gcc --version
2.95.2

$ arm-elf-ld --version
GNU ld 2.9.5

$ arm-elf-as --version
GNU assembler 991018

-- 
Grant Edwards
grante@visi.com

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

* Re: [ECOS] Building rommable images for the AEB-1C
  2000-01-06  6:50   ` Grant Edwards
@ 2000-01-06  7:01     ` Gary Thomas
  2000-01-06  7:03     ` Dan Hovang
  1 sibling, 0 replies; 10+ messages in thread
From: Gary Thomas @ 2000-01-06  7:01 UTC (permalink / raw)
  To: Grant Edwards; +Cc: ecos-discuss, Nicholas_Clarey

On 06-Jan-00 Grant Edwards wrote:
> 
>> > /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
>> > 
>> > -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory 
>> > region specified for section `.glue_7'
>> > /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
>> > 
>> > -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory 
>> > region specified for section `.glue_7t'
>> 
>> I don't understand these warnings at all [yes, I know what they mean, I just
>> don't know how you created them].  
> 
> I've always gotten the "glue" sections when I build stuff for the ARM.
> I had to add an output section to the target.ld file to make the
> linker happy:
> 
>     .glue   ALIGN (0x1)  :      { . = . ; *(.glue*) } >  ram
> 

This sounds like a toolchain problem.  The ".glue" sections should only be present
if compiling in THUMB mode.

However, if they are indeed empty, then this should not be a problem to just ignore
the warnings.

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

* Re: [ECOS] Building rommable images for the AEB-1C
  2000-01-06  6:50   ` Grant Edwards
  2000-01-06  7:01     ` Gary Thomas
@ 2000-01-06  7:03     ` Dan Hovang
  1 sibling, 0 replies; 10+ messages in thread
From: Dan Hovang @ 2000-01-06  7:03 UTC (permalink / raw)
  To: Grant Edwards, ecos-discuss

Grant Edwards wrote:
> 
> I've always gotten the "glue" sections when I build stuff for the ARM.

glue_7 sections contains code to "glue" code sections containing ARM
code to sections containing Thumb code. glue_7t is the other way
(Thumb to ARM). Perhaps more recent versions of the ecosSWtoolchain
removes empty sections without any notice?

/Dan

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

* Re: [ECOS] Building rommable images for the AEB-1C
  2000-01-07  6:46   ` Dan Hovang
@ 2000-01-07  7:19     ` Gary Thomas
  0 siblings, 0 replies; 10+ messages in thread
From: Gary Thomas @ 2000-01-07  7:19 UTC (permalink / raw)
  To: Dan Hovang; +Cc: eCos Discussion

I haven't seen this myself, so there may be something different in
our setups.

Can you send me the [binary] images?  Then I can have our tools guys
look at them to see what the problem is.

On 07-Jan-00 Dan Hovang wrote:
> Gary Thomas wrote:
>> 
>> You really should use *all* of the options used by the standard eCos
>> setup. In particular, these options tell the linker to throw away any
>> unused code. In your test case, this amounts to more than 100K bytes!
>> The image I build fits in ROM, even in the meager 32K defined as
>> default.
> 
> The --gc-sections linkoption seems to corrupt the debuginfo, though.
> 
> When using -ffunction-sections -fdata-sections with compile and
> --gc-sections with link and trying to connect with gdb i got:
> 
> (gdb) target remote com1
> Remote debugging using com1
> 0xec78 in breakinst () at include/new:27
> 27      include/new: No such file or directory.
> 
> without -Wl,--gc-sections I get:
> 
> (gdb) target remote com1
> Remote debugging using com1
> 0x136a4 in breakinst ()
>     at ecos/packages/hal/arm/arch/v1_2_1/src/hal_misc.c:204
> 204         HAL_BREAKPOINT(breakinst);
> Current language:  auto; currently c
> 
> Perhaps I'm missing some other option?
> 
> The compiler options are:
> 
> -g -O2 -Wall -Wpointer-arith -Winline -Wundef -Wstrict-prototypes
> -Woverloaded-virtual -fno-rtti -fno-exceptions -fvtable-gc
> -ffunction-sections -fdata-sections
> 
> And link options are:
> 
> -g -nostdlib -Wl,-static
> 
> I'm using ecosSWtools-arm-990321. I've also tried using the Insigth
> 19991222 snapshot.
> 
> /Dan
> 

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

* Re: [ECOS] Building rommable images for the AEB-1C
  2000-01-06  7:15 ` Gary Thomas
@ 2000-01-07  6:46   ` Dan Hovang
  2000-01-07  7:19     ` Gary Thomas
  0 siblings, 1 reply; 10+ messages in thread
From: Dan Hovang @ 2000-01-07  6:46 UTC (permalink / raw)
  To: Gary Thomas; +Cc: Nicholas_Clarey, eCos Discussion

Gary Thomas wrote:
> 
> You really should use *all* of the options used by the standard eCos
> setup. In particular, these options tell the linker to throw away any
> unused code. In your test case, this amounts to more than 100K bytes!
> The image I build fits in ROM, even in the meager 32K defined as
> default.

The --gc-sections linkoption seems to corrupt the debuginfo, though.

When using -ffunction-sections -fdata-sections with compile and
--gc-sections with link and trying to connect with gdb i got:

(gdb) target remote com1
Remote debugging using com1
0xec78 in breakinst () at include/new:27
27      include/new: No such file or directory.

without -Wl,--gc-sections I get:

(gdb) target remote com1
Remote debugging using com1
0x136a4 in breakinst ()
    at ecos/packages/hal/arm/arch/v1_2_1/src/hal_misc.c:204
204         HAL_BREAKPOINT(breakinst);
Current language:  auto; currently c

Perhaps I'm missing some other option?

The compiler options are:

-g -O2 -Wall -Wpointer-arith -Winline -Wundef -Wstrict-prototypes
-Woverloaded-virtual -fno-rtti -fno-exceptions -fvtable-gc
-ffunction-sections -fdata-sections

And link options are:

-g -nostdlib -Wl,-static

I'm using ecosSWtools-arm-990321. I've also tried using the Insigth
19991222 snapshot.

/Dan

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

* RE: [ECOS] Building rommable images for the AEB-1C
       [not found] <OF7B928FC7.8F137C30-ON8025685E.005316F3@ivesco.co.uk>
@ 2000-01-06  7:15 ` Gary Thomas
  2000-01-07  6:46   ` Dan Hovang
  0 siblings, 1 reply; 10+ messages in thread
From: Gary Thomas @ 2000-01-06  7:15 UTC (permalink / raw)
  To: Nicholas_Clarey; +Cc: eCos Discussion

On 06-Jan-00 Nicholas_Clarey@ivesco.co.uk wrote:
> Hi Gary,
> 
> All I did was;
> 
> arm-elf-gcc -Iinstall/include testfile.c -Linstall/lib -Ttarget.ld 
> -nostdlib
> 

You really should use *all* of the options used by the standard eCos setup.
In particular, these options tell the linker to throw away any unused code.
In your test case, this amounts to more than 100K bytes!  The image I
build fits in ROM, even in the meager 32K defined as default.

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

* RE: [ECOS] Building rommable images for the AEB-1C
       [not found] <OF3C6DA87D.CDC4B358-ON8025685E.004A10DF@ivesco.co.uk>
@ 2000-01-06  6:45 ` Gary Thomas
  0 siblings, 0 replies; 10+ messages in thread
From: Gary Thomas @ 2000-01-06  6:45 UTC (permalink / raw)
  To: Nicholas_Clarey; +Cc: eCos Discussion

On 06-Jan-00 Nicholas_Clarey@ivesco.co.uk wrote:
> Hi Gary,
> 
> I've corrected the two warnings that were my fault - I figured that was 
> the problem any way - but the other messages stay.
> 
> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9-eco
> sSWtools-arm-990321/../../../../arm-elf/bin/ld: 
> address 0x40219c0 of a.out section .text is not within region rom
> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9-eco
> sSWtools-arm-990321/../../../../arm-elf/bin/ld: 
> address 0x4021c4c of a.out section .rodata is not within region rom
> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9-eco
> sSWtools-arm-990321/../../../../arm-elf/bin/ld: 
> warning: no memory region specified for section `.glue_7'
> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9-eco
> sSWtools-arm-990321/../../../../arm-elf/bin/ld: 
> warning: no memory region specified for section `.glue_7t'
> collect2: ld returned 1 exit status
> 
> As for the toolchain, I'm using exactly what I was told to use :->
> 
> 2.9-ecosSWtools-arm-990321
> GNU ld 2.9-ecosSWtools-arm-990321

Odd, I just tried your example and it built fine for me.  I am using a slightly
newer toolchain, though.  I'll have someone look into this.

Can you send me the "compile & link" commands that were used to build/link your
program?  What I did was to copy your test program into the "io/serial/XXX/tests/"
directory and adjust the makefile.  Here's the output from the build:

[gary@hermes aeb_test]$ make -C io/serial/current/tests/
make: Entering directory `/work/aeb_test/io/serial/current/tests'
arm-elf-gcc  -c  -I/work/aeb_test/install/include -I. -I/work2/ecc_mainline/ecc/io/serial/current/tests -mcpu=arm7di -Wall -Wpo
inter-arith
-Wstrict-prototypes -Winline -Wundef -ffunction-sections -fdata-sections -mno-sched-prolog -g -O2   -Wp,-MD,io_serial_aeb_test.
tmp -o
io_serial_aeb_test.o aeb_test.c 
arm-elf-gcc -o /work/aeb_test/install/tests/io_serial/aeb_test io_serial_aeb_test.o -mcpu=arm7di -Wall -Wpointer-arith -Wstrict
-prototypes -Winline
-Wundef -ffunction-sections -fdata-sections -mno-sched-prolog -Wl,--gc-sections -Wl,-static -g -O2 -L/work/aeb_test/install/lib
 -Ttarget.ld -nostdlib

Note: on my system, I work with the 'current' version.  The path will be slightly
different on yours.

Also, you'll want to open "/dev/ser0", not "/dev/serial0".  You also need to enable
it, either using the ConfigTool if you are using Windows, or by editting the file
"pkgconf/io_serial.h"

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

* RE: [ECOS] Building rommable images for the AEB-1C
@ 2000-01-06  5:40 Nicholas_Clarey
  0 siblings, 0 replies; 10+ messages in thread
From: Nicholas_Clarey @ 2000-01-06  5:40 UTC (permalink / raw)
  To: ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 8173 bytes --]

----- Forwarded by Nick Clarey/ivesco on 01/06/00 01:48 PM -----




Nick Clarey
01/06/00 01:33 PM


        To:        Gary Thomas <gthomas@cygnus.co.uk>
        cc:        
        Subject:        RE: [ECOS] Building rommable images for the AEB-1C Link

Hi Gary,

I've corrected the two warnings that were my fault - I figured that was the problem any way - but the other messages stay.

/usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9-ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: address 0x40219c0 of a.out section .text is not within region rom
/usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9-ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: address 0x4021c4c of a.out section .rodata is not within region rom
/usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9-ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory region specified for section `.glue_7'
/usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9-ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory region specified for section `.glue_7t'
collect2: ld returned 1 exit status

As for the toolchain, I'm using exactly what I was told to use :->

2.9-ecosSWtools-arm-990321
GNU ld 2.9-ecosSWtools-arm-990321
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
  Supported emulations:
   armelf
GNU assembler 2.9-ecosSWtools-arm-990321
Copyright 1997 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `arm-elf'.

Should I be using a more recent version?

And the code I'm trying to use - nobody laugh too much, this was just a 2 minute experiment;

#include <cyg/kernel/kapi.h>
#include <cyg/io/serialio.h>
#include <cyg/io/io.h>
#include <cyg/error/codes.h>
#include <stdio.h>

static cyg_serial_info_t serial_port_setup;
static cyg_io_handle_t serial_port_handle;

void cyg_user_start(void)
{

        cyg_uint32 i = 0;
        cyg_uint32 length;
        Cyg_ErrNo error;

        serial_port_setup.baud = CYGNUM_SERIAL_BAUD_38400;
        serial_port_setup.stop = CYGNUM_SERIAL_STOP_1;
        serial_port_setup.parity = CYGNUM_SERIAL_PARITY_NONE;
        serial_port_setup.word_length = CYGNUM_SERIAL_WORD_LENGTH_8;
        serial_port_setup.flags = 0;

        // Open the serial port
        error =        cyg_io_lookup("/dev/serial0", &serial_port_handle);

        length = sizeof(serial_port_setup);

        cyg_io_set_config(serial_port_handle, CYG_IO_SET_CONFIG_SERIAL_INFO, 
                        (void *) &serial_port_setup, &length);

        length = 9;

        for(i=0;i<100;i++)
        {
                // Dump some data down it
                cyg_io_write(serial_port_handle, "TESTTEST\n", &length);
        }

        // Close the serial port

}

One thing I'm pretty sure is wrong anyway is the "/dev/serial0" device opening - I think that should be "/dev/serial1" from what I've read of the AEB-1C docos, but I was going to play with that once I could get it in ROM.

I'll check out that file you mentioned for the GDB stubs; I'll try to get that going.

Thanks,

Nick







Gary Thomas <gthomas@cygnus.co.uk>
Sent by: ecos-discuss-owner@sourceware.cygnus.com
01/06/00 01:00 PM

        
        To:        Nicholas_Clarey@ivesco.co.uk
        cc:        ecos-discuss@sourceware.cygnus.com
        Subject:        RE: [ECOS] Building rommable images for the AEB-1C


On 06-Jan-00 Nicholas_Clarey@ivesco.co.uk wrote:
> Howdy all,
> 
> I've been trying to create an image that I can put into the Arm Evaluation 
> 
> Board flash rom so that I can take over the serial port and play with it. 
> Unfortunately, it's not working.
> 
> I have managed the first stage of producing the CVS gdb stubs and flashed 
> them successfully, and have written test programs, downloaded them and 
> played with them fine. I followed all the necessary instructions in the 
> documentation to do this.
> 
> Here's what I've done so far;
> 
> - produced the build directory with the following command;
> 
> tclsh BASE_DIR/packages/pkgconf.tcl --target=arm 
> --platform=aebC--startup=rom
> 
> which I figured would do what was necessary to give me libraries and stuff 
> 
> I could link with and place in ROM rather than RAM.
> 
> - edited the pkgconf/serial_io.h header file to enable the serial port(s) 
> by #defining the aeb serial port stuff
> - run "make"
> - wrote a simple c program that opened the serial port and dumped some 
> trivial data to it
> 
> When I try to compile the c program in the last step, I did the following;
> 
> arm-elf-gcc -Iinstall/include testfile.c -Linstall/lib -Ttarget.ld 
> -nostdlib
> 
> and I get two errors and two warnings;
> 
> testfile.c: In function `cyg_user_start':
> testfile.c:32: warning: passing arg 4 of `cyg_io_set_config' makes pointer 
> 
> from integer without a cast
> testfile.c:37: warning: passing arg 3 of `cyg_io_write' makes pointer from 
> 
> integer without a cast

I'd have to see your sources to know exactly why you get these warnings.
However, they are from the compiler, telling you that you are apparently not
passing the correct "type" of information to the cyg_io_XXX() functions.

The severity of such missuse can range from being totally benign to complete
failure.  In particular, the second warning says that you've passed an integer
and not a pointer as the third parameter to 'cyg_io_write()'.  This parameter
must be a pointer to the length, not the length itself.  This is because the
function returns the actual number of bytes written in the variable, in case
it differed for some reason from the requested number.

> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
> 
> -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: address 0x40219ac of 
> a.out section .text is not within region rom
> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
> 
> -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: address 0x4021c34 of 
> a.out section .rodata is not within region rom

If you look at the ROM layout, you'll see that it is only set up to handle
small programs in the flash/ROM.  The default setup is for 32K (0x8000) bytes
at the end of the flash.  The flash on that board is quite limited (128K) and
we didn't want to destroy what was already there (the boot loader, etc).

> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
> 
> -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory 
> region specified for section `.glue_7'
> /usr/cygnus/ecosSWtools-arm-990321/i686-pc-linux-gnu/lib/gcc-lib/arm-elf/2.9 
> 
> -ecosSWtools-arm-990321/../../../../arm-elf/bin/ld: warning: no memory 
> region specified for section `.glue_7t'

I don't understand these warnings at all [yes, I know what they mean, I just
don't know how you created them].  

What compiler/toolset are you using?
Did you use any special compiler options when building the program?

The other thing to note about running programs in flash/ROM on the AEB is that
eCos assumes that the ARM bootloader is in place, even for these.  This means
that you'll need to set up a flash image "module" which follows the ARM rules.
This is a rather tricky process and not terribly simple to automate.  You
can look at ".../hal/arm/aeb/XXX/misc/PKGconf.mak" to see how it is done for
the GDB stubs.




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

end of thread, other threads:[~2000-01-07  7:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-06  4:38 [ECOS] Building rommable images for the AEB-1C Nicholas_Clarey
2000-01-06  5:00 ` Gary Thomas
2000-01-06  6:50   ` Grant Edwards
2000-01-06  7:01     ` Gary Thomas
2000-01-06  7:03     ` Dan Hovang
2000-01-06  5:40 Nicholas_Clarey
     [not found] <OF3C6DA87D.CDC4B358-ON8025685E.004A10DF@ivesco.co.uk>
2000-01-06  6:45 ` Gary Thomas
     [not found] <OF7B928FC7.8F137C30-ON8025685E.005316F3@ivesco.co.uk>
2000-01-06  7:15 ` Gary Thomas
2000-01-07  6:46   ` Dan Hovang
2000-01-07  7:19     ` Gary Thomas

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).