SAM7 Flash Programming Solutions

Document Sample
SAM7 Flash Programming Solutions Powered By Docstoc
					                   - AT91SAM7S Training




SAM7 Flash Programming Solutions




 Patrick FILIPPI
 Frederic BOYER

 AT91 Support Group.
 Version 1.4 October 2006
           - AT91SAM7S Training




• Introduction

  - Flash Programming Terms, Definitions and Glossary


• Flash Programming During Debug Phase

  - with ATMEL Evaluation Boards
  - with Customer Board


• Flash Programming During Production Phase

  - for Small Volume Programming (Manual Programming)
  - for Medium and High Volume Programming (Automated/Gang
  Programming)



                                                             2
                              ARM-Based Products Group
      - AT91SAM7S Training



                 Introduction




Flash Programming Terms, Definitions and Glossary




                                                    3
                       ARM-Based Products Group
            - AT91SAM7S Training



 Flash Programming Terms and Definitions
ISP vs. IAP:

   • ISP (In-System Programming)
        Applicable to programmable logic and Non-Volatile Memory
      (NVM).
       MCU is off-line and/or not involved while memory is being
      programmed.
       For Manufacturing (Blank Flash Memory)

   • IAP (In-Application (re)-Programming)
       Applicable to programmable logic and Non-Volatile Memory
      (NVM).
       MCU is on-line and participates in programming the memory.
       For Field Updates (Firmware upgrade)

The term In-System Programming (ISP) is used in a general sense by the
industry.
                                                                     4
                                ARM-Based Products Group
            - AT91SAM7S Training



  Flash Programming Terms and Definitions

• Engineering Programmers:
    Memory, PLD or MCU Programming Tool for Design Engineering.
    One device programmed at a time.




• Concurrent Programming Systems:
    Same as above but low to mid-volume production.
    Up to 6 Devices programmed at the same time.




• Automated/Gang Programming Systems:
    Same as above but for mid-volume to High-volume programming.
    Up to 5000 devices per hour

                                                                    5
                               ARM-Based Products Group
          - AT91SAM7S Training



                          Glossary


• JTAG (1) = Joint Test Action Group
• TAP = Test Access Port (JTAG Port)
• ICE (1) = In-circuit Emulator
• ATE = Automatic Test Equipment (Like Agilent 3070 Tester)
• BSDL = Boundary-Scan Description Language
• OBP = On-Board-Programming
• OFBP = Off-Board-Programming


(1):JTAG/ICE   IEEE Std 1149.1-2001 Standard




                                                              6
                             ARM-Based Products Group
      - AT91SAM7S Training



Flash Programming During Debug Phase...



     With ATMEL
  Evaluation Boards


                        &

                                    With Customer
                                       Boards



                                                    7
                       ARM-Based Products Group
                     - AT91SAM7S Training



               Debug Phase - Environment Setup
         Development Tool with Flash Downloader + ICE Interface
                                                                     Power
                                                                     Supply
                                                                                       JTAG/ICE
                                                                     Or USB              port
          Host PC +                                                   Cable
       Compiler/linker(1)
        + Debugger(1)                             ICE Interface(1)




                                                             From ICE Interface to
                            From PC to ICE Interface                Target
                                      • USB,               • Standard 20-pins ARM
                                    • RS-232,                     Connector
                                • Parallel Cable,                                    AT91SAM7-EK
                                   • Ethernet                                        or Customer’s
                                                                                         Board
(1):   See the AT91 Third Party Guide for Development Tools Supported by AT91 Processors.
                                                                                          8
                                             ARM-Based Products Group
          - AT91SAM7S Training



      Debug Phase – Development Tools

Most of today’s Development Tools like, IAR, KEIL and
others, integrate their own Flash Programming Tools.
The Flash Tool is started like any other function by one
“Download and Run” Button.

  This is the simplest way to flash your application during
                       debug phase !

Advantages:
- Fast Programming: the Processor is running at Full Speed !
- All AT91SAM7 MCU supported. Updates maintained via
patches from Tool Vendors.

Inconvenient:
- None.

                                                              9
                           ARM-Based Products Group
           - AT91SAM7S Training


                 Debug Phase - SAM-BA
                                                TM




SAM-BA allows on-board memory programming through USB,
DBGU (UART) or JTAG.
                                                AT91SAM7-EK or Customer’s Board*
                                  JTAG



                                     DBGU


        SAM-BA
                                     USB




