Jump to content

Sign in to follow this  

AT91SAM7x256 не шьется c помощью openocd

Recommended Posts

Здравствуйте. Помогите плз, не шьется МК AT91SAM7x256, при этом говорит, что вроде зашил, а при перезапуске платы


localhost ~ #localhost ~ # lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 015: ID 03eb:6124 Atmel Corp. at91sam SAMBA bootloader

Bus 002 Device 010: ID 15ba:0004 Olimex Ltd. OpenOCD JTAG TINY

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub


хотя бутлоадер самбы должен был исчезнуть при удачной заливке программы.


Плата Olimex SAM7-EX256


Прошивка тестовая для этой платы - GE8 отсюда http://olimex.com/dev/sam7-ex256.html





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

reset_config srst_only srst_pulls_trst


if { [info exists CHIPNAME] } {


} else {

set _CHIPNAME sam7x256



if { [info exists ENDIAN] } {


} else {

set _ENDIAN little



if { [info exists CPUTAPID ] } {


} else {

set _CPUTAPID 0x3f0f0f0f



jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID



target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi


$_TARGETNAME configure -event reset-init {

# disable watchdog

mww 0xfffffd44 0x00008000

# enable user reset

mww 0xfffffd08 0xa5000001

# CKGR_MOR : enable the main oscillator

mww 0xfffffc20 0x00000601

sleep 10

# CKGR_PLLR: 96.1097 MHz

mww 0xfffffc2c 0x00481c0e

sleep 10

# PMC_MCKR : MCK = PLL / 2 ~= 48 MHz

mww 0xfffffc30 0x00000007

sleep 10

# MC_FMR: flash mode (FWS=1,FMCN=60)

mww 0xffffff60 0x003c0100

sleep 100



$_TARGETNAME configure -work-area-phys 0x00200000 -work-area-size 0x4000 -work-area-backup 0


#flash bank <driver> <base_addr> <size> <chip_width> <bus_width> <target_number> [<target_name> <banks> <sectors_per_bank> <pages_per_sector> <page_size> <num_nvmbits> <ext_freq_khz>]


flash bank $_FLASHNAME at91sam7 0 0 0 0 $_TARGETNAME 0 0 0 0 0 0 0 18432


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

# openocd.texi

#arm7_9 fast_memory_access enable

arm7_9 dcc_downloads enable


echo "flash banks:"

flash banks

echo "*********************"






echo "flash probe:"

flash probe 0

echo "*********************"

echo "flash erase:"

flash erase_sector 0 0 15

echo "*********************"

echo "flash write bank"

flash write_bank 0 SAM7_EX256_GE8.bin 0x0

echo "*********************"

#echo "flash write image"

#flash write_image SAM7_EX256_GE8.bin 0x00100000

#echo "*********************"



openocd -f interface/olimex-jtag-tiny.cfg -f openocd.cfg



Open On-Chip Debugger 0.4.0 (2010-05-21-23:19)

Licensed under GNU GPL v2

For bug reports, read


srst_only srst_pulls_trst srst_gates_jtag srst_open_drain

dcc downloads are enabled

flash banks:

#0: at91sam7 at 0x00000000, size 0x00000000, buswidth 0, chipwidth 0


Info : clock speed 6000 kHz

Info : JTAG tap: sam7x256.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)

Info : Embedded ICE version 1

Info : sam7x256.cpu: hardware has 2 breakpoint/watchpoint units

Info : JTAG tap: sam7x256.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)

Warn : NOTE! Severe performance degradation without fast memory access enabled. Type 'help fast'.

target state: halted

target halted in ARM state due to debug-request, current mode: Supervisor

cpsr: 0x80000093 pc: 0x00000108

flash probe:

flash 'at91sam7' found at 0x00100000


flash erase:

erased sectors 0 through 15 on flash bank 0 in 0.128014s


flash write bank

wrote 33792 bytes from file SAM7_EX256_GE8.bin to flash bank 0 at offset 0x00000000 in 14.669046s (2.250 kb/s)


Share this post

Link to post
Share on other sites
Для запуска из флеш SAM7X нужно еще правильно выставить бит GPNVM2.


Большое Вам спасибо. Все заработало.

К сожалению не всегда получается прочесть то что написано в даташите один раз мелкими буквами :))

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this