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]

Re: [gdb] packet error problem : About code.


Hmm.. My RAM region is from 0x00000000 - to 0x01000000 (16MB)
and my FLASH region is from 0xFFE00000 - to 0xFFFFFFFF (2MB).
Actually I changed from MBX860 template. From that template, I changed 'memory map' and serial communication for my H/W. In orginal MBX spec. RAM region starts from 0x00000000 but in case of ROM, it starts from 0xFE000000.
Is there any collision with change that memory map? I changed code like this

(Memory Map of my H/W)
0x0000.0000 - 0x00FF.FFFF : 16MB SDRAM
0xFF00.0000 - 0xFF00.3FFF : MPC8xx On-chip Register
0xFFE0.0000 - 0xFFFF.FFFF : 2MB FLASH

Then, I modified all 6 mlt_* files like this    (I abbreviated mlt_*_*_ram section)

<mlt_powerpc_mytarget_rom.mlt>

version 0
region ram 0 1000000 0 !                            //Change
region rom ffe00000 200000 1 !                    //Change
section reserved_vectors 3000 1 0 0 1 1 1 1 0 0 reserved_vsr_table reserved_vsr_table !
section reserved_vsr_table 200 1 0 0 0 1 0 1 reserved_virtual_table reserved_virtual_table !
section reserved_virtual_table 100 1 0 0 0 1 0 0 data !
section data 0 10 1 1 0 1 0 0 sbss !
section sbss 0 4 0 1 0 1 0 1 bss bss !
section bss 0 10 0 1 0 1 0 1 heap1 heap1 !
section heap1 0 8 0 0 0 0 0 0 !
section vectors 0 1 0 1 1 1 1 1 ffe00000 ffe00000 text text !
section text 0 4 0 1 0 1 0 1 fini fini !
section fini 0 4 0 1 0 1 0 1 rodata1 rodata1 !
section rodata1 0 8 0 1 0 1 0 1 rodata rodata !
section rodata 0 8 0 1 0 1 0 1 fixup fixup !
section fixup 0 4 0 1 0 1 0 1 gcc_except_table gcc_except_table !
section gcc_except_table 0 1 0 1 0 0 0 1 data !                                    

<mlt_powerpc_mytarget_rom.h>

// eCos memory layout - Fri Oct 20 10:35:48 2000

// This is a generated file - do not edit

#ifndef __ASSEMBLER__
#include <cyg/infra/cyg_type.h>
#include <stddef.h>

#endif
#define CYGMEM_REGION_ram (0)
#define CYGMEM_REGION_ram_SIZE (0x1000000)            //Change
#define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
#define CYGMEM_REGION_rom (0xffe00000)                    //Change
#define CYGMEM_REGION_rom_SIZE (0x200000)                //Change
#define CYGMEM_REGION_rom_ATTR (CYGMEM_REGION_ATTR_R)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__reserved_vectors) [];
#endif
#define CYGMEM_SECTION_reserved_vectors (CYG_LABEL_NAME (__reserved_vectors))
#define CYGMEM_SECTION_reserved_vectors_SIZE (0x3000)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__reserved_vsr_table) [];
#endif
#define CYGMEM_SECTION_reserved_vsr_table (CYG_LABEL_NAME (__reserved_vsr_table))
#define CYGMEM_SECTION_reserved_vsr_table_SIZE (0x200)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__reserved_virtual_table) [];
#endif
#define CYGMEM_SECTION_reserved_virtual_table (CYG_LABEL_NAME (__reserved_virtual_table))
#define CYGMEM_SECTION_reserved_virtual_table_SIZE (0x100)
#ifndef __ASSEMBLER__
extern char CYG_LABEL_NAME (__heap1) [];
#endif
#define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
#define CYGMEM_SECTION_heap1_SIZE (0x1000000 - (size_t) CYG_LABEL_NAME (__heap1))    //Change

<mlt_powerpc_mytarget_rom.ldi>

// eCos memory layout - Fri Oct 20 10:35:48 2000

// This is a generated file - do not edit

#include <cyg/infra/cyg_type.inc>

MEMORY
{
    ram : ORIGIN = 0, LENGTH = 0x1000000                //Change            
    rom : ORIGIN = 0xffe00000, LENGTH = 0x200000    //Change
}

SECTIONS
{
    SECTIONS_BEGIN
    SECTION_vectors (rom, 0xffe00000, LMA_EQ_VMA)            //Change
    SECTION_text (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_fini (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_rodata1 (rom, ALIGN (0x8), LMA_EQ_VMA)
    SECTION_rodata (rom, ALIGN (0x8), LMA_EQ_VMA)
    SECTION_fixup (rom, ALIGN (0x4), LMA_EQ_VMA)
    SECTION_gcc_except_table (rom, ALIGN (0x1), LMA_EQ_VMA)
    CYG_LABEL_DEFN(__reserved_vectors) = 0; . = CYG_LABEL_DEFN(__reserved_vectors) + 0x3000;
    CYG_LABEL_DEFN(__reserved_vsr_table) = ALIGN (0x1); . = CYG_LABEL_DEFN(__reserved_vsr_table) + 0x200;
    CYG_LABEL_DEFN(__reserved_virtual_table) = ALIGN (0x1); . = 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
}

And I changed hal_aux.c. But I don't know about middle section of this code that I attached.


<hal_aux.c>
CYGARC_MEMDESC_TABLE CYGBLD_ATTRIB_WEAK = {
    // Mapping for the Motorola MYTARGET 860 development board
    ///Seunghun 2002.8.13
    ///CYGARC_MEMDESC_CACHE(   0xfe000000, 0x00400000 ), // ROM region
 CYGARC_MEMDESC_CACHE(   0xffe00000, 0x00200000 ), // ROM region
    ///
    
    ///Seunghun 2002.8.13
    ///Don't know how to modify 
    CYGARC_MEMDESC_NOCACHE( 0xff000000, 0x00100000 ), // MCP registers
    CYGARC_MEMDESC_NOCACHE( 0xfa100000, 0x00000004 ), // Control/Status+LEDs
    ///
    
    ///Seunghun 2002.8.13
    ///CYGARC_MEMDESC_CACHE(   0x00000000, 0x00800000 ), // Main memory
 CYGARC_MEMDESC_CACHE(   0x00000000, 0x01000000 ), // Main memory
 ///
    CYGARC_MEMDESC_TABLE_END
};

If you have any experience in changing the memory map like this, please help me. 

Anyway thank you for your reply. 

                                                                                                                        Seunghun



----- Original Message ----- 
From: "Gary Thomas" <gthomas@ecoscentric.com>
To: "Bob Koninckx" <bob.koninckx@mech.kuleuven.ac.be>
Cc: "Seung-hun, Lee (Stanly)" <seunghun@kaist.ac.kr>; "eCos discuss" <ecos-discuss@sources.redhat.com>
Sent: Wednesday, August 28, 2002 8:57 PM
Subject: Re: [ECOS] Fw: [ECOS] [gdb] packet error problem


> On Wed, 2002-08-28 at 05:51, Bob Koninckx wrote:
> > Somewhere in the download of your .text section, redboot stops
> > responding (packet errors !) or at least does not follow the gdb remote
> > protocol any more
> > 
> 
> It looks to me like [Stanly] is trying to download code into the
> FLASH/ROM area - I doubt that he has RAM at 0xFFE00200.
> 
> > 
> >  On Wed, 2002-08-28 at 12:38, Seung-hun, Lee (Stanly) wrote:
> > > I'm not sure because I changed memory map appropriate to my hardware.
> > > 
> > > How did you notice that my download kill redboot? Could you tell me?
> > > 
> > >                                                                                             Seunghun
> > > ----- Original Message ----- 
> > > From: "Bob Koninckx" <bob.koninckx@mech.kuleuven.ac.be>
> > > To: "Seung-hun, Lee (Stanly)" <seunghun@kaist.ac.kr>
> > > Cc: <ecos-discuss@sources.redhat.com>
> > > Sent: Wednesday, August 28, 2002 7:26 PM
> > > Subject: Re: [ECOS] [gdb] packet error problem
> > > 
> > > 
> > > > Are you sure you are not overwriting redboot code during the load. Looks
> > > > like your download kills redboot.
> > > > 
> > > > 
> > > > On Wed, 2002-08-28 at 12:21, Seung-hun, Lee (Stanly) wrote:
> > > > > Hi. When I download the sample program, I have problem like this.
> > > > > 
> > > > > (gdb) set remotebaud 57600
> > > > > (gdb) target remote com1
> > > > > Remote debugging using com1
> > > > > 0xffe064cc in pack_int (buf=0x1 "qC?\222C?³C?\200", value=1)
> > > > >     at /ecos-c/cygwin/home/Administrator/ecos/cvs20/ecos/packages/hal/common/cur
> > > > > rent/src/thread-packets.c:311
> > > > > 311     /ecos-c/cygwin/home/Administrator/ecos/cvs20/ecos/packages/hal/common/cu
> > > > > rrent/src/thread-packets.c: No such file or directory.
> > > > >         in /ecos-c/cygwin/home/Administrator/ecos/cvs20/ecos/packages/hal/common
> > > > > /current/src/thread-packets.c
> > > > > (gdb) load
> > > > > Loading section .vectors, size 0x2000 lma 0xffe00000
> > > > > Loading section .text, size 0xcc1c lma 0xffe02000
> > > > > Ignoring packet error, continuing...
> > > > > Ignoring packet error, continuing...
> > > > > Ignoring packet error, continuing...
> > > > > Ignoring packet error, continuing...
> > > > > Ignoring packet error, continuing...
> > > > > Ignoring packet error, continuing...
> > > > > Ignoring packet error, continuing...
> > > > > Ignoring packet error, continuing...
> > > > > 
> > > > > 
> > > > > Do any of you guys have same problem? Would you tell me how you solved this problem?
> > > > > 
> > > > > Thank you in advance.
> > > > > 
> > > > >                                                                                                                     Seunghun  
> > > > -- 
> > > > ----------------------------------------------------------------------
> > > > ir. Bob Koninckx
> > > > Katholieke Universiteit Leuven       
> > > > Division Production Engineering,                   tel.  +32 16 322535
> > > > Machine Design and Automation                      fax.  +32 16 322987
> > > > Celestijnenlaan 300B                  bob.koninckx@mech.kuleuven.ac.be
> > > > B-3001 Leuven Belgium               http://www.mech.kuleuven.ac.be/pma
> > > > ----------------------------------------------------------------------
> > > > 
> > > > -- 
> > > > Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> > > > and search the list archive: http://sources.redhat.com/ml/ecos-discuss
> > > > 
> > > > 
> > > > 
> > > > 
> > -- 
> > ----------------------------------------------------------------------
> > ir. Bob Koninckx
> > Katholieke Universiteit Leuven       
> > Division Production Engineering,                   tel.  +32 16 322535
> > Machine Design and Automation                      fax.  +32 16 322987
> > Celestijnenlaan 300B                  bob.koninckx@mech.kuleuven.ac.be
> > B-3001 Leuven Belgium               http://www.mech.kuleuven.ac.be/pma
> > ----------------------------------------------------------------------
> > 
> > -- 
> > Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
> > and search the list archive: http://sources.redhat.com/ml/ecos-discuss
> 
> -- 
> ------------------------------------------------------------
> Gary Thomas                  |
> eCosCentric, Ltd.            |  
> +1 (970) 229-1963            |  eCos & RedBoot experts
> gthomas@ecoscentric.com      |
> http://www.ecoscentric.com/  |
> ------------------------------------------------------------
> 
> 
> 

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