public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Running Redboot RAM mode on custom AT91x40 board
@ 2006-06-20 21:00 David Ho
  2006-06-20 21:09 ` Gary Thomas
  0 siblings, 1 reply; 8+ messages in thread
From: David Ho @ 2006-06-20 21:00 UTC (permalink / raw)
  To: ecos-discuss

Hello list,

I am attempting to boot Redboot on a custom at91R40008 board with
nothing inside flash memory.  I am using the BDI2000 to load the image
directly into RAM via gdb.  The output from at the serial port appear
to be a gdb-stub packet of some sort
(+$T0a0f:18f00710;0d:b0020310;#78), and when I stop the running image
it is stuck wait for  serial characters in generic-stub.c

(gdb) bt
#0  cyg_hal_plf_serial_getc (__ch_data=0x1002d088)
    at /home/davidho/ecos-dev/ecos-2.0/packages/hal/arm/at91/v2_0/src/hal_diag.c:140
#1  0x10024920 in getDebugChar () at hal_if.h:311
#2  0x1002356c in __putpacket (buffer=0x10031f00 "T0a0f:18f00710;0d:b0020310;")
    at /home/davidho/ecos-dev/ecos-2.0/packages/hal/common/v2_0/src/generic-stub.c:349
#3  0x100245f4 in process_exception (sigval=0)
    at /home/davidho/ecos-dev/ecos-2.0/packages/hal/common/v2_0/src/generic-stub.c:1605
#4  0x10023cb8 in __handle_exception ()
    at /home/davidho/ecos-dev/ecos-2.0/packages/hal/common/v2_0/src/generic-stub.c:988
#5  0x10023010 in exception_handler (regs=0x1002eaf0)
    at /home/davidho/ecos-dev/ecos-2.0/packages/hal/arm/arch/v2_0/src/hal_misc.c:139
#6  0x10020228 in call_exception_handler ()

Is it a good idea to remove gdb-stub from my redboot configuration?
I looked into it briefly, and strangely enough the redboot build
requires gdb-stubs.
Is there something critical that I missed?

Regards,
David H.

-- 
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] 8+ messages in thread

* Re: [ECOS] Running Redboot RAM mode on custom AT91x40 board
  2006-06-20 21:00 [ECOS] Running Redboot RAM mode on custom AT91x40 board David Ho
@ 2006-06-20 21:09 ` Gary Thomas
  2006-06-21 19:56   ` David Ho
  0 siblings, 1 reply; 8+ messages in thread
From: Gary Thomas @ 2006-06-20 21:09 UTC (permalink / raw)
  To: David Ho; +Cc: ecos-discuss

On Tue, 2006-06-20 at 17:00 -0400, David Ho wrote:
> Hello list,
> 
> I am attempting to boot Redboot on a custom at91R40008 board with
> nothing inside flash memory.  I am using the BDI2000 to load the image
> directly into RAM via gdb.  The output from at the serial port appear
> to be a gdb-stub packet of some sort
> (+$T0a0f:18f00710;0d:b0020310;#78), and when I stop the running image
> it is stuck wait for  serial characters in generic-stub.c
> 
> (gdb) bt
> #0  cyg_hal_plf_serial_getc (__ch_data=0x1002d088)
>     at /home/davidho/ecos-dev/ecos-2.0/packages/hal/arm/at91/v2_0/src/hal_diag.c:140
> #1  0x10024920 in getDebugChar () at hal_if.h:311
> #2  0x1002356c in __putpacket (buffer=0x10031f00 "T0a0f:18f00710;0d:b0020310;")
>     at /home/davidho/ecos-dev/ecos-2.0/packages/hal/common/v2_0/src/generic-stub.c:349
> #3  0x100245f4 in process_exception (sigval=0)
>     at /home/davidho/ecos-dev/ecos-2.0/packages/hal/common/v2_0/src/generic-stub.c:1605
> #4  0x10023cb8 in __handle_exception ()
>     at /home/davidho/ecos-dev/ecos-2.0/packages/hal/common/v2_0/src/generic-stub.c:988
> #5  0x10023010 in exception_handler (regs=0x1002eaf0)
>     at /home/davidho/ecos-dev/ecos-2.0/packages/hal/arm/arch/v2_0/src/hal_misc.c:139
> #6  0x10020228 in call_exception_handler ()
> 
> Is it a good idea to remove gdb-stub from my redboot configuration?
> I looked into it briefly, and strangely enough the redboot build
> requires gdb-stubs.
> Is there something critical that I missed?

Use GDB to debug this - that's why it's there :-)

Simply disconnect your terminal [emulator] and then connect to
the board using GDB.  It will then tell you why it stopped and
you should be able to poke around, get back-traces, etc.

-- 
------------------------------------------------------------
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] 8+ messages in thread

* Re: [ECOS] Running Redboot RAM mode on custom AT91x40 board
  2006-06-20 21:09 ` Gary Thomas
