public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Restoring boot/ecos on a AEB-1 using JTAG/Wiggler?
@ 2003-08-27 14:47 Carlos Sobrinho
  2003-08-28  7:32 ` Eric de Jong
  2003-09-02  3:10 ` Jonathan Larmour
  0 siblings, 2 replies; 5+ messages in thread
From: Carlos Sobrinho @ 2003-08-27 14:47 UTC (permalink / raw)
  To: ecos-discuss

Hi, some time ago while deleting some images from my flash something bad
happened and I lost some kb's of the beginning of the flash and the boot but
now I manage to get pppcb_arm_rgdb trough WIGGLER JTAG cable to read and
write the board RAM and peripherals RAM but I still have some doubts on the
way to restore the board.

Since the boot is damaged the remap of ram/flash, initialization of the
peripherals and all other stuff needed in boot doesn't occur so I was
wondering if someone could point me out.

I tried building a gdb stubs to load in RAM but when I uploaded to the board
using gdb remote and a wiggler jtag cable it downloads but nothing happens.
I already thought in making a application, download it to external RAM and
execute it but I am missing the ram/flash remap, the how-to and any init of
the board.

I did ... for the stubs
$ecosconfig new aeb stubs
	U CYGSEM_HAL_USE_ROM_MONITOR, new inferred value 0
$vi ecos.ecc
	changed CYGHWR_HAL_ARM_AEB_REVISION to
	:user_value C
	changed CYG_HAL_STARTUP to
	:user_value RAM
$ecosconfig check
	Target: aeb
	Template: stubs
	No conflicts
$ecosconfig tree
$make
	(snip...)
	build finished
and I can find the gdb_module.img in the install/bin directory
after I upload it to the board using gdb and execute it nothing happens so I
guess this is not enough.

Could anyone point me out in a correct way of restoring my aeb-1 boot?
With best regards
Carlos Sobrinho


PS:This is a hoobie/robot contest project so I can't afford $500/$+1000 in
buying a jeeni or a multice from ARM so free/gnu tools would be more than
welcome. I'm using the Wiggler cable from
http://jtag-arm9.sourceforge.net/circuit.txt and I can use the pppc_arm_rgdb
(remote gdb) from http://www.s.netic.de/tmohr/parportpcb.html

--
##############################################
# "Every man has his price. Mine is $3.95."  #
##############################################

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

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

* Re: [ECOS] Restoring boot/ecos on a AEB-1 using JTAG/Wiggler?
  2003-08-27 14:47 [ECOS] Restoring boot/ecos on a AEB-1 using JTAG/Wiggler? Carlos Sobrinho
