public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] problem with data-section
@ 2007-11-15 12:23 Per-Erik Johansson
  2007-11-15 12:24 ` Per-Erik Johansson
  2007-11-15 13:13 ` Gary Thomas
  0 siblings, 2 replies; 3+ messages in thread
From: Per-Erik Johansson @ 2007-11-15 12:23 UTC (permalink / raw)
  To: ecos-discuss

Hi

Im trying to get redboot working on a MPC5554 board, Im having some
trouble with the "copy data from rom to ram" in vectors.S
In all the .ldi files I have looked at the data-section is put in ram(?)
but still FOLLOWING the .gcc_except_table that is put in rom

>SECTION_data           (ram, ALIGN (0x10), FOLLOWING (.gcc_except_table))

I guess this is some nice feature that would enable the data section to be
put in ROM but still be maped as it should be in ram.
But right now my "__rom_data_start" is at the end of the things that that
gets flashed to rom, with only 0xFF's after.

So when vectors.s starts to copy what is supposed to be data it just fills
the ram with F's.

If I look at the map from the linker I get that the data-section is in
ram, and the "__rom_data_start" is in the .fixup-section

Any ideas what could be wrong?
(I post my ldi file at the bottom, hope thats ok.)

Best regards
  Per-Erik


>my ldi-file

#include <cyg/infra/cyg_type.inc>

MEMORY
{
  rom			: ORIGIN = 0x00000000, LENGTH = 0x00100000   /* internal FLASH	1
Meg Max	*/
  ram(WA)		: ORIGIN = 0x3fff0000, LENGTH = 0x00010000   /* internal
RAM	64k			*/
  dram(WA)		: ORIGIN = 0x40000000, LENGTH = 0x00400000   /* development
RAM 4 meg		*/

}

SECTIONS
{
    SECTIONS_BEGIN

    . = 0x00000000;
    CYG_LABEL_DEFN(__reserved_vectors) = 0x00000000;
    SECTION_vectors          (rom, 0x00000000,   LMA_EQ_VMA)
    SECTION_text             (rom, ALIGN (0x4),  LMA_EQ_VMA)
    SECTION_fini             (rom, ALIGN (0x8),  LMA_EQ_VMA)
    SECTION_rodata1          (rom, ALIGN (0x8),  LMA_EQ_VMA)
    SECTION_rodata           (rom, ALIGN (0x4),  LMA_EQ_VMA)
    SECTION_fixup            (rom, ALIGN (0x4),  LMA_EQ_VMA)
    SECTION_gcc_except_table (rom, ALIGN (0x1),  LMA_EQ_VMA)

    . = 0x3fff0000;
    CYG_LABEL_DEFN(__reserved_vsr_table) = ALIGN (0x10);
	. = CYG_LABEL_DEFN(__reserved_vsr_table) + 0x200;
    CYG_LABEL_DEFN(__reserved_virtual_table) = ALIGN (0x10);
	. = CYG_LABEL_DEFN(__reserved_virtual_table) + 0x100;

    SECTION_data             (ram, ALIGN (0x10), FOLLOWING
(.gcc_except_table))
    SECTION_sbss             (ram, ALIGN (0x4),  LMA_EQ_VMA)
    SECTION_bss              (ram, ALIGN (0x10), LMA_EQ_VMA)

	CYG_LABEL_DEFN(__heap1) = ALIGN(0x8);
    SECTIONS_END

}



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

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

* Re: [ECOS] problem with data-section
  2007-11-15 12:23 [ECOS] problem with data-section Per-Erik Johansson
@ 2007-11-15 12:24 ` Per-Erik Johansson
  2007-11-15 13:13 ` Gary Thomas
  1 sibling, 0 replies; 3+ messages in thread
From: Per-Erik Johansson @ 2007-11-15 12:24 UTC (permalink / raw)
  To: ecos-discuss

Hi

Problem solved, found that I was indeed building correct redboot.elf files
but my flash program (WinIDEA) ignored the LMA addresses and just took the
VMA addresses instead, just to change an option to Physical adresses
instead of default did the trick.

Best Regards
 Per-Erik


> Hi
>
> Im trying to get redboot working on a MPC5554 board, Im having some
> trouble with the "copy data from rom to ram" in vectors.S
> In all the .ldi files I have looked at the data-section is put in ram(?)
> but still FOLLOWING the .gcc_except_table that is put in rom
>
>>SECTION_data           (ram, ALIGN (0x10), FOLLOWING (.gcc_except_table))
>
> I guess this is some nice feature that would enable the data section to be
> put in ROM but still be maped as it should be in ram.
> But right now my "__rom_data_start" is at the end of the things that that
> gets flashed to rom, with only 0xFF's after.
>
> So when vectors.s starts to copy what is supposed to be data it just fills
> the ram with F's.
>
> If I look at the map from the linker I get that the data-section is in
> ram, and the "__rom_data_start" is in the .fixup-section
>
> Any ideas what could be wrong?
> (I post my ldi file at the bottom, hope thats ok.)
>
> Best regards
>   Per-Erik


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

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

* Re: [ECOS] problem with data-section
  2007-11-15 12:23 [ECOS] problem with data-section Per-Erik Johansson
  2007-11-15 12:24 ` Per-Erik Johansson
@ 2007-11-15 13:13 ` Gary Thomas
  1 sibling, 0 replies; 3+ messages in thread
From: Gary Thomas @ 2007-11-15 13:13 UTC (permalink / raw)
  To: Per-Erik Johansson; +Cc: ecos-discuss

Per-Erik Johansson wrote:
> Hi
> 
> Im trying to get redboot working on a MPC5554 board, Im having some
> trouble with the "copy data from rom to ram" in vectors.S
> In all the .ldi files I have looked at the data-section is put in ram(?)
> but still FOLLOWING the .gcc_except_table that is put in rom
> 
>> SECTION_data           (ram, ALIGN (0x10), FOLLOWING (.gcc_except_table))
> 
> I guess this is some nice feature that would enable the data section to be
> put in ROM but still be maped as it should be in ram.
> But right now my "__rom_data_start" is at the end of the things that that
> gets flashed to rom, with only 0xFF's after.
> 
> So when vectors.s starts to copy what is supposed to be data it just fills
> the ram with F's.
> 
> If I look at the map from the linker I get that the data-section is in
> ram, and the "__rom_data_start" is in the .fixup-section
> 
> Any ideas what could be wrong?
> (I post my ldi file at the bottom, hope thats ok.)

This file looks pretty much like what we use on all other PowerPC
platforms, so it's probably right.

How do you get the data into the ROM/FLASH?  Perhaps that tool
doesn't handle the ELF sections properly.  I *have* seen this
and switching to programming the FLASH from an S-record dump
of the image seems to help (since this takes away all interpretation
of the ELF file and only presents bytes...)

Try it - if it doesn't help, send the output of 'powerpc-eabi-objdump -h <file>'
Maybe we can see if the linker did something strange.


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

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

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

end of thread, other threads:[~2007-11-15 12:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-15 12:23 [ECOS] problem with data-section Per-Erik Johansson
2007-11-15 12:24 ` Per-Erik Johansson
2007-11-15 13:13 ` 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).