EmbDev.net

Forum: ARM programming with GCC/GNU tools openocd flashing of ATSAM7X256 fails


von Tom (Guest)


Rate this post
useful
not useful
Hi everybody!

I have troubles while programming the flash of the ATSAM7X256 and the
use of openocd for this task.

My devBoard:
http://www.olimex.com/dev/sam7-ex256.html

I use the Yagarto Toochain:
http://www.yagarto.de

furthermore i read Lynch's Tutorial "Using Open Source Tools for
AT91SAM7S Cross Development revision 2" which describes the installation
of Yagarto and the startupCode and openocd cfg files very well.

I've done following steps:

-) Powersupply for the Board from the USB port of my PC
-) I connected the Parallel Port Wiggler from Olimex to the parallel
port of my PC (Notebook with dockingstation, if this is important)


Then i used the openocd flash script from Lynch's tutorial, but the
flashing fails. Then i used the script file from
http://www2.pt.tu-clausthal.de/~alexp/arm/index.html which is adopted
for the ATSAM7X256. (Lynch tutorial is for the ATSAM7S256)

this is Lynch's openocd config file, which i'm currently using:

-------------------------------------------------------------------
#define our ports
telnet_port 4444
gdb_port 3333

#commands specific to the Amontec JTAGKey
interface parport
parport_port 0x378
parport_cable wiggler
jtag_speed 0
jtag_nsrst_delay 200
jtag_ntrst_delay 200

#reset_config <signals> [combination] [trst_type] [srst_type]
reset_config srst_only srst_pulls_trst

#jtag_device <IR length> <IR capture> <IR mask> <IDCODE instruction>
jtag_device 4 0x1 0xf 0xe

#daemon_startup <'attach'|'reset'>
daemon_startup reset

#target <type> <endianess> <reset_mode> <jtag#> [variant]
target arm7tdmi little run_and_init 0 arm7tdmi_r4
#target arm7tdmi little run_and_init 0 arm7tdmi-r4

#run_and_halt_time <target#> <time_in_ms>
run_and_halt_time 0 30

# commands below are specific to AT91sam7 Flash Programming
# ---------------------------------------------------------

#target_script specifies the flash programming script file
target_script 0 reset c:\scriptTemp\temp.ocd

#working_area <target#> <address> <size> <'backup'|'nobackup'>
working_area 0 0x40000000 0x4000 nobackup

#flash bank at91sam7 0 0 0 0 <target#>
flash bank at91sam7 0 0 0 0 0

-------------------------------------------------------------------

And this is the script for flashing the Controller, from
http://www2.pt.tu-clausthal.de/~alexp/arm/index.html :


-------------------------------------------------------------------
halt
sleep 10
mww 0xfffffd44 0x00008000
mww 0xfffffd08 0xa5000001
mww 0xfffffc20 0x00000601
sleep 10
mww 0xfffffc2c 0x00481c0e
sleep 10
mww 0xfffffc30 0x00000007
sleep 10
mww 0xffffff60 0x003c0100
arm7_9 force_hw_bkpts enable
arm7_9 dcc_downloads enable
sleep 10
poll
flash probe 0
flash erase 0 0 15
flash write 0 main.bin 0x0
reset run
sleep 10
shutdown

-------------------------------------------------------------------

And this is the output when i call openocd-pp -d -f XXX


'C:\Programme\ARM_TOOLCHAIN\openocd-2006re115\bin\'openocd-pp.exe -d -f
'C:\Programme\ARM_TOOLCHAIN\openocd-2006re115\bin\'at91sam7s256-wiggler- 
flash-program.cfg
Info:    openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00
CEST)
Debug:   jtag.c:1210 jtag_init():
Debug:   parport.c:373 parport_init(): requesting privileges for
parallel port 0x378...
Debug:   parport.c:383 parport_init(): ...privileges granted
Debug:   parport.c:210 parport_reset(): trst: 0, srst: 0
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug:   jtag.c:1096 jtag_reset_callback():
Error:   jtag.c:1149 jtag_validate_chain(): Error validating JTAG scan
chain, IR mismatch, scan returned 0x00
make: *** [program] Error -1


I get the same errors if i do not power my dev-Bord, or if i do not
connect the wiggler to the board -> very confusing!!?

What's about the jumpers on my board? -> all JTAG jumpers are not set (
TST, JTASEL ans ERASE)

When i press the reset button on the board, the olimex application boots
and shows a image on the screen. Do I have to erase this application
first before i flash my new programm into the memory?

I'm very new to openocd and the ARM controllers. Any help is welcome.
Thanks a lot.

lg
Tom

von Tom (Guest)


Rate this post
useful
not useful
Hi!

I changed my parallel port mode to ECP.
Then i found out that my parallelport baseaddress is at 0x3BC instead of
0x378.

