czesc,
Nie moge zmusic JTAGa do pracy. Uzywam
a) Yagarto Toolchain do kompilacji
b) OpenOCD do programowanie
Probuje zaprogramowac AT91SAM7S256 (text on chip AU without number). Uzywam plyty ewaluacyjnej ZL11ARM modulu ZL12ARM.
Posiadam KrisTech USB JTAG (UsbScarab2).
Moge zaprogramowac flash programem SAM-BA v1.1 (ale juz nie wersja pozniejsza) po przywroceniu bootloade'ar. Teraz chcialbym zaczac uzywac JTAG'a, ale jest problem. OpenOCD zawsze zwraca blad:
Error: embeddedice.c:181 embeddedice_build_reg_cache(): unknown EmbeddedICE version (comms ctrl: 0x00000000)
Probowalem roznych rzeczy, plikow konf. itd, ale nic sie nie zmienia. Przejrzalem rozne fora i nigdzie nie ma odpowiedzi, ktora naprawilaby sytuacje. Probuje zaprogramowac blink_flash z tutorialu Jim'a Lynch'a http://www.atmel.com/dyn/resources/prod_documents/atmel_tutorial_source.zip. Ponizej dokladne logi OpenOCD i pliki konfuguracyjne, jesli ktos wie o co moze chodzic, prosze o pomoc. Dzieki.
Pawel
Log z OpenOCD
I to sie powtarza w nieskonczonosc
--openocd.cfg--
--script.ocd--
--makefile--
Nie moge zmusic JTAGa do pracy. Uzywam
a) Yagarto Toolchain do kompilacji
b) OpenOCD do programowanie
Probuje zaprogramowac AT91SAM7S256 (text on chip AU without number). Uzywam plyty ewaluacyjnej ZL11ARM modulu ZL12ARM.
Posiadam KrisTech USB JTAG (UsbScarab2).
Moge zaprogramowac flash programem SAM-BA v1.1 (ale juz nie wersja pozniejsza) po przywroceniu bootloade'ar. Teraz chcialbym zaczac uzywac JTAG'a, ale jest problem. OpenOCD zawsze zwraca blad:
Error: embeddedice.c:181 embeddedice_build_reg_cache(): unknown EmbeddedICE version (comms ctrl: 0x00000000)
Probowalem roznych rzeczy, plikow konf. itd, ale nic sie nie zmienia. Przejrzalem rozne fora i nigdzie nie ma odpowiedzi, ktora naprawilaby sytuacje. Probuje zaprogramowac blink_flash z tutorialu Jim'a Lynch'a http://www.atmel.com/dyn/resources/prod_documents/atmel_tutorial_source.zip. Ponizej dokladne logi OpenOCD i pliki konfuguracyjne, jesli ktos wie o co moze chodzic, prosze o pomoc. Dzieki.
Pawel
Log z OpenOCD
Debug: jtag.c:1407 jtag_init(): -
Debug: ft2232.c:1296 ft2232_init_ftd2xx(): 'ft2232' interface using FTD2XX with 'olimex-jtag' layout (15ba:0003)
Debug: ft2232.c:1385 ft2232_init_ftd2xx(): current latency timer: 2
Debug: ft2232.c:1732 olimex_jtag_init(): 80 08 1b
Debug: ft2232.c:1775 olimex_jtag_init(): 82 09 0f
Debug: ft2232.c:253 ft2232_speed(): 86 0a 00
Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST asserted
Debug: jtag.c:1197 jtag_reset_callback(): -
Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST asserted
Debug: jtag.c:1197 jtag_reset_callback(): -
Debug: jtag.c:1291 jtag_examine_chain(): JTAG device found: 0x05b0903f (Manufacturer: 0x01f, Part: 0x5b09, Version: 0x0
Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST asserted
Debug: jtag.c:1197 jtag_reset_callback(): -
Debug: openocd.c:113 main(): jtag init complete
Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4
Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST released
Debug: jtag.c:1197 jtag_reset_callback(): -
Error: embeddedice.c:181 embeddedice_build_reg_cache(): unknown EmbeddedICE version (comms ctrl: 0x00000000)
Debug: arm7_9_common.c:707 arm7_9_assert_reset(): target->state: unknown
Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: SRST asserted
Debug: jtag.c:1197 jtag_reset_callback(): -
Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST asserted
Debug: jtag.c:1197 jtag_reset_callback(): -
Warning: arm7_9_common.c:734 arm7_9_assert_reset(): srst resets test logic, too
Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: SRST asserted
Debug: jtag.c:1197 jtag_reset_callback(): -
Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST asserted
Debug: jtag.c:1197 jtag_reset_callback(): -
Debug: ft2232.c:993 olimex_jtag_reset(): trst: 0, srst: 1, high_output: 0x03, high_direction: 0x0f
Debug: ft2232.c:993 olimex_jtag_reset(): trst: 0, srst: 1, high_output: 0x03, high_direction: 0x0f
Debug: arm7_9_common.c:773 arm7_9_deassert_reset(): target->state: reset
Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: SRST released
Debug: jtag.c:1197 jtag_reset_callback(): -
Debug: ft2232.c:993 olimex_jtag_reset(): trst: 0, srst: 0, high_output: 0x09, high_direction: 0x0f
Debug: openocd.c:117 main(): target init complete
Debug: openocd.c:121 main(): flash init complete
Debug: openocd.c:125 main(): NAND init complete
Debug: openocd.c:129 main(): pld init complete
Debug: gdb_server.c:1451 gdb_init(): gdb service for target arm7tdmi at port 3333
Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 1
Debug: jtag.c:295 jtag_call_event_callbacks(): jtag event: TRST released
Debug: jtag.c:1197 jtag_reset_callback(): -
Debug: arm7_9_common.c:929 arm7_9_halt(): target->state: running
Debug: embeddedice.c:384 embeddedice_write_reg(): 9: 0xffffffff
Debug: embeddedice.c:384 embeddedice_write_reg(): 11: 0xffffffff
Debug: embeddedice.c:384 embeddedice_write_reg(): 12: 0x00000100
Debug: embeddedice.c:384 embeddedice_write_reg(): 13: 0x000000f7
Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4
Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4
Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4
Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4
Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4
Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4
Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 4
Debug: embeddedice.c:220 embeddedice_read_reg_w_check(): 1
I to sie powtarza w nieskonczonosc
--openocd.cfg--
#define our ports
telnet_port 4444
gdb_port 3333
#commands specific to the Amontec JTAGKey
interface ft2232
ft2232_device_desc "usbScarab2 A"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0003
jtag_speed 5
jtag_nsrst_delay 500
jtag_ntrst_delay 500
#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
#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 script.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
--script.ocd--
a# OpenOCD Target Script for Atmel AT91SAM7S256
#
# Programmer: James P Lynch
#
wait_halt # halt the processor and wait
armv4_5 core_state arm # select the core state
mww 0xffffff60 0x00320100 # set flash wait state (AT91C_MC_FMR)
mww 0xfffffd44 0xa0008000 # watchdog disable (AT91C_WDTC_WDMR)
mww 0xfffffc20 0xa0000601 # enable main oscillator (AT91C_PMC_MOR)
wait 100 # wait 100 ms
mww 0xfffffc2c 0x00480a0e # set PLL register (AT91C_PMC_PLLR)
wait 200 # wait 200 ms
mww 0xfffffc30 0x7 # set master clock to PLL (AT91C_PMC_MCKR)
wait 100 # wait 100 ms
mww 0xfffffd08 0xa5000401 # enable user reset AT91C_RSTC_RMR
flash write 0 main.bin 0x0 # program the onchip flash
reset # reset processor
shutdown # stop OpenOCD
--makefile--
# ***************************************************************
# * Makefile for Atmel AT91SAM7S256 - flash execution *
# * *
# * *
# * James P Lynch May 12, 2007 *
# ***************************************************************
NAME = demo_at91sam7_blink_flash
# variables
CC = arm-elf-gcc
LD = arm-elf-ld -v
AR = arm-elf-ar
AS = arm-elf-as
CP = arm-elf-objcopy
OD = arm-elf-objdump
CFLAGS = -I./ -c -fno-common -O0 -g
AFLAGS = -ahls -mapcs-32 -o crt.o
LFLAGS = -Map main.map -Tdemo_at91sam7_blink_flash.cmd
CPFLAGS = --output-target=binary
ODFLAGS = -x --syms
OBJECTS = crt.o main.o timerisr.o timersetup.o isrsupport.o lowlevelinit.o blinker.o
# make target called by Eclipse (Project -> Clean ...)
clean:
-rm $(OBJECTS) crt.lst main.out main.bin main.map main.dmp
# -rm $(OBJECTS) crt.lst main.lst main.out main.bin main.hex main.map main.dmp
#make target called by Eclipse (Project -> Build Project)
all: main.out
@ echo "...copying"
$(CP) $(CPFLAGS) main.out main.bin
$(OD) $(ODFLAGS) main.out > main.dmp
main.out: $(OBJECTS) demo_at91sam7_blink_flash.cmd
@ echo "..linking"
$(LD) $(LFLAGS) -o main.out $(OBJECTS) libc.a libm.a libgcc.a
crt.o: crt.s
@ echo ".assembling"
$(AS) $(AFLAGS) crt.s > crt.lst
main.o: main.c
@ echo ".compiling"
$(CC) $(CFLAGS) main.c
timerisr.o: timerisr.c
@ echo ".compiling"
$(CC) $(CFLAGS) timerisr.c
lowlevelinit.o: lowlevelinit.c
@ echo ".compiling"
$(CC) $(CFLAGS) lowlevelinit.c
timersetup.o: timersetup.c
@ echo ".compiling"
$(CC) $(CFLAGS) timersetup.c
isrsupport.o: isrsupport.c
@ echo ".compiling"
$(CC) $(CFLAGS) isrsupport.c
blinker.o: blinker.c
@ echo ".compiling"
$(CC) $(CFLAGS) blinker.c
# **********************************************************************************************
# FLASH PROGRAMMING
#
# Alternate make target for flash programming only
#
# You must create a special Eclipse make target (program) to run this part of the makefile
# (Project -> Create Make Target... then set the Target Name and Make Target to "program")
#
# OpenOCD is run in "batch" mode with a special configuration file and a script file containing
# the flash commands. When flash programming completes, OpenOCD terminates.
#
# Note that the script file of flash commands (script.ocd) is part of the project
#
# Programmers: Martin Thomas, Joseph M Dupre, James P Lynch
# **********************************************************************************************
# specify output filename here (must be *.bin file)
TARGET = main.bin
# specify the directory where openocd executable and configuration files reside
OPENOCD_DIR = 'c:/Yagarto/OpenOCD/bin/'
# specify OpenOCD executable (pp is for the wiggler, ftd2xx is for the USB debuggers)
#OPENOCD = $(OPENOCD_DIR)openocd-pp.exe
OPENOCD = $(OPENOCD_DIR)openocd-ftd2xx.exe
# specify OpenOCD configuration file (pick the one for your device)
#OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-wiggler-flash-program.cfg
#OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-jtagkey-flash-program.cfg
OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-armusbocd-flash-program.cfg
# program the AT91SAM7S256 internal flash memory
program: $(TARGET)
@echo "Flash Programming with OpenOCD..." # display a message on the console
$(OPENOCD) -f $(OPENOCD_CFG) # program the onchip FLASH here
@echo "Flash Programming Finished." # display a message on the console