@ 2006-06-21 19:56   ` David Ho
  2006-06-21 20:05     ` Gary Thomas
  2006-06-21 20:06     ` David Ho
  0 siblings, 2 replies; 8+ messages in thread
From: David Ho @ 2006-06-21 19:56 UTC (permalink / raw)
  To: ecos-discuss, gary

Hi again,

> Simply disconnect your terminal [emulator] and then connect to
> the board using GDB.  It will then tell you why it stopped and
> you should be able to poke around, get back-traces, etc.

I am now connected to the board via serial GDB.  I am not sure what to
make of these msgs.  Any help is really appreciated.

David

(gdb) set remotebaud 38400
(gdb) set debug remote 1
(gdb) target remote /dev/com1
Remote debugging using /dev/com1
Sending packet: $Hc-1#09...Ack
Packet received:
Sending packet: $qC#b4...Ack
Packet received:
Sending packet: $qOffsets#4b...Ack
Packet received:
Sending packet: $?#3f...Ack
Packet received: S0a
Sending packet: $Hg0#df...Ack
Packet received:
Sending packet: $g#67...Ack
Packet received: b8020310555500009cf00710aaaaffff0000010100340310603303101cd0021
0100a0200a000800808102702d4020310aaaa0000b0020310b431021018f00710000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000d3000060
0x1007f018 in ?? ()
(gdb) bt
#0  0x1007f018 in ?? ()
Sending packet: $m100302d4,4#8b...Ack
Packet received: 8c310210
Sending packet: $m10023184,4#60...Ack
Packet received: 8c509fe5
Sending packet: $m10023188,4#64...Ack
Packet received: 04b04ce2
Sending packet: $m1002318c,4#8f...Ack
Packet received: 08d04de2
Sending packet: $m10023190,4#5d...Ack
Packet received: 84109fe5
Sending packet: $m10023194,4#61...Ack
Packet received: 004095e5
Sending packet: $m10023198,4#65...Ack
Packet received: 80209fe5
Sending packet: $m1002319c,4#90...Ack
Packet received: 0400a0e1
Sending packet: $m100231a0,4#85...Ack
Packet received: 022061e0
Sending packet: $m100231a4,4#89...Ack
Packet received: c90d00eb
Sending packet: $m100231a8,4#8d...Ack
Packet received: 1c004be2
Sending packet: $m100231ac,4#b8...Ack
Packet received: 0fe0a0e1
Sending packet: $m100231b0,4#86...Ack
Packet received: 04f0a0e1
Sending packet: $m100231b4,4#8a...Ack
Packet received: bc315be1
Sending packet: $m100231b8,4#8e...Ack
Packet received: 1f0053e3
Sending packet: $m100231bc,4#b9...Ack
Packet received: 60009fe5
Sending packet: $m100231c0,4#87...Ack
Packet received: 0310a0e1
(gdb)

-- 
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] 8+ messages in thread

* Re: [ECOS] Running Redboot RAM mode on custom AT91x40 board
  2006-06-21 19:56   ` David Ho
@ 2006-06-21 20:05     ` Gary Thomas
  2006-06-21 20:06     ` David Ho
  1 sibling, 0 replies; 8+ messages in thread
From: Gary Thomas @ 2006-06-21 20:05 UTC (permalink / raw)
  To: David Ho; +Cc: ecos-discuss

On Wed, 2006-06-21 at 15:56 -0400, David Ho wrote:
> Hi again,
> 
> > Simply disconnect your terminal [emulator] and then connect to
> > the board using GDB.  It will then tell you why it stopped and
> > you should be able to poke around, get back-traces, etc.
> 
> I am now connected to the board via serial GDB.  I am not sure what to
> make of these msgs.  Any help is really appreciated.
> 
> David
> 
> (gdb) set remotebaud 38400
> (gdb) set debug remote 1