I changed the config file to
parport_port 0x3BC

and now the output of openocd is:

------------------------------------------------------------------------ 
-------
'C:\Programme\ARM_TOOLCHAIN\openocd-2006re115\bin\'at91sam7s256-wiggler- 
flash-program.cfg
Info:    openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00
CEST)
Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test
logic, too
Info:    target.c:219 target_init_handler(): executing reset script
'c:\scriptTemp\temp.ocd'
Info:    configuration.c:50 configuration_output_handler(): requesting
target halt...
Warning: arm7_9_common.c:842 arm7_9_halt(): target was already halted
Info:    configuration.c:50 configuration_output_handler(): target
already halted
Info:    configuration.c:50 configuration_output_handler(): force
hardware breakpoints enabled
Info:    configuration.c:50 configuration_output_handler(): dcc
downloads are enabled
Info:    configuration.c:50 configuration_output_handler(): target
state: halted
Info:    configuration.c:50 configuration_output_handler(): target
halted in Thumb state due to debug request, current mode: System
Info:    configuration.c:50 configuration_output_handler(): cpsr:
0x200000df pc: 0x0000007e
Info:    configuration.c:50 configuration_output_handler(): flash
'at91sam7' found at 0x00100000
Error:   at91sam7.c:257 at91sam7_wait_status_busy(): status register:
0x70405
Error:   at91sam7.c:259 at91sam7_wait_status_busy(): Lock Error Bit
Detected, Operation Abort
Info:    configuration.c:50 configuration_output_handler(): flash erase
error
Error:   at91sam7.c:257 at91sam7_wait_status_busy(): status register:
0x70405
Error:   at91sam7.c:259 at91sam7_wait_status_busy(): Lock Error Bit
Detected, Operation Abort
Info:    configuration.c:50 configuration_output_handler(): failed
writing file main.bin to flash bank 0 at offset 0x00000000
Info:    configuration.c:50 configuration_output_handler(): flash
program error
Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test
logic, too
Flash Programming Finished
------------------------------------------------------------------------ 
---

If i enable debug mode the output is:

