This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Data segment and ROM?
- From: Stanislav Meduna <stano at meduna dot org>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Thu, 31 Jul 2008 11:18:07 +0200
- Subject: [ECOS] Data segment and ROM?
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