@ 2003-08-28  7:32 ` Eric de Jong
  2003-08-28 14:20   ` Carlos Sobrinho
  2003-09-02  3:10 ` Jonathan Larmour
  1 sibling, 1 reply; 5+ messages in thread
From: Eric de Jong @ 2003-08-28  7:32 UTC (permalink / raw)
  To: ecos-discuss

>>now I manage to get pppcb_arm_rgdb trough WIGGLER JTAG cable to read and
>>write the board RAM and peripherals RAM but I still have some doubts on the
>>way to restore the board.

I used the free software from macgraigor. With it, I could not modify the 32 bit
registers in the atmel ARM processor. The software writes 4 bytes in stead of 1
longword, and this is not possible:every byte was repeated 4 times in the
register. 0x10000005 became 0x05050505 (or was it 0x10101010?).

Below is a small piece of software I used to experiment with the remap command.
Modify it to use the right memory locations. Then load it in the internal memory
and run it.
Then load and run your own software from ram. Try a simple led flashing
application without ecos first to see if it works.

Eric.

(note: you can find ebi_inc.h in the atmel AT91 library from www.atmel.com)

---------------------------
remap.S  <-- use uppercase S in your make file/command line, lowercase s means
no preprocessing in gcc

/*
 remap.S
   ---------
   Issues a remap command, then stalls

   compile with:
    arm-elf-gcc -g -nostartfiles -DAT91R40008 -Wl,-Ttext=0 remap.S
*/

       #include "ebi_inc.h"

#define EPROM_BASE      (0x01000000)
#define EPROM_SIZE      (128*1024)                /* byte */

#define ERAM_BASE0     (0x02000000)
#define ERAM_BASE      (0x02040000)
#define ERAM_SIZE      (256*1024)                /* byte */

#define EBI_CSR_0       (EPROM_BASE | EBI_DBW_8    | EBI_NWS_8 | EBI_WSE |
\
                                      EBI_PAGES_1M | EBI_TDF_3 |       \
                                      EBI_BAT_BYTE_WRITE | EBI_CSEN )

#define EBI_CSR_1       (ERAM_BASE0 | EBI_DBW_16    | EBI_NWS_8 | EBI_WSE |
\
                                      EBI_PAGES_1M | EBI_TDF_3 |       \
                                      EBI_BAT_BYTE_WRITE | EBI_CSEN )

#define EBI_CSR_2       (0x20000000)               /* unused */
#define EBI_CSR_3       (0x30000000)               /* unused */
#define EBI_CSR_4       (0x40000000)               /* unused */
#define EBI_CSR_5       (0x50000000)               /* unused */
#define EBI_CSR_6       (0x60000000)               /* unused */
#define EBI_CSR_7       (0x70000000)               /* unused */


               .text
               .code 32
               .align  0

               .global _start
_start:                                 /* The "start" label indicates the
default entry point for the gnu linker */
     /* Copy the Image of the Memory Controller */
               sub       r10, pc,#(8+.-InitTableEBI)  /* get the address of the
chip select register image */
               ldr         r12, PtInitRemap          /* get the real jump
address ( after remap ) */

     /* Copy Chip Select Register Image to Memory Controller and command remap
*/
               ldmia     r10!, {r0-r9,r11}         /* load the complete image
and the EBI base */
               stmia       r11!, {r0-r9}                 /* store the complete
image with the remap command */

     /* Jump to ROM at its new address */
               mov       pc, r12                       /* jump and break the
pipeline */
InitRemap:  b    InitRemap

PtInitRemap:   .long     (InitRemap+0x1000000)         /* address where to jump
after REMAP */

InitTableEBI:  .long       EBI_CSR_0
               .long       EBI_CSR_1
               .long       EBI_CSR_2
               .long       EBI_CSR_3
               .long       EBI_CSR_4
               .long       EBI_CSR_5
               .long       EBI_CSR_6
               .long       EBI_CSR_7
               .long       0x00000001  /* REMAP command */
               .long       0x00000006  /* 6 memory regions, standard read */
PtEBIBase:  .long   EBI_BASE    /* EBI Base Address */
-----------------------



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

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

* Re: [ECOS] Restoring boot/ecos on a AEB-1 using JTAG/Wiggler?
  2003-08-28  7:32 ` Eric de Jong
@ 2003-08-28 14:20   ` Carlos Sobrinho
  0 siblings, 0 replies; 5+ messages in thread
From: Carlos Sobrinho @ 2003-08-28 14:20 UTC (permalink / raw)
  To: Eric de Jong; +Cc: ecos-discuss

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday, 28 August 2003 08:33, you wrote: 
> I used the free software from macgraigor. With it, I could not modify the 32 
> bit registers in the atmel ARM processor. The software writes 4 bytes
> instead of 1 longword, and this is not possible:every byte was repeated 4 
> times in the register. 0x10000005 became 0x05050505 (or was it 0x10101010?). 
I'll try this later on next week because I found out that my homemade wiggler 
cable is not very stable and I'm on exams right now. 

I think I must have ground between the signals to remove some of the noise. 
Besides all, I manage to write a char and a int to the peripherals memory 
using the remote gdb from pppc_arm_* so maybe I'll try to write the words 
using a simple script run through (arm-elf-gdb -x file) with some (x), (p) 
and some printfs and then try to load a application in SRAM, run it to blink 
my leds and then program my flash with a 16K bin for the boot. Since I have 
256 KB of ram this shouldn't be a problem. All I need is time and that's 
something I don't have until 12/SET.

> Modify it to use the right memory locations. Then load it in the internal 
> memory and run it. Then load and run your own software from ram. Try a 
> simple led flashing application without ecos first to see if it works.  
> Eric.  

As soon as I build a new wiggler I'll keep you (Eric and the list) posted with 
news and questions.

With Best Regards
Carlos Sobrinho

- -- 
####################################################################
# Marriage is the only adventure open to the cowardly. -- Voltaire # 
####################################################################

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/Tg+dWYLAPRZ8QmoRAhMkAJ93tFwp5UYx4nghaOPtRUpopX/NGwCbBPoo
30oBpYLIFofNl4nqeTYnumQ=
=/mV8
-----END PGP SIGNATURE-----

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

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

* Re: [ECOS] Restoring boot/ecos on a AEB-1 using JTAG/Wiggler?
  2003-08-27 14:47 [ECOS] Restoring boot/ecos on a AEB-1 using JTAG/Wiggler? Carlos Sobrinho
  2003-08-28  7:32 ` Eric de Jong