Now that the connection is working, turn this off :-)

> (gdb) target remote /dev/com1
> Remote debugging using /dev/com1
> Sending packet: $Hc-1#09...Ack
> Packet received:
> Sending packet: $qC#b4...Ack
> Packet received:
> Sending packet: $qOffsets#4b...Ack
> Packet received:
> Sending packet: $?#3f...Ack
> Packet received: S0a
> Sending packet: $Hg0#df...Ack
> Packet received:
> Sending packet: $g#67...Ack
> Packet received: b8020310555500009cf00710aaaaffff0000010100340310603303101cd0021
> 0100a0200a000800808102702d4020310aaaa0000b0020310b431021018f00710000000000000000
> 00000000000000000000000000000000000000000000000000000000000000000000000000000000
> 00000000000000000000000000000000000000000000000000000000000000000000000000000000
> 0000000000000000000000000d3000060
> 0x1007f018 in ?? ()
> (gdb) bt
> #0  0x1007f018 in ?? ()
> Sending packet: $m100302d4,4#8b...Ack
> Packet received: 8c310210
> Sending packet: $m10023184,4#60...Ack
> Packet received: 8c509fe5
> Sending packet: $m10023188,4#64...Ack
> Packet received: 04b04ce2
> Sending packet: $m1002318c,4#8f...Ack
> Packet received: 08d04de2
> Sending packet: $m10023190,4#5d...Ack
> Packet received: 84109fe5
> Sending packet: $m10023194,4#61...Ack
> Packet received: 004095e5
> Sending packet: $m10023198,4#65...Ack
> Packet received: 80209fe5
> Sending packet: $m1002319c,4#90...Ack
> Packet received: 0400a0e1
> Sending packet: $m100231a0,4#85...Ack
> Packet received: 022061e0
> Sending packet: $m100231a4,4#89...Ack
> Packet received: c90d00eb
> Sending packet: $m100231a8,4#8d...Ack
> Packet received: 1c004be2
> Sending packet: $m100231ac,4#b8...Ack
> Packet received: 0fe0a0e1
> Sending packet: $m100231b0,4#86...Ack
> Packet received: 04f0a0e1
> Sending packet: $m100231b4,4#8a...Ack
> Packet received: bc315be1
> Sending packet: $m100231b8,4#8e...Ack
> Packet received: 1f0053e3
> Sending packet: $m100231bc,4#b9...Ack
> Packet received: 60009fe5
> Sending packet: $m100231c0,4#87...Ack
> Packet received: 0310a0e1
> (gdb)

It's a good idea to tell GDB what program you are trying
to debug.  This lets it decode the addresses and also get
into the correct endianness (this is a little endian
program, but GDB is interpreting it as big endian).
Start GDB like this:
  % arm-elf-gdb redboot.elf
  (gdb) tar rem /dev/com1

Then you should be able to see more interesting stuff:
  (gdb) info reg
  (gdb) bt
etc.

-- 
------------------------------------------------------------
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] 8+ messages in thread

* Re: [ECOS] Running Redboot RAM mode on custom AT91x40 board
  2006-06-21 19:56   ` David Ho
  2006-06-21 20:05     ` Gary Thomas
@ 2006-06-21 20:06     ` David Ho
  2006-06-21 20:10       ` Gary Thomas
  1 sibling, 1 reply; 8+ messages in thread
From: David Ho @ 2006-06-21 20:06 UTC (permalink / raw)
  To: ecos-discuss, gary

Here is my build script and the changes I made to the at91 tree.

[davidho@penguin ecos-dev]$ cat build.sh
export ECOS_REPOSITORY=~/ecos-dev/ecos-2.0/packages
export ARCH_DIR=arm
#export TARGET=eb40a
#export PLATFORM_DIR=at91/eb40a
export TARGET=at91
export PLATFORM_DIR=at91
#export REDBOOT_CFG=redboot_ROM
export REDBOOT_CFG=redboot_RAM
#export REDBOOT_CFG=redboot_ROMRAM
export VERSION=v2_0

