[ECOS] Data segment and ROM?

Stanislav Meduna stano@meduna.org
Thu Jul 31 09:18:00 GMT 2008


Hi,

I am trying to get some initial understanding of eCos and
RedBoot (I'll need to do a port for a Net+ARM-based
hardware) and I am playing with RedBoot in a SkyEye
ARM simulator configured as an AT91 machine with
serial, network and flash.

The RAM version is already running quite well, but when
trying to boot the ROM version I immediately got some
problems and traced them back to the following line in
packages/hal/arm/at91/var/current/src/hal_diag.c:

static channel_data_t at91_ser_channels[CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS] = {
{
  #if CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS > 0
      { (cyg_uint8*)AT91_USART0, 1000, CYGNUM_HAL_INTERRUPT_USART0,


Well, if I understand this correctly such data end in the
data segment full of zeros and won't ever see the
initialization data. If I change this to static const ...
it works; however, is this the intended behaviour?
How to get initialized non-const static data? Is there
some trick with linker-script or something like that?


After I changed this the RedBoot started correctly,
but periodically reports accessing the flash for write -
I suspect this is an opposite problem somewhere. I did
not trace this yet, as it requires patching the SkyEye
to report the exact location, so I can locate it
in the code.


The eCos is CVS with a few changes for SkyEye (I'll post
them when they are ready), gcc is 3.4.4 from eCosCentric.

Thanks
-- 
                                Stano

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



More information about the Ecos-discuss mailing list