------------------------------------------------------------------------ 
----
'C:\Programme\ARM_TOOLCHAIN\openocd-2006re115\bin\'at91sam7s256-wiggler- 
flash-program.cfg
Info:    openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00
CEST)
Debug:   jtag.c:1210 jtag_init():
Debug:   parport.c:373 parport_init(): requesting privileges for
parallel port 0x3bc...
Debug:   parport.c:383 parport_init(): ...privileges granted
Debug:   parport.c:210 parport_reset(): trst: 0, srst: 0
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   openocd.c:100 main(): jtag init complete
Debug:   arm7_9_common.c:656 arm7_9_assert_reset(): target->state:
unknown
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 0
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug:   jtag.c:1096 jtag_reset_callback():
Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test
logic, too
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 0
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   parport.c:210 parport_reset(): trst: 0, srst: 1
Debug:   parport.c:210 parport_reset(): trst: 0, srst: 1
Debug:   arm7_9_common.c:722 arm7_9_deassert_reset(): target->state:
reset
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 2
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   parport.c:210 parport_reset(): trst: 0, srst: 0
Debug:   openocd.c:104 main(): target init complete
Debug:   openocd.c:108 main(): flash init complete
Debug:   gdb_server.c:1347 gdb_init(): gdb service for target arm7tdmi
at port 3333
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 3
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   arm7_9_common.c:838 arm7_9_halt(): target->state: running
Debug:   embeddedice.c:253 embeddedice_write_reg(): 9: 0xffffffff
Debug:   embeddedice.c:253 embeddedice_write_reg(): 11: 0xffffffff
Debug:   embeddedice.c:253 embeddedice_write_reg(): 12: 0x00000100
Debug:   embeddedice.c:253 embeddedice_write_reg(): 13: 0x000000f7
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:620 arm7_9_poll(): DBGACK set,
dbg_state->value: 0x19
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug:   embeddedice.c:253 embeddedice_write_reg(): 12: 0x00000000
Debug:   arm7_9_common.c:936 arm7_9_debug_entry(): target entered debug
from Thumb state
Debug:   arm7_9_common.c:940 arm7_9_debug_entry(): r0_thumb: 0x00001230,
pc_thumb: 0x00000084
Debug:   arm7_9_common.c:976 arm7_9_debug_entry(): target entered debug
state in System mode
Debug:   arm7_9_common.c:980 arm7_9_debug_entry(): thumb state, applying
fixups
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r0: 0x00001230
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r1: 0x00001224
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r2: 0x00001228
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r3: 0x00200550
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r4: 0x00200550
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r5: 0x0000007c
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r6: 0x00000000
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r7: 0x000000f9
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r8: 0x00200024
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r9: 0xe8bd500e
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r10: 0xe321f092
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r11: 0xe59fe02c
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r12: 0x000000d5
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r13: 0x00200b48
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r14: 0x000000f9
Debug:   arm7_9_common.c:1005 arm7_9_debug_entry(): r15: 0x0000007e
Debug:   arm7_9_common.c:1011 arm7_9_debug_entry(): entered debug state
at PC 0x7e
Debug:   target.c:442 target_call_event_callbacks(): target event 0
Info:    target.c:219 target_init_handler(): executing reset script
'c:\scriptTemp\temp.ocd'
Debug:   target.c:1254 handle_halt_command():
Info:    configuration.c:50 configuration_output_handler(): requesting
target halt...
Debug:   arm7_9_common.c:838 arm7_9_halt(): target->state: halted
Warning: arm7_9_common.c:842 arm7_9_halt(): target was already halted
Info:    configuration.c:50 configuration_output_handler(): target
already halted
Debug:   arm7_9_common.c:1822 arm7_9_write_memory(): address:
0xfffffd44, size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug:   arm7_9_common.c:1822 arm7_9_write_memory(): address:
0xfffffd08, size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug:   arm7_9_common.c:1822 arm7_9_write_memory(): address:
0xfffffc20, size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug:   arm7_9_common.c:1822 arm7_9_write_memory(): address:
0xfffffc2c, size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug:   arm7_9_common.c:1822 arm7_9_write_memory(): address:
0xfffffc30, size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug:   arm7_9_common.c:1822 arm7_9_write_memory(): address:
0xffffff60, size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Info:    configuration.c:50 configuration_output_handler(): force
hardware breakpoints enabled
Info:    configuration.c:50 configuration_output_handler(): dcc
downloads are enabled
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:620 arm7_9_poll(): DBGACK set,
dbg_state->value: 0x9
Info:    configuration.c:50 configuration_output_handler(): target
state: halted
Info:    configuration.c:50 configuration_output_handler(): target
halted in Thumb state due to debug request, current mode: System
Info:    configuration.c:50 configuration_output_handler(): cpsr:
0x200000df pc: 0x0000007e
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffff240,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   at91sam7.c:331 at91sam7_read_part_info(): nvptyp: 0x002, arch:
0x0075, alt_id: 0x77c09f8e, alt_addr: 0x0000
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc24,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc30,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc2c,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc2c,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xffffff68,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Info:    configuration.c:50 configuration_output_handler(): flash
'at91sam7' found at 0x00100000
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc24,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc30,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc2c,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc2c,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   at91sam7.c:235 at91sam7_set_flash_mode(): fmcn: 82
Debug:   arm7_9_common.c:1822 arm7_9_write_memory(): address:
0xffffff60, size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug:   arm7_9_common.c:1822 arm7_9_write_memory(): address:
0xffffff64, size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug:   at91sam7.c:279 at91sam7_flash_command(): Flash command:
0x5a000008, pagenumber:
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xffffff68,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   at91sam7.c:253 at91sam7_wait_status_busy(): status: 0x70405
Error:   at91sam7.c:257 at91sam7_wait_status_busy(): status register:
0x70405
Error:   at91sam7.c:259 at91sam7_wait_status_busy(): Lock Error Bit
Detected, Operation Abort
Info:    configuration.c:50 configuration_output_handler(): flash erase
error
Debug:   at91sam7.c:658 at91sam7_write(): first_page: 0, last_page: 8,
count 1996
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc24,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc30,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc2c,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xfffffc2c,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   at91sam7.c:235 at91sam7_set_flash_mode(): fmcn: 82
Debug:   arm7_9_common.c:1822 arm7_9_write_memory(): address:
0xffffff60, size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug:   arm7_9_common.c:1822 arm7_9_write_memory(): address:
0x00100000, size: 0x00000004, count: 0x00000040
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug:   arm7_9_common.c:1822 arm7_9_write_memory(): address:
0xffffff64, size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug:   at91sam7.c:279 at91sam7_flash_command(): Flash command:
0x5a000001, pagenumber:
Debug:   arm7_9_common.c:1676 arm7_9_read_memory(): address: 0xffffff68,
size: 0x00000004, count: 0x00000001
Debug:   embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug:   at91sam7.c:253 at91sam7_wait_status_busy(): status: 0x70405
Error:   at91sam7.c:257 at91sam7_wait_status_busy(): status register:
0x70405
Error:   at91sam7.c:259 at91sam7_wait_status_busy(): Lock Error Bit
Detected, Operation Abort
Info:    configuration.c:50 configuration_output_handler(): failed
writing file main.bin to flash bank 0 at offset 0x00000000
Info:    configuration.c:50 configuration_output_handler(): flash
program error
Debug:   target.c:1328 handle_reset_command():
Debug:   arm7_9_common.c:656 arm7_9_assert_reset(): target->state:
halted
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 0
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug:   jtag.c:1096 jtag_reset_callback():
Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test
logic, too
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 0
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   parport.c:210 parport_reset(): trst: 0, srst: 1
Debug:   parport.c:210 parport_reset(): trst: 0, srst: 1
Debug:   arm7_9_common.c:722 arm7_9_deassert_reset(): target->state:
reset
Debug:   jtag.c:247 jtag_call_event_callbacks(): jtag event: 2
Debug:   jtag.c:1096 jtag_reset_callback():
Debug:   parport.c:210 parport_reset(): trst: 0, srst: 0
Flash Programming Finished.
------------------------------------------------------------------------ 
----