. ~/ecos-dev/ecosenv.sh
rm -rf ~/ecos-dev/${REDBOOT_CFG}
mkdir ~/ecos-dev/${REDBOOT_CFG}
cd ~/ecos-dev/${REDBOOT_CFG}
ecosconfig new ${TARGET} redboot
ecosconfig import
${ECOS_REPOSITORY}/hal/${ARCH_DIR}/${PLATFORM_DIR}/${VERSION}/misc/${REDBOOT_CFG}.ecm
ecosconfig tree
make

diff --git a/packages/hal/arm/at91/v2_0/cdl/hal_arm_at91.cdl
b/packages/hal/arm/at91/v2_0/cdl/hal_arm_at91.cdl
index 3d67540..c082c00 100644
--- a/packages/hal/arm/at91/v2_0/cdl/hal_arm_at91.cdl
+++ b/packages/hal/arm/at91/v2_0/cdl/hal_arm_at91.cdl
@@ -134,7 +134,7 @@ cdl_package CYGPKG_HAL_ARM_AT91 {
     cdl_option CYGNUM_HAL_ARM_AT91_CLOCK_SPEED {
         display       "CPU clock speed"
         flavor        data
-        calculated    32768000
+        calculated    25000000
     }

     cdl_component CYGNUM_HAL_RTC_CONSTANTS {
diff --git a/packages/hal/arm/at91/v2_0/include/pkgconf/mlt_arm_at91_eb40_ram.h
b/packages/hal/arm/at91/v2_0/include/pkgconf/mlt_arm_at91_eb40_ram.h
index c641278..47ec526 100644
--- a/packages/hal/arm/at91/v2_0/include/pkgconf/mlt_arm_at91_eb40_ram.h
+++ b/packages/hal/arm/at91/v2_0/include/pkgconf/mlt_arm_at91_eb40_ram.h
@@ -8,13 +8,13 @@ #include <stddef.h>

 #endif
 #define CYGMEM_REGION_sram (0)
-#define CYGMEM_REGION_sram_SIZE (0x1000)
+#define CYGMEM_REGION_sram_SIZE (0x40000)
 #define CYGMEM_REGION_sram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
-#define CYGMEM_REGION_ram (0x2000000)
-#define CYGMEM_REGION_ram_SIZE (0x80000)
+#define CYGMEM_REGION_ram (0x10000000)
+#define CYGMEM_REGION_ram_SIZE (0x100000)
 #define CYGMEM_REGION_ram_ATTR (CYGMEM_REGION_ATTR_R | CYGMEM_REGION_ATTR_W)
 #ifndef __ASSEMBLER__
 extern char CYG_LABEL_NAME (__heap1) [];
 #endif
 #define CYGMEM_SECTION_heap1 (CYG_LABEL_NAME (__heap1))
-#define CYGMEM_SECTION_heap1_SIZE (0x2080000 - (size_t)
CYG_LABEL_NAME (__heap1))
+#define CYGMEM_SECTION_heap1_SIZE (0x10080000 - (size_t)
CYG_LABEL_NAME (__heap1))
diff --git a/packages/hal/arm/at91/v2_0/include/pkgconf/mlt_arm_at91_eb40_ram.ldi
b/packages/hal/arm/at91/v2_0/include/pkgconf/mlt_arm_at91_eb40_ram.ldi
index 287aba3..4d0399f 100644
--- a/packages/hal/arm/at91/v2_0/include/pkgconf/mlt_arm_at91_eb40_ram.ldi
+++ b/packages/hal/arm/at91/v2_0/include/pkgconf/mlt_arm_at91_eb40_ram.ldi
@@ -6,15 +6,15 @@ #include <cyg/infra/cyg_type.inc>

 MEMORY
 {
-    sram : ORIGIN = 0, LENGTH = 0x1000
-    ram : ORIGIN = 0x2000000, LENGTH = 0x80000
+    sram : ORIGIN = 0, LENGTH = 0x40000
+    ram : ORIGIN = 0x10000000, LENGTH = 0x100000
 }

 SECTIONS
 {
     SECTIONS_BEGIN
     SECTION_fixed_vectors (sram, 0x20, LMA_EQ_VMA)
-    SECTION_rom_vectors (ram, 0x2020000, LMA_EQ_VMA)
+    SECTION_rom_vectors (ram, 0x10020000, LMA_EQ_VMA)
     SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)
     SECTION_fini (ram, ALIGN (0x4), LMA_EQ_VMA)
     SECTION_rodata (ram, ALIGN (0x4), LMA_EQ_VMA)