SAM-BA may be needed in case of a problem of JTAG/ICE
connection between the
Development Tools and the ICE Interface or no ICE interface
available for debug.

For the AT91SAM7 Series, SAM-BA is best as Demo Downloader.

*: For Customer Boards Design, See SAM-BA Hardware Constraints
                            ARM-Based Products Group
                                                             10
           - AT91SAM7S Training


             Debug Phase - SAM-PROG
SAM-PROG allows flash programming through USB or JTAG.

Major Features:
                                                                     1


 - File selector or Drag-n-Drop,     1


                                                            2
 - I/O pin selection for user feedback
   after programming 2
                                                        6
 - User Feedback and Status    3                                             4

    -Flash Programming Report,
    -Number of connected boards                         3
                                                                         5




 - Auto Mode for Drag-n-Program          5




 - Security Bit set after programming        6

                         4
 - JTAG Support Mode         ARM-Based Products Group
                                                                11
          - AT91SAM7S Training



               AT91 ISP Generation

Provides an open set of tools for programming the AT91SAM7
and AT91SAM9 ARM®-based microcontrollers.

Our ISP solution is not anymore based on only 2 applications
(SAM-BA and SAM-PROG).
It should be considered as an ISP framework.




                                                           12
                           ARM-Based Products Group
                   - AT91SAM7S Training



                        AT91-ISP Framework
                                                                                        Provided by RFO (binary)
                                                                                        Provided by RFO (sources)
     SAM-PROG
                              COM OLE Interface                                         Provided by NTO
   “SAM-BA GUI”                                                                         Provided by IXXAT
                                                                                        Provided by PEAK
     SAM-TCL                                             Public API
                                                                                        Provided by SEGGER
                                                        At91Boot_DLL.dll
    Customer ISP




                     Atcanpeak.dl       Atcanixxat.dl   Atm6124.sys        Segger.dll     Driver
                          l                   l

                      CanApi2.dll       Vci11un6.dll                        JLINK/
                                                                           SAM-ICE
                                                           USB                            COM


Shared with NTO                     Driver                                  JTAG


                                     CAN

                                                                                                   13
                                             ARM-Based Products Group
             - AT91SAM7S Training



                    AT91 ISP Solution

ISP solution is based on a central DLL: AT91Boot_DLL.dll
•   Offers a simple public API to build custom GUI
•   Hides communication link complexity (USB, CAN, DBGU, or JTAG)
•   Integrates memory programmation algorithms


Our ISP Solution also integrates:
•   Documentation (AT91-ISP User guide)
•   Some Examples (TCL script and Visual C++ projects)
•   Command line application available using a TCL shell
    (AT91Boot_TCL.dll)
•   SAM-PROG is now based on AT91Boot_DLL.dll
    (algorithms are now in the AT91Boot_DLL.dll)
•   SAM-BA (v2.0 and later versions) is now based on AT91Boot_DLL.dll




                                                                    14
                               ARM-Based Products Group
            - AT91SAM7S Training



                  ISP Package Install
• AT91_ISP.exe install program
     - Library directory includes all necessary DLLs
     - Documentation
     - Examples
     - SAM-BA Application
     - SAM-PROG Application
     - SAM-BA Boot4CAN binaries (SAM7A3 and SAM7X)

• Optional: Install TCL Toolchain (includes tclsh shell)
               www.activestate.com/Products/ActiveTcl/

• SAM-ICE software update needed to have the latest DLLs and
SAM-ICE firmware (See corresponding FAQ on ATMEL website).
                     www.segger.com/at91.html

Update SAM-ICE firmware and replace JLinkARM.dll in Library
directory
                                                           15
                              ARM-Based Products Group
           - AT91SAM7S Training


               Communication Links
  •   JTAG : Jlink and SAM-ICE

  •   Supported CAN Dongles
          -   PCAN-USB Peak dongle
          -   USB-to-CAN compact IXXAT dongle

                                    USB
                     AT91Boot_DLL

                                                                             SAM-BA Boot
                                    SERIAL (DBGU)
                          DLL



                                    USB                        JTAG

                                                SAM-ICE or J-Link
                                                               CAN
                                                                      SAM-BA Boot4CAN *
                                                  PC CAN adapter