The Errors are about the lock bits. AFAIK these lock bits must be
cleared befor the bin data can be flashed. But i dont know if my
settings in the Openocd scripts are correct.?! (see thread origin for my
config file)

ANY help is welcome!

Thank's a lot
rain

von Tom (Guest)


Rate this post
useful
not useful
Problem solved:

I forgot to erase the Lock Bits. now it works fine.

cheers,
Tom

von Marcelo M. (marcelo_villegas)


Rate this post
useful
not useful
Hi Tom, I'm beginner and I try to work with at91sam7x256 and I have too
Lynch's tutorial but I don't understand what I must to do on the page 77
"Using OpenOCD to  Program the Flash memory", I understand that we must
to change some lines, but I don't know where is the file?? You can talk
about this title.

merry chistmas.

Marcelo

von Guest (Guest)


Rate this post
useful
not useful
Tom wrote:
> Problem solved:
>
> I forgot to erase the Lock Bits. now it works fine.
>
> cheers,
> Tom

please tell me how you unlocked the bits.
is i give open ocd the command "flash erase 0 0 15" to unlock the
lockbits an error occured: unknown command" flash erase". super. please
help

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Guest wrote:
> Tom wrote:
>> Problem solved:
>>
>> I forgot to erase the Lock Bits. now it works fine.
>>
>> cheers,
>> Tom
>
> please tell me how you unlocked the bits.
> is i give open ocd the command "flash erase 0 0 15" to unlock the
> lockbits an error occured: unknown command" flash erase". super. please
> help

to have th eflash command working, you need to have the flash section in
your config file.

flash bank at91sam7 0 0 0 0 0

if this is not in your config, you will not have the flash command
available.

Jonathan

von Florian R. (floechen)


Rate this post
useful
not useful
Well I have the same problem. But I have no idea how to delete the
lockbits to be able to access the flash. or maybe my configuration file
is wrong, i have the config from
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/openocd_intro/index.html.

florian

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
I do not own a SAM7X256 board so I can not provide tested solutions
(Someone offered to send a board for tests but I have never heard from
him again after his first mail). Nevertheless I have updated my page
(siwawi...openocd_intro) with some additional information on the SAM7
from which I think it should be correct. Please re-read the page and
send feedback if it works or does not work for you.

Martin Thomas

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Martin Thomas wrote:
> I do not own a SAM7X256 board so I can not provide tested solutions
> (Someone offered to send a board for tests but I have never heard from
> him again after his first mail). Nevertheless I have updated my page
> (siwawi...openocd_intro) with some additional information on the SAM7
> from which I think it should be correct. Please re-read the page and
> send feedback if it works or does not work for you.
>
> Martin Thomas

For the sam7x, you only need to put the ERASE jumper to Start SAM-BA.
After samba have finish to program you application and ask you to lock
region, just say no. After that don't forget to write to nvwm bit 2 to
start app from flash.

Jonathan

von Jonathan D. (dumarjo)


Rate this post
useful
not useful
Jonathan Dumaresq wrote:
> Martin Thomas wrote:
>> I do not own a SAM7X256 board so I can not provide tested solutions
>> (Someone offered to send a board for tests but I have never heard from
>> him again after his first mail). Nevertheless I have updated my page
>> (siwawi...openocd_intro) with some additional information on the SAM7
>> from which I think it should be correct. Please re-read the page and
>> send feedback if it works or does not work for you.
>>
>> Martin Thomas
>
> For the sam7x, you only need to put the ERASE jumper to Start SAM-BA.
> After samba have finish to program you application and ask you to lock
> region, just say no. After that don't forget to write to nvwm bit 2 to
> start app from flash.
>
> Jonathan

The flash command to erease lock bit it

flash protect 0 0 1 off

the 1 should be reflecting the lockbit you have. if it's only samba that
is loaded, this should work. if not you should increse the 1 to X. you
can know what bit is locked by the

flash info 0

this will tell you what is the lock bit.

Jonathan

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.