@ 2003-09-02  3:10 ` Jonathan Larmour
  1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Larmour @ 2003-09-02  3:10 UTC (permalink / raw)
  To: duckman; +Cc: ecos-discuss

Carlos Sobrinho wrote:
> I tried building a gdb stubs to load in RAM but when I uploaded to the board
> using gdb remote and a wiggler jtag cable it downloads but nothing happens.
> I already thought in making a application, download it to external RAM and
> execute it but I am missing the ram/flash remap, the how-to and any init of
> the board.

See hal/arm/aeb/current/include/hal_platform_setup.h

> I did ... for the stubs
> $ecosconfig new aeb stubs
> 	U CYGSEM_HAL_USE_ROM_MONITOR, new inferred value 0
> $vi ecos.ecc
> 	changed CYGHWR_HAL_ARM_AEB_REVISION to
> 	:user_value C
> 	changed CYG_HAL_STARTUP to
> 	:user_value RAM
> $ecosconfig check
> 	Target: aeb
> 	Template: stubs
> 	No conflicts
> $ecosconfig tree
> $make
> 	(snip...)
> 	build finished
> and I can find the gdb_module.img in the install/bin directory
> after I upload it to the board using gdb and execute it nothing happens so I
> guess this is not enough.

The "stubs" configuration is built to run from specific addresses in RAM. 
You should make sure it is loaded to the right addresses.

If you have a BDM, you should easily be able to single step by instruction 
(stepi in GDB) to see where you get to.

Jifl
-- 
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--["No sense being pessimistic, it wouldn't work anyway"]-- Opinions==mine


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

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

* [ECOS] Restoring boot/ecos on a AEB-1 using JTAG/Wiggler?
@ 2003-08-27 14:46 Carlos Sobrinho
  0 siblings, 0 replies; 5+ messages in thread
From: Carlos Sobrinho @ 2003-08-27 14:46 UTC (permalink / raw)
  To: ecos-discuss

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, some time ago while deleting some images from my flash something bad 
happened and I lost some kb's of the beginning of the flash and the boot but 
now I manage to get pppcb_arm_rgdb trough WIGGLER JTAG cable to read and 
write the board RAM and peripherals RAM but I still have some doubts on the 
way to restore the board.

Since the boot is damaged the remap of ram/flash, initialization of the 
peripherals and all other stuff needed in boot doesn't occur so I was 
wondering if someone could point me out.

I tried building a gdb stubs to load in RAM but when I uploaded to the board 
using gdb remote and a wiggler jtag cable it downloads but nothing happens.
I already thought in making a application, download it to external RAM and 
execute it but I am missing the ram/flash remap, the how-to and any init of 
the board.

I did ... for the stubs
$ecosconfig new aeb stubs
	U CYGSEM_HAL_USE_ROM_MONITOR, new inferred value 0
$vi ecos.ecc
	changed CYGHWR_HAL_ARM_AEB_REVISION to
	:user_value C
	changed CYG_HAL_STARTUP to
	:user_value RAM
$ecosconfig check
	Target: aeb
	Template: stubs
	No conflicts
$ecosconfig tree
$make
	(snip...)
	build finished
and I can find the gdb_module.img in the install/bin directory
after I upload it to the board using gdb and execute it nothing happens so I 
guess this is not enough.

Could anyone point me out in a correct way of restoring my aeb-1 boot?
With best regards
Carlos Sobrinho


PS:This is a hoobie/robot contest project so I can't afford $500/$+1000 in 
buying a jeeni or a multice from ARM so free/gnu tools would be more than 
welcome. I'm using the Wiggler cable from 
http://jtag-arm9.sourceforge.net/circuit.txt and I can use the pppc_arm_rgdb 
(remote gdb) from http://www.s.netic.de/tmohr/parportpcb.html

- -- 
##############################################
# "Every man has his price. Mine is $3.95."  #
##############################################
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/TMQxPNuG8sls+U0RAvDdAJ0TUkCgDYcuX7mpIixAytKpxTBPHgCgo7eS
xACyj5FkjzTVQ6eAz6/YjJE=
=8KLz
-----END PGP SIGNATURE-----

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

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

end of thread, other threads:[~2003-09-02  3:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-27 14:47 [ECOS] Restoring boot/ecos on a AEB-1 using JTAG/Wiggler? Carlos Sobrinho
2003-08-28  7:32 ` Eric de Jong
2003-08-28 14:20   ` Carlos Sobrinho
2003-09-02  3:10 ` Jonathan Larmour
  -- strict thread matches above, loose matches on Subject: below --
2003-08-27 14:46 Carlos Sobrinho

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