* SAM-BA Boot4CAN is the dedicated CAN port of SAM-BA Boot              16
                                    ARM-Based Products Group
           - AT91SAM7S Training



             AT91Boot_DLL Principle


The AT91Boot_DLL principle is simple. It consists of:

1.Scanning all devices connected to the PC
2.Opening communication to the selected device
3.Performing all desired actions such as writing into Flash
  memory
4.Closing communication




                                                              17
                            ARM-Based Products Group
           - AT91SAM7S Training


 AT91ISP: Build your own Flash Production
            Programming GUI
     Free and fully documented AT91-ISP Toolbox
      (AT91Boot_DLL.dll)
         Offers a simple public API to build custom Flash programming GUI
         Hides communication link complexity (USB, UART, JTAG, CAN… )
         Integrates memory programming algorithms
                                      USB
                       AT91-ISP DLL


                                                                             SAM-BA Boot
                                      SERIAL (DBGU)

                                      USB                 JTAG

                                             SAM-ICE or J-Link
                                                           CAN
                                                                     SAM-BA Boot4CAN       *
                                               PC CAN adapter


                           ARM-Based CAN Group
* SAM-BA Boot4CAN is the dedicated Productsport of SAM-BA Boot           18
     - AT91SAM7S Training



Flash Programming During Production
              Phase




  Small, Medium and High Volume Programming




                                                 19
                      ARM-Based Products Group
           - AT91SAM7S Training



                       Introduction

       How to choose between Manual and Automated
                      Programming?
                     (Data I/O Source)

by calculating the total cost of programming...

by adding the cost of:
- direct labor,
- direct materials,
- scrap/repair materials,
- capital expense equipment,
- indirect labor costs for automated programming versus manual
programming,

…and comparing the two scenarios.

                                                                 20
                              ARM-Based Products Group
           - AT91SAM7S Training


        Small Production Flash Programming
               (Manual Programming)

• Engineering Programmers:
     Memory, PLD or MCU Programming Tool for Design
    Engineering.
     One device programmed at a time.


• Concurrent Programming Systems:
     Same as above but low to mid-volume production.
     Up to 6 Devices programmed at the same time.


All these Programming Systems use the Parallel Mode of Fast Flash
Programming Interface (FFPI).


See Appendix A for Programming Vendor Tools vs. Supported Devices
                                                                21
                             ARM-Based Products Group
            - AT91SAM7S Training


  Medium & High Production Flash Programming
                 (Automated)
When Medium and High Volume (1000 dev/hr) Flash Programming is
required, the cost efficient solution is to use Automated Programming
Methods.
Automated Programming can be split into two categories:

1) On-Board Flash Programming:
   Automated Test Equipment (Agilent 3070
   Tester)




                   2) Off-Board Flash Programming:
                       Automated High-Volume Gang Programmer
                      (BPMicro 4710)
                                                                        22
                                ARM-Based Products Group
             - AT91SAM7S Training


  Medium & High Production Flash Programming
                 (Automated)

                       On-Board Programming

On-board Programming can be achieved via the Fast Flash Programming
Interface (FFPI).

Depending on the structure of the PCB, i.e. density, size, Mixed SMD*/
Thru Hole Devices, and mainly test method/equipment of the manufactured
PCB, serial or parallel access of the FFPI will be used.

 • FFPI Serial Access via the JTAG/ICE Port (5 pins).

    Small and High Density PCB (ex. Mobile Phone) where PCB access points
   for bed-of-nails test equipments is not possible.

 • FFPI Parallel Access via dedicated PIO pins (8 to 16 bit data bus + 11
 control pins)

    PCB access points for bed-of-nails test equipments is possible,
    On-board FGPA for programming the AT91

* SMD: Surface Mounted Device      ARM-Based Products Group
                                                                            23
             - AT91SAM7S Training


   Medium & High Production Flash Programming
                  (Automated)

                      Off-Board Programming

Off-board Programming is done on Automated High-Volume Gang
Programmers like the BPMicro 4710 Programming Station.
The BPMicro 4710 can handle up to 1200 devices per hour.

All programming tool vendors use the Parallel Mode of the Fast Flash
Programming Interface (FFPI).

Some distributors have programming centers equipped with
Concurrent and Automated

 High-volume Gang Programmers and offer programming
