********************************************************************************
* *
* How to modify SAM-BA to fit a custom AT91SAM board *
* *
********************************************************************************
* *
* ATMEL Microcontroller Software Support *
* Copyright (c) 2009, Atmel Corporation *
* *
********************************************************************************
1. Introduction
Please refer to the AT91 ISP SAM-BA User Guide.pdf file in the Documentation
folder of ISP.
The aim of this file is to explain quickly with an example what you need to
modify to make SAM-BA working with a custom board based on a AT91SAM device,
and how to re-compile the applets if needed.
Note : the example and and the corresponding paths indicated in this file are
related to the AT91SAM9263 device, but the principle is the same for all
other AT91SAM devices.
1.1 Cases you need to recompile applets and customize SAM-BA
* the SDRAM is NOT connected with a 32 bits bus width (the standard
on EK boards),
* the pins used to connect Nandflash, Dataflash, Serialflash are not
the same as on the EK board.
2. SAM-BA quick overview
2.1 Communication links
The communication protocol consists in a very simple command set
allowing to do read and write operations in the *mapped momory* of the
chip. Read and write operations can be achieved with byte, short or
integer data at one address, or with a multiple byte buffer starting at
one given address.
List of SAM-BA Monitor commands :
Command | Action | Argument(s) | Example | Comments
========|====================|=====================|==================|==================
N | set Normal mode | No argument | N# | Data sent and
| | | | received by the
| | | | monitor will be
| | | | transmitted in
| | | | binary.
--------|--------------------|---------------------|------------------|------------------
T | set Terminal mode | No argument | T# | Data will be
| | | | sent in ASCII.
--------|--------------------|---------------------|------------------|------------------
O | write a byte | Address, Value# | O200001,CA# |
--------|--------------------|---------------------|------------------|------------------
o | read a byte | Address,# | o200001,# |
--------|--------------------|---------------------|------------------|------------------
H | write a half word | Address, Value# | H200002,CAFE# |
--------|--------------------|---------------------|------------------|------------------
h | read a half word | Address,# | h200002,# |
--------|--------------------|---------------------|------------------|------------------
W | write a word | Address, Value# | W200000,CAFEDECA#|
--------|--------------------|---------------------|------------------|------------------
w | read a word | Address,# | w200000,# |
--------|--------------------|---------------------|------------------|------------------
S | send a file | Address,# | S200000,# |
--------|--------------------|---------------------|------------------|------------------
R | receive a file | Address, NbOfBytes# | R200000,1234# |
--------|--------------------|---------------------|------------------|------------------
G | go | Address# | G200200# |
--------|--------------------|---------------------|------------------|------------------
V | display version | No argument | V# |
--------|--------------------|---------------------|------------------|------------------
Note : depending on the chip (and its ROM code version), the number of charaters returned
by SAM-BA Monitor after a 'N#' or 'T#' may vary.
Usually after 'N#' the chip reply with 2 bytes : LF/CR (OxA, 0xD), and after 'T#'
the chip reply with 3 bytes : LF/CR and '>' (OxA, 0xD, 0x3E)
At startup, SAM-BA GUI set the chip in Normal mode.
Communication link can be serial COM port, USB or JTAG. To use USB and
COM port link, SAM-BA needs SAM-BA Boot to be running on the target (it
is part of the ROM Code of each device). So the chip must boot on the
ROM code and must not have found a bootable program on any external
memory such as Dataflash or Nandflash. To use the JTAG link with a
SAM-ICE or J-Link probe, a "SAM-BA Boot like" application is loaded by
the probe into chip internal SRAM after the probe has done a reset of
the device.
2.2 Applets
In order to be able to program non-volatile memories, SAM-BA uses
several small binary files called 'applets'. For each AT91SAM device,
there is one applet dedicated to each external memory device the chip
can deal with. Each applet contains the programming algorithm for its
dedicated memory. To set an example, for an AT91SAM9263 devices, SAM-BA
can program SDRAM, Nandflash, Dataflash, Serialflash, and Norflash. That
is why you will find five binary files in :
sam-ba v2.x\applets\isp-project\tcl_lib\at91sam9263-ek folder.
The applet code consists in :
* a mailbox data structure for commands and data read or written by
SAM-BA GUI application,
* at least an init part used to initialize PIOs and configure access
to the memory,
* some other read, write, erase parts,
* a buffer area located after the applet code that contains the data
to be written or read by the applet.
2.3 Runtime operations
Excepted for devices without EBI (SAM7S ...), for internal flash
applets, and for the applet used to initialize the external RAM itself,
all applets are compiled to run at the beginning of the *external RAM*.
That's why an external memory (SDRAM / DDRAM) *must* be correctly
initialized.
The external RAM init is automatically done when SAM-BA starts. This is
achieved in TCL by the at91sam9263-ek.tcl file that loads the extram
applet (isp-extram-at91sam9263.bin) in the internal SRAM of the chip and
sends the INIT command to this applet. (see lines 99-109 in
at91sam9263-ek.tcl).
Note : the extram applet has only an INIT command that configures the EBI
timings and tests that the accesses to the RAM is OK.
Once the external RAM is initialized, we can use it to store other
applet code and data to program external flashes (Dataflash or Nandflash
for example).
This step is done when you execute the "Enable Nandflash" script in
SAM-BA GUI Nandflash pane : the Nandflash applet
(isp-nandflash-at91sam9263.bin) is loaded at the beginning of the EXTRAM
and the INIT command is written in the mailbox.
3. Customizing SAM-BA
In case you have a custom design that is different from the design of
AT91SAM Evaluation Kit, you may need to adapt the code of the applets
and recompile some of them. All the sources are provided with the
AT91-ISP installer, and applets are written in C.
3.2 Folders structure
The runtime directory for SAM-BA is C:\Program Files\ATMEL
Corporation\AT91-ISP v1.xx\sam-b
没有合适的资源?快使用搜索试试~ 我知道了~
sam-ba_2.9_cdc_linux
共1298个文件
h:270个
c:175个
lds:149个
4星 · 超过85%的资源 需积分: 10 46 下载量 36 浏览量
2010-08-03
14:51:51
上传
评论
收藏 7.15MB ZIP 举报
温馨提示
Linux PC host tool can download image to SPI NOR, NAND of AT91SAM serise SoC with CDC USB serial communication link.
资源推荐
资源详情
资源评论
收起资源包目录
sam-ba_2.9_cdc_linux (1298个子文件)
Flash_example.bat 2KB
isp-nandflash-at91sam3u4.bin 15KB
isp-nandflash-at91sam9rl64.bin 15KB
isp-nandflash-at91sam9g10.bin 15KB
isp-nandflash-at91sam9261.bin 15KB
isp-nandflash-at91sam9260.bin 15KB
isp-nandflash-at91sam9m10.bin 15KB
isp-nandflash-at91sam9xe512.bin 15KB
isp-nandflash-at91sam9g45.bin 15KB
isp-nandflash-at91sam9263.bin 15KB
isp-nandflash-at91sam9g20.bin 15KB
isp-nandflash-at91sam9xe128.bin 15KB
isp-nandflash-at91sam9xe256.bin 15KB
isp-nandflash-at91cap9.bin 15KB
isp-nandflash-at91sam7se512.bin 15KB
isp-nandflash-at91sam7se256.bin 15KB
isp-nandflash-at91cap9.bin 15KB
isp-nandflash-at91cap9.bin 15KB
isp-norflash-at91sam9260.bin 14KB
isp-norflash-at91sam9m10.bin 14KB
isp-norflash-at91sam9rl64.bin 14KB
isp-norflash-at91sam9xe512.bin 14KB
isp-norflash-at91sam9g10.bin 14KB
isp-norflash-at91sam9g45.bin 14KB
isp-norflash-at91sam9261.bin 14KB
isp-norflash-at91sam9263.bin 14KB
isp-norflash-at91sam9g20.bin 14KB
isp-norflash-at91sam9xe128.bin 14KB
isp-norflash-at91sam9xe256.bin 14KB
isp-norflash-at91sam7se512.bin 14KB
isp-norflash-at91sam7se256.bin 14KB
isp-norflash-at91cap9.bin 14KB
isp-norflash-at91cap9.bin 14KB
isp-serialflash-at91sam7x256.bin 12KB
isp-serialflash-at91sam7x512.bin 12KB
isp-serialflash-at91sam7a3.bin 12KB
isp-serialflash-at91sam7se32.bin 12KB
isp-serialflash-at91sam7se512.bin 12KB
isp-serialflash-at91sam7se256.bin 12KB
isp-serialflash-at91sam9260.bin 12KB
isp-serialflash-at91sam9m10.bin 12KB
isp-serialflash-at91sam9rl64.bin 12KB
isp-serialflash-at91sam9xe512.bin 12KB
isp-serialflash-at91sam9g10.bin 12KB
isp-serialflash-at91sam9g45.bin 12KB
isp-serialflash-at91sam9261.bin 12KB
isp-serialflash-at91sam9263.bin 12KB
isp-serialflash-at91sam9g20.bin 12KB
isp-serialflash-at91sam9xe128.bin 12KB
isp-serialflash-at91sam9xe256.bin 12KB
isp-serialflash-at91cap9.bin 12KB
isp-serialflash-at91cap9.bin 12KB
isp-dataflash-at91sam9260.bin 11KB
isp-dataflash-at91sam7x256.bin 11KB
isp-dataflash-at91sam7x512.bin 11KB
isp-dataflash-at91sam9xe512.bin 11KB
isp-dataflash-at91sam7a3.bin 11KB
isp-dataflash-at91sam9g20.bin 11KB
isp-dataflash-at91sam9xe128.bin 11KB
isp-dataflash-at91sam9xe256.bin 11KB
isp-dataflash-at91cap9.bin 10KB
isp-dataflash-at91sam9m10.bin 10KB
isp-dataflash-at91sam7se512.bin 10KB
isp-dataflash-at91sam7se256.bin 10KB
isp-dataflash-at91cap9.bin 10KB
isp-dataflash-at91sam9rl64.bin 10KB
isp-dataflash-at91sam9g10.bin 10KB
isp-dataflash-at91cap9.bin 10KB
isp-dataflash-at91sam9g45.bin 10KB
isp-dataflash-at91sam9261.bin 10KB
isp-dataflash-at91sam9263.bin 10KB
isp-dataflash-at91sam7se32.bin 10KB
isp-eeprom-at91sam9m10.bin 9KB
isp-eeprom-at91sam9g45.bin 9KB
isp-eeprom-at91cap9.bin 9KB
isp-eeprom-at91sam9g10.bin 9KB
isp-eeprom-at91cap9.bin 9KB
isp-eeprom-at91sam9rl64.bin 9KB
isp-eeprom-at91cap9.bin 9KB
isp-eeprom-at91sam9g20.bin 9KB
isp-eeprom-at91sam9261.bin 9KB
isp-eeprom-at91sam9263.bin 9KB
isp-nandflash-at91sam7se32.bin 7KB
isp-norflash-at91sam7se32.bin 7KB
isp-serialflash-at91sam7x128.bin 6KB
isp-extram-at91sam9m10.bin 5KB
isp-extram-at91sam9g45.bin 5KB
isp-extram-at91cap9.bin 5KB
isp-extram-at91cap9.bin 5KB
isp-dataflash-at91sam7x128.bin 5KB
isp-extram-at91cap9.bin 5KB
isp-extram-at91sam7se512.bin 5KB
isp-extram-at91sam7se256.bin 5KB
isp-extram-at91sam9g10.bin 5KB
isp-extram-at91sam9261.bin 5KB
isp-extram-at91sam9xe512.bin 5KB
isp-extram-at91sam9263.bin 5KB
isp-extram-at91sam9xe128.bin 5KB
isp-extram-at91sam9xe256.bin 5KB
isp-extram-at91sam9g20.bin 5KB
共 1298 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13
资源评论
- 虾球xz2015-05-10不知道如何用
- mrdenglazy2014-02-20后来从官网上找到了,还是谢谢
yourmind
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功