2009年6月4日木曜日

Eclipse & RTOSDemo

FreeRTOSがEclipseに導入の参照資料:

JTAGKey-Tinyの設定資料:

今回OpenJtagを利用したいので、Eclipse環境にopenocdの設定ファイルを改造することを必要と思う
openocdの設定ファイルは四つがあります。
◆ jtagkey.cfg
# default ports
telnet_port 4444
gdb_port 3333
tcl_port 6666

# interface configuration
interface ft2232
#ft2232_device_desc "Amontec JTAGkey A"
ft2232_device_desc "USB<=>JTAG&RS232
#ft2232_layout jtagkey
ft2232_layout "jtagkey_prototype_v1
#ft2232_vid_pid 0x0403 0xcff8
ft2232_vid_pid 0x1457 0x511

#jtag_speed 30
#jtag_khz 500

◆ stm32_mdBZ.cfg
# for stm32 medium density RevB and Z

set _CHIPNAME stm32
set _ENDIAN little

# jtag speed
#jtag_khz 565

reset_config trst_and_srst srst_pulls_trst
jtag_nsrst_delay 100
jtag_ntrst_delay 100

#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config trst_and_srst

#jtag scan chain
if { [info exists CPUTAPID ] } {
set _CPUTAPID $CPUTAPID
} else {
# See STM Document RM0008
# Section 26.6.3
set _CPUTAPID 0x3ba00477
}
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID

if { [info exists BSTAPID ] } {
set _BSTAPID $BSTAPID
} else {
# See STM Document RM0008
# Section 26.6.2
# Medium Density RevA
# set _BSTAPID 0x06410041
# Rev B and Rev Z
# set _BSTAPID 0x16410041
# My board is a Rev B and Rev Z
set _BSTAPID 0x16410041
}
jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID

set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME

$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size 16384 -work-area-backup 0

#flash bank stm32x 0 0 0 0 0
#The flash of my board is start from 0x8000000 and length is 128k
flash bank stm32x 0x08000000 0x20000 0 0 0

# For more information about the configuration files, take a look at:
# openocd.texi

◆ stm32_gdb.cfg
# default ports
telnet_port 4444
gdb_port 3333
tcl_port 6666

init
jtag_khz 565
#reset init
verify_ircapture disable

◆ stm32_program_eclipse.cfg
# default ports
telnet_port 4444
gdb_port 3333
tcl_port 6666

init
jtag_khz 565
#reset init
verify_ircapture disable

halt
wait halt
poll
stm32x mass_erase 0
#flash write_image C:/Projects/FreeRTOS/Demo/CORTEX_STM32Fxxx_Eclipse/RTOSDemo/RTOSDemo.bin 0x08000000 bin
flash write_image ./RTOSDemo/RTOSDemo.bin 0x8000000 bin
reset run
shutdown

STM32に書き込み場合が Run -> Externels Tools -> OpenOCD Programmerを使います。
デバックの場合が Run -> Externels Tools -> OpenOCD Serverを利用します。

Eclipse+OpenOCD+OpenJTAG+STM32の開発環境ができました!

d^_^b

0 件のコメント:

コメントを投稿