solutions to customers for little extra fees per devices
programmed.
                                                 BPMicro 4710 Programming Station

                                                                               24
                                 ARM-Based Products Group
            - AT91SAM7S Training



        AT91SAM7A3 Flash Programming


The AT91SAM7A3 has JTAG/ICE capability for On-board
Programming.
This is not like the other SAM7 Series (FFPI Serial).

A flash downloader must be pre-loaded into the internal SRAM,
which then will program the flash memory.

  Via any development tools like IAR kick Start (Free version)

  Via J-Flash (JTAG FLash Programmer) from Segger
  http://www.segger.com/jlink_flash.html

  Via SAM-PROG (JTAG)


                                                                  25
                              ARM-Based Products Group
    - AT91SAM7S Training




             Appendix A

Programming Vendor Tools List
             vs.
      Supported Devices
                  - AT91SAM7S Training




                                     http://www.bpmicro.com



                                            Supported AT91SAM7 P/N
     Type          Equipment
                   supporting                                                                    Max speed
      Of                                                                     Number of Sockets
                                 S32   S64      S128    S256   X128   X256                       (devices/h)
    Products         AT91

                   4710 / 4700                               *     *            44               -
   Auto Gang
  Programmer          4600                                   *     *            11              1200
 (Automated Hi-
    Volume)
                   3710 / 3700                               *     *            16               -

                      3600                                   *     *            4               700


Gang Programmer
                   2710 / 2700                               *     *            24                -

                      2600                                   *     *            6                 -

  Engineering      1700 / 1710                               *     *            1                 -
  Programmer          1600                                   *     *            1                 -




                                        : Supported * : Not yet Supported
                                                                                                               27
                                                ARM-Based Products Group
                     - AT91SAM7S Training




                                          http://www.dataio.com



                                                Supported AT91 P/N
   Type of       Equipment                                                        Number of     Max speed
 Products     supporting AT91   S32   S64     S128     S256   X128   X256         Sockets     (devices/h)


  Auto Gang
Programmer
                  PS288FC       *                           *      *              16             -


                   PS300        *                           *      *              16             -

                 PS Infinity    *                           *      *              -           5000
    Gang          Multisyte
Programmer        Flash         *     *        *        *      *      *              32            -

                 Flash PAK      *                           *      *                  -         -




                                             : Supported * : Not yet Supported
                                                                                                        28
                                                     ARM-Based Products Group
              - AT91SAM7S Training




                           http://www.sg.com.tw/index_E.asp



              Equipment                  Supported AT91 P/N
 Type of                                                                 Number of   Max speed
              supporting
 Products                   S32   S64   S128   S256    X128   X256        Sockets    (devices/h)
                AT91

 Auto Gang
Programmer
               AP600        *     *      *      *       *      *          36 (4)         -

   Gang
Programmer
                T9600            *                   *      *          24 (1)         -

Engineering
Programmer
              Power Lab     *     *                   *      *            1            -




                                    : Supported * : Not yet Supported
                                                                                              29
                                          ARM-Based Products Group
                   - AT91SAM7S Training




                                                  http://www.xeltek.com




                                             Supported AT91SAM7 P/N
   Type of        Equipment                                                          Number      Max speed
 Products     supporting AT91   S32   S321   S64     S128    S256     X128   X256 of Sockets   (devices/h)

  Auto Gang       Superpro
                                                                                 1           -
Programmer        3000U




                                         : Supported * : Not yet Supported
                                                                                                        30
                                              ARM-Based Products Group
                  - AT91SAM7S Training




              http://www.hilosystems.com.tw/


                                                                                               Max
                                         Supported AT91SAM7 P/N                              speed
               Equipment
    Type of   supporting                                                           Number    (devices/h
  Products      AT91       S32   S321    S64    S128     S256     X128   X256   of Sockets       )
  Auto Gang     AT3-300                                                              32         1000
Programmer                 *     *        *       *        *       *      *
     Gang      ALL-100                                                               8           -
Programmer       G4
                                *                              *      *
                 ALL-                                                                8           -
             GANG-08P2     *     *        *       *        *       *      *
 Engineering   ALL-100                                                               1           -
Programmer
                                *                              *      *
               ALL-11P3                                                              1           -
                                *                              *      *
               ALL-11C2                                                              1           -
                                *                              *      *




                                      : Supported * : Not yet Supported
                                                                                                     31
                                           ARM-Based Products Group