Amontec JTAG key and SAM7-P256

Hopefully someone can help me here. I’ve been following Jim Lynch’s tutorial using a Olimex SAM7-P256 board and Amontec JTAG key flash programmer. I’ve followed all of the steps in the tut and get as far as trying to program the dev board and this is where I encounter problems. The console dump here is showing a problem with a lock error bit:

make -k program

Flash Programming with OpenOCD…

'c:/Program Files/openocd-2007re141/bin/'openocd-ftd2xx.exe -f 'c:/Program Files/openocd-2007re141/bin/'at91sam7s256-jtagkey-flash-program.cfg # program the onchip FLASH here

Info: openocd.c:86 main(): Open On-Chip Debugger (2007-04-16 19:30 CEST)

Warning: arm7_9_common.c:685 arm7_9_assert_reset(): srst resets test logic, too

Info: target.c:227 target_init_handler(): executing reset script ‘script.ocd’

Info: configuration.c:50 configuration_output_handler(): waiting for target halted…

Info: configuration.c:50 configuration_output_handler(): target halted

Info: configuration.c:50 configuration_output_handler(): core state: ARM

Info: configuration.c:50 configuration_output_handler(): waiting for target halted…

Info: configuration.c:50 configuration_output_handler(): target halted

Info: configuration.c:50 configuration_output_handler(): waiting for target halted…

Info: configuration.c:50 configuration_output_handler(): target halted

Info: configuration.c:50 configuration_output_handler(): waiting for target halted…

Info: configuration.c:50 configuration_output_handler(): target halted

Error: at91sam7.c:257 at91sam7_wait_status_busy(): status register: 0x30005

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:685 arm7_9_assert_reset(): srst resets test logic, too

Flash Programming Finished.

Can anyone help me fault-find what’s going on? Any help will be much appreciated. Cheers,

Phil

The two first lockregions in flash memory are locked. This is the region that contains the SAMBA bootloader and when the SAMBA bootloader is copied into flash the usual behaviour.

Error: at91sam7.c:257 at91sam7_wait_status_busy(): status register: 0x30005

They can be unlocked, from the telnet interface to OpenOCD, with the command

flash protect 0 0 1 off

I always, as I have written to this list before, that the best way to learn about OpenOCD and to be able to handle problems in the scripts is to use the telnet command liner interface. The command

flash info 0

will show clerly the state of flash and lock bits.

Regards,

Magnus

Cheers Magnus, all working now. Thanks for the help.

Phil