Hi,
flash probe 1 does not work with neither drives at91sam7 old or new.
First the debug in RAM speed didn’t change much. still about 300-400 bytes/s (it takes a couple of min to load my program).
This is most ennoying for me since it take so long time to debug things
Now the flashing: With at91sam7_old I can flash at about 0.27 kb/s (wich is slow but I can live with it)
With at91sam7_new I was not able to flash at all (although the MCK detection was right): Here is the filterd output
memory write caused data abort (address: 0xffffff60, size: 0x4, count: 0x1)
Runtime error, file “command.c”, line 456:
failed setting protection for areas 0 to 31 (-901)
failed erasing sectors 0 to 31 (-901)
BUG: keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1027)
status register: 0xffff0305
Lock Error Bit Detected, Operation Abort
error writing to flash at address 0x00100000 at offset 0x00000000 (-902)
My hardware: AT91SAM7S-512 MPU and a USBPROG dongle from http://www.embedded-projects.net/index.php?page_id=165
Here is the cfg file I use:
------------------------------------- CONFIG FILE --------------------------------
telnet_port 4444
gdb_port 3333
interface usbprog
jtag_speed 0
reset_config srst_only srst_pulls_trst
jtag newtap at91sam7s cpu -irlen 4 -ircapture 0x1 -irmask 0xf
target create at91sam7s.cpu arm7tdmi -endian little -chain-position at91sam7s.cpu -variant arm7tdmi
at91sam7s.cpu configure -work-area-virt 0 -work-area-phys 0x00200000 -work-area-size 0x4000 -work-area-backup 0
#flash bank at91sam7 0 0 0 0 0
flash bank at91sam7_new 0 0 0 0 0 0 0 0 0 0 0 0 18432
---------------------------------- END OF CONFIG FILE ---------------------------------
This is my debug script:
----------------- DEBUG SCRIPT ------------------------------------------------------
target remote :3333
monitor fast enabled
set remotetimeout 1000
set mem inaccessible-by-default off
## Init - taken form the script openocd_at91sam7_ecr.script
monitor mww 0xfffffd44 0x00008000 # disable watchdog
monitor mww 0xfffffd08 0xa5000001 # enable user reset
monitor mww 0xfffffc20 0x00000601 # CKGR_MOR : enable the main oscillator(18.432MHz)
monitor sleep 100
monitor mww 0xfffffc2c 0x00481c0e # CKGR_PLLR: 96.1097 MHz(18.432MHz/14*(72+1))
monitor sleep 100
monitor mww 0xfffffc30 0x00000007 # PMC_MCKR : MCK = PLL / 2 = 48 MHz
monitor sleep 100
monitor arm7_9 dbgrq enable
monitor arm7_9 fast_memory_access enable
monitor arm7_9 dcc_downloads disable
monitor gdb_breakpoint_override hard
monitor gdb_memory_map enable
load
------------------------------------END OF DEBUG SCRIPT -----------------------------------
The flash script (using GDB as well):
----------------- FLASH SCRIPT (GDB)------------------------------------------------------
target remote :3333
set remotetimeout 1000
monitor reset halt
monitor soft_reset_halt
monitor gdb_memory_map enable
monitor gdb_flash_program enable
monitor arm7_9 dbgrq enable
monitor arm7_9 dcc_downloads enable
monitor arm7_9 fast_memory_access enable
monitor armv4_5 core_state arm
## Init - taken form the script openocd_at91sam7_ecr.script
monitor mww 0xffffff60 0x00320100 # set flash wait state (AT91C_MC_FMR)
monitor mww 0xfffffd44 0x00008000 # disable watchdog
monitor mww 0xfffffd08 0xa5000001 # enable user reset
monitor mww 0xfffffc20 0x00000601 # CKGR_MOR : enable the main oscillator(18.432MHz)
monitor sleep 100
monitor mww 0xfffffc2c 0x00481c0e # CKGR_PLLR: 96.1097 MHz(18.432MHz/14*(72+1))
monitor sleep 100
monitor mww 0xfffffc30 0x00000007 # PMC_MCKR : MCK = PLL / 2 = 48 MHz
monitor sleep 100
monitor flash protect 0 0 31 off
monitor flash erase_sector 0 0 31
monitor flash write_image bin/D-METER-flash.bin 0x00100000 bin
monitor flash protect 0 0 31 on
monitor mdw 0x00100000 0x100
monitor mww 0xfffffd08 0xa5000401 # enable user reset
monitor reset
quit
------------------------------------END OF FLASH SCRIPT -----------------------------------
By the way DCC download never worked when debugging in RAM: Here is the output of the error:
Error: 4024 295801 arm7_9_common.c:2424 arm7_9_bulk_write_memory(): DCC write failed, expected end address 0x00203f80 got 0x0
Error: 4025 295801 gdb_server.c:1151 gdb_error(): unexpected error -4
Sorry for the long reply, I really hope you don’t get bord
I really appreciate it, Thanx