This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

strange startup behavior


Hi, I am hoping someone can clue me into what going wrong here...
 
some background
ecos configuration
 
Common Error Support
Dynamic Memory allocation
eCos common HAL
eCos Kernel
I/O subsystem
Infrastructure
ISO C and POSIX Infrastructure
ISO C library general utilities
ISO C library internationalization
ISO C library standard i/o
ISO C library string functions
serial device package
 
Its a powerpc platform, using gcc 3.2.1, insight 5.3 
 
a small program snippet
 
static void can_prog(CYG_ADDRESS data)
{
 
  char *flx_t = "/dev/canA";
  char *flx_r = "/dev/canB";
  cyg_uint8     can_data[8];
  Cyg_ErrNo     err;
  cyg_io_handle_t    t, r;
  cyg_uint32     t_len =  sizeof(can_data);
  cyg_uint32     r_len =  sizeof(can_data);
  
  err = cyg_io_lookup(flx_t, &t);
  err = cyg_io_lookup(flx_r, &r);
  err = cyg_io_read(r, can_data, &r_len);
  err = cyg_io_write(t, can_data, &t_len);
}
 
void cyg_user_start(void)
{
    cyg_thread_create(4, can_prog, (cyg_addrword_t) 0, "can", (void *)stack[0], STACKSIZE, &thread[0], &thread_obj[0]);
    cyg_thread_resume(thread[0]);
}

if the call to cyg_io_write is not there this program runs fine
if it is there before it even executes cyg_user is crashes with a segmentation violation
 
Here is where it is
module                routine
 
hal_misc.c        cyg_hal_invoke_constructors
thread.cxx        _GOLBAL_D.15000_2N18cyg_hardwarethread12thread_entryEP10cyg_thread
thread.cxx        _static_initialization_and_destruction
thread.cxx        ~cyg_idlethread
thread.cxx        ~cyg_thread
thread.cxx        cyg_thread::remove_from_list
 
here it tries to access some address in boom boom land
 
 
any clues ???  Thanks in advance
 
roman
 
 
 
 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]