-- 
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] 8+ messages in thread

* Re: [ECOS] Running Redboot RAM mode on custom AT91x40 board
  2006-06-21 20:06     ` David Ho
@ 2006-06-21 20:10       ` Gary Thomas
  2006-06-21 20:49         ` David Ho
  0 siblings, 1 reply; 8+ messages in thread
From: Gary Thomas @ 2006-06-21 20:10 UTC (permalink / raw)
  To: David Ho; +Cc: ecos-discuss

On Wed, 2006-06-21 at 16:06 -0400, David Ho wrote:
> Here is my build script and the changes I made to the at91 tree.
> 
> [davidho@penguin ecos-dev]$ cat build.sh
> export ECOS_REPOSITORY=~/ecos-dev/ecos-2.0/packages

Just FYI - you should probably consider using something newer (like
anon CVS).  eCos 2.0 is now more than 4 years old :-(

-- 
------------------------------------------------------------
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] 8+ messages in thread

* Re: [ECOS] Running Redboot RAM mode on custom AT91x40 board
  2006-06-21 20:10       ` Gary Thomas
@ 2006-06-21 20:49         ` David Ho
  2006-06-22 15:33           ` David Ho
  0 siblings, 1 reply; 8+ messages in thread
From: David Ho @ 2006-06-21 20:49 UTC (permalink / raw)
  To: Gary Thomas; +Cc: ecos-discuss

> > [davidho@penguin ecos-dev]$ cat build.sh
> > export ECOS_REPOSITORY=~/ecos-dev/ecos-2.0/packages
>
> Just FYI - you should probably consider using something newer (like
> anon CVS).  eCos 2.0 is now more than 4 years old :-(

Thanks, very good tip.  I wonder what happened to the eb40a board when
I dug around the ecos-2.0 tree.

David

-- 
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] 8+ messages in thread

* Re: [ECOS] Running Redboot RAM mode on custom AT91x40 board
  2006-06-21 20:49         ` David Ho
@ 2006-06-22 15:33           ` David Ho
  0 siblings, 0 replies; 8+ messages in thread
From: David Ho @ 2006-06-22 15:33 UTC (permalink / raw)
  To: Gary Thomas; +Cc: ecos-discuss

> > Just FYI - you should probably consider using something newer (like
> > anon CVS).  eCos 2.0 is now more than 4 years old :-(

Using an ancient tree was the reason of my grief.
Anon. CVS is working quite well for me.

Thanks a lot!
David

(gdb) set remotebaud 38400
(gdb) target remote /dev/com1
Remote debugging using /dev/com1
flash_query (data=0x1d7e8) at flash_at49xxxx.inl:235
235         ROM[FLASH_Setup_Addr2] = FLASH_Setup_Code2;
(gdb) bt
#0  flash_query (data=0x1d7e8) at flash_at49xxxx.inl:235
#1  0x00015b08 in flash_dev_query (data=0x1d7e8)
    at /home/davidho/ecos-dev/ecos/packages/io/flash/current/src/flash.c:122
#2  0x0000f508 in flash_hwr_init () at flash_at49xxxx.inl:156
#3  0x00015ab4 in flash_init (pf=0x1d7e8 <__startup_stack_base+6024>)
    at /home/davidho/ecos-dev/ecos/packages/io/flash/current/src/flash.c:93
#4  0x0000f1c4 in do_flash_init ()
    at /home/davidho/ecos-dev/ecos/packages/redboot/current/src/flash.c:1581
#5  0x00012f40 in cyg_start ()
    at /home/davidho/ecos-dev/ecos/packages/redboot/current/src/main.c:318
#6  0x0000c118 in start ()
#7  0x0000c118 in start ()
(gdb)

-- 
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] 8+ messages in thread

end of thread, other threads:[~2006-06-22 15:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-20 21:00 [ECOS] Running Redboot RAM mode on custom AT91x40 board David Ho
2006-06-20 21:09 ` Gary Thomas
2006-06-21 19:56   ` David Ho
2006-06-21 20:05     ` Gary Thomas
2006-06-21 20:06     ` David Ho
2006-06-21 20:10       ` Gary Thomas
2006-06-21 20:49         ` David Ho
2006-06-22 15:33           ` David Ho

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).