PROGACMP User Manual
PROGACMP User Manual
PROGACMP
PEmicro                                 1
                                                                                  PROGACMP User Manual
1   OVERVIEW..................................................................................................... 1
    1.1       Supported Devices ......................................................................................... 1
    1.2       Programming Algorithms (.ARP Files) ........................................................... 2
    1.3       Start-Up Configuration.................................................................................... 2
    1.4       Manual Programming ..................................................................................... 2
    1.5       Scripted Programming.................................................................................... 3
    1.6       Hardware Interfaces ....................................................................................... 3
    1.7       Programming Utilities ..................................................................................... 3
2   PROGRAMMING ALGORITHMS ................................................................... 4
    2.1       Algorithm File Contents .................................................................................. 4
    2.2       Algorithm Timing Considerations ................................................................... 6
3   PROGRAMMING COMMANDS...................................................................... 7
    3.1       Listing of Commands...................................................................................... 8
    3.2       Legacy Commands ...................................................................................... 14
    3.3       Renesas ID Code Protection........................................................................ 15
4   START-UP CONFIGURATION..................................................................... 17
5   CONNECTION MANAGER........................................................................... 21
    5.1       Additional Settings........................................................................................ 23
    5.2       Connect and Choose Algorithm ................................................................... 25
    5.3       JTAG Daisy Chain........................................................................................ 25
    5.4       User Options ................................................................................................ 27
6   MANUAL PROGRAMMING .......................................................................... 33
    6.1       Manual Programming Procedure ................................................................. 33
7   SCRIPTED PROGRAMMING (CPROGACMP)............................................ 35
8   HARDWARE INTERFACES ......................................................................... 36
    8.1       Multilink and Multilink FX.............................................................................. 36
    8.2       Cyclone LC and Cyclone FX ........................................................................ 38
9   PROGRAMMING UTILITIES ........................................................................ 42
    9.1       Serialize........................................................................................................ 42
                                                                                                                                     ii
PROGACMP User Manual
iii
                                                          PROGACMP User Manual
1     OVERVIEW
      PROGACMP is PEmicro’s programming software for Flash/EEPROM modules that
      are attached toARM Cortex-M processors from NXP and many other manufacturers.
      PROGACMP talks to the processor's debug module using one of PEmicro’s
      compatible hardware interfaces. These interfaces connect a PC running Windows 7/8/
      10 to a debug connector on the target system. This connector provides access to the
      debug signals of the processor chip mounted on your target system hardware board.
      As part of the programming procedure, the user will need to select a programming
      algorithm that will enable the PROGACMP software to properly manage their specific
      target device during programming. The user may also choose to set certain
      programming parameters before beginning to program. This chapter presents a brief
      overview of the programming procedure.
                                                                                       1
                                                             PROGACMP User Manual
                                                                                            2
                                                            PROGACMP User Manual
      record file, you will be asked to select one. A list of programming commands and their
      functions may be found in CHAPTER 6 – MANUAL PROGRAMMING.
                                                                                             3
                                                               PROGACMP User Manual
2       PROGRAMMING ALGORITHMS
        PEmicro’s .ARP programming algorithm files define the functions necessary for
        PROGACMP to program an ARM Cortex-M processor’s internal flash or connected
        external Flash/EEPROM. After you choose the appropriate algorithm, it will appear in
        the Configuration Window.
2.1.1   Comments
        Comments are usually placed in the file to identify the target system for which the
        .ARP file was written and what module on the target system it programs, as well as
        other useful information. If a specific .ARP file is selected in PROGACMP, these
        comments are shown in the window at the bottom of the PC screen. Within the
        algorithm file a semicolon is used to designate the beginning of a comment.
                                                                                               4
                                                                PROGACMP User Manual
        Where:
            USER= is the keyword to identify the line
            uuuuuuuuuuuuuuuuuuuuuu is the 22 character string placed in the selection
            menu window on the PC screen. The first few characters define the menu select
            function and should be unique.
            N is a single numeric digit between 0 and 4. If it is zero, the program will not ask
            for a user parameter. If it is non-zero, the user will be asked for a parameter with
            N hexadecimal digits. This parameter will be passed to the corresponding user
            routine in RAM.
            pppppppppp is the 10 character prompt used to solicit the user input parameter.
            / is required for error checking.
            llllllll is an 8 hex character lower bound on the user parameter.
            uuuuuuuu is an 8 hex character upper bound on the user parameter.
2.1.4   S-Records
        Any line in the programming algorithm file starting with an "S" in column 1 is
        considered an S-record. S1, S2 and S3 records are allowed. S7, S8 and S9
        termination records are ignored. PROGACMP uses the address field on the first S
        record detected in the file as the starting address of target RAM. Each .ARP file in the
        library contains a programming algorithm for a particular device.
        The S records are loaded into on chip RAM on the ARM Cortex-M microcontroller and
        provide the functions necessary to carry out the functions specified. All other records
        are written to the screen when the .ARP file is selected for programming.
        PROGACMP programming algorithm files must have the DOS filename extension
                                                                                               5
                                                              PROGACMP User Manual
      ".ARP" in order for PROGACMP to find them. The files are in ASCII and are thus
      readable using most text editors. The S records for a .ARP file can be generated using
      most assemblers.
                                                                                             6
                                                          PROGACMP User Manual
3   PROGRAMMING COMMANDS
    When the user performs manual programming, commands are executed by selecting
    them from the Choose Programming Function Window pick list. The user may either
    use the up/down arrow keys or type the two-letter abbreviation for the command
    (listed below) on the command line to select a command. Pressing ENTER causes the
    selected command to execute. Commands can also be executed from the Menus or
    from the Button Bar. If there is any additional information needed in order to execute
    the command, the user will be prompted for this information in a new window. Errors
    caused by a command or any other responses will be presented in the Status Window.
    Below is a representation of a typical PROG Choose Programming Function Window,
    with commands organized by category.
                                                                                         7
                                                                PROGACMP User Manual
        Note:   At any given time, or for a particular module, some of the commands may not
                be active. Inactive commands are indicated as such in the Choose
                Programming Functions Window and will not execute.
                                                                                                  8
                                                                 PROGACMP User Manual
        indicates what kind of module it relates to. For example, the file
        Freescale_MK40X256_1x32x64k_PFlash.ARP specifies how to program the 256K
        PFlash block on a MK40X256 processor. Setup information and further descriptions of
        the module are provided in ASCII text within the module file. This information is
        presented in the status window when a .ARP file is selected. The user can also look at
        this information inside of the module itself by using any standard text editor to view the
        module contents.
        A particular .ARP file is selected by using the arrow keys to highlight the file name and
        then pressing ENTER. The currently selected .ARP file is shown in the .ARP file
        selected window. After a .ARP file is selected, the user is prompted for the base
        address of the module. This address is used as the beginning address for the module
        during programming and verification. Certain .ARP files, such as those for external
        flash algorithms, will prompt the user for the base address of the module.
                                                                                                 9
                                                               PROGACMP User Manual
       sector is already blank, the erase is skipped for that sector. Can offer better
       performance compared to Erase Entire Module for very large flash memories.
3.1.16 HE - Help
       Opens this PROGACMP user manual.
3.1.17 PA or FP - Partition
       Some devices will include one of these commands. Partitions the FlexNVM block for
                                                                                             10
                                                              PROGACMP User Manual
                                                                                               11
                                                            PROGACMP User Manual
       This command should be used with care to avoid mis-programming. Most users
       should use the QO command instead.
       Before programming, all queued data files are combined into a single data file. QO
       replaces the legacy SS command. The CQ command clears this queue. A more
       detailed description is available at:
       https://www.pemicro.com/blog/index.cfm?post_id=250
3.1.24 QU - Quit
       Terminates PROGACMP and returns to Windows.
                                                                                            12
                                                               PROGACMP User Manual
3.1.26 RELAYSOFF - Turn off the relays that provide power to the target
       (Multilink FX & Cyclone only)
       Includes a power down delay if specified. Especially useful for users who want to
       power cycle their board before running tests, allow their bootloader to run, or have the
       application code run after programming.
                                                                                             13
                                                               PROGACMP User Manual
This window stays on the screen until the user presses ESCAPE.
                                                                                             14
                                                                PROGACMP User Manual
        In addition, there is one function that is allowed to be unique to the module being
        programmed. The selection menu name and the length of up to one hexadecimal
        parameter may be specified in a supporting .ARP file.
                                                                                              15
                                                                PROGACMP User Manual
                                                                                              16
                                                           PROGACMP User Manual
4   START-UP CONFIGURATION
    The PROGACMP software may be started in a way that enables certain optional
    parameters, which can assist the programming process. To set these command-line
    parameters, highlight the Windows Icon for the PROGACMP executable, right-click,
    and select “Properties” from the pop-up File Menu. The “General” Properties tab
    should open by default. There are several parameters that you may then include on
    the command line. A description of each is listed below, followed by specific examples
    of how these parameters are used.
    Syntax:
                PROGACMP [bdm_speed n] [reset_delay][interface=x]
                        [port=y]
    Where:
    Optional parameters are in brackets [ ]. The parameters are described as follows:
                                                                                          14
                                    PROGACMP User Manual
           TRACELINK
           OpenSDA
[port=y]   Where the value of y is one of the following (see the
           showports command-line parameter for a list of
           connected hardware; always specify the "interface" type
           as well):
                                                                  15
                                                          PROGACMP User Manual
requirement).
                                             Examples:
                                             INTERFACE=CYCLONE
                                             PORT=MyCyclone99
    INTERFACE=CYCLONE "PORT=Joe's Max"
                               UNIQUEID USB Multilink products all have a unique
                                        serial number assigned to them, such as
                                        PE5650030. The Multilink may be referred
                                        to this number. This is useful in the case
                                        where multiple units are connected to the
                                        same PC.
                                             Examples:
                                             INTERFACE=USBMULTILINK
                                             PORT=PE5650030
Example
CPROGACMP C:\ENGINE.CFG Interface=USBMULTILINK Port=USB1
                                                                                       16
                                                      PROGACMP User Manual
Example
CPROGACMP C:\ENGINE.CFG Interface=CYCLONE Port=209.61.110.251
Example 3
CPROGACMP C:\ENGINE.CFG Interface=USBMULTILINK Port=USB1 bdm_speed 0
                                                                                     17
                                                          PROGACMP User Manual
5   CONNECTION MANAGER
    Before programming your device, you will need to connect to your target using a
    compatible PEmicro hardware interface. Interface options for PROGACMP are
    discussed in Section 8 - HARDWARE INTERFACES
    Once you have physically connected your PC to your target using the hardware
    interface, and the appropriate drivers are installed, the following Connection Manager
    dialog will appear:
    The Connection Manger allows you to choose the interface that you wish to use and
    configure the connection.
                                                                                        16
                                                         PROGACMP User Manual
Use the Interface drop-down menu to choose the type of interface that you plan to
use.
Then select the interface from those available, which are listed in the Port drop-down
list. The Refresh List button to the right may be used to update the list of available
interfaces:
Click on Select New Device to open the Device Selection Dialog. Drill down the device
tree to select your device. Optionally, you may right-click to copy the device string text
for your device (e.g., when creating a CPROG script).
                                                                                       17
                                                         PROGACMP User Manual
                                                                                  18
                                                               PROGACMP User Manual
                                                                                            19
                                                             PROGACMP User Manual
With the appropriate algorithm selected, you are ready to begin programming.
                                                                                           20
                                                      PROGACMP User Manual
Afterwards, the daisy chain settings are configured by clicking on the "Advanced"
button in the Connection Manager. A new dialog will appear, allowing the user to
specify their exact daisy chain setup.
As an example, consider a daisy chain containing two devices (TAP #0 and TAP #1)
and both devices have a 4-bit JTAG IR. The following settings would access the first
device in the chain (TAP #0):
                                                                                    21
                                                                PROGACMP User Manual
        To access the second, and last device in the chain (TAP #1), use the following
        settings:
        For more information about how to daisy chain MCUs with PEmicro’s Multilink and
        Cyclone interfaces, see:
        http://www.pemicro.com/blog/index.cfm?post_id=136
                                                                                              22
                                                       PROGACMP User Manual
a. If "Create File" is selected, a new window will open, in which the names of existing
user area(s) and included options are displayed. In interactive PROGACMP only, the
current value of each option will also be displayed. For each user option, the
developer will have the ability to either "Write [a new] Value" or "Leave [the option]
Unmodified." New values must be written in hexadecimal format.
                                                                                     23
                                                        PROGACMP User Manual
Once all new values have been written in their appropriate fields, the developer can
save them to a new user options (.OPT) file.
b. If "Modify File" is selected, the user can choose an existing .OPT file to modify.
                                                                                        24
                                                          PROGACMP User Manual
The values specified in that file will be displayed in their appropriate fields.
                                                                                   25
                                                               PROGACMP User Manual
        At this point, the developer can choose to modify any contents of the file. The
        developer can either overwrite the selected file, or save the modified contents to a
        new filename, leaving the selected file as it was before.
        Once a user options (.OPT) file has been created/saved, it can be used to program
        the device's user options by using the Specify User Options File (SU) and Program
        User Options (PU) commands.
                                                                                               26
                                                               PROGACMP User Manual
                                                                                              27
                                                               PROGACMP User Manual
6     MANUAL PROGRAMMING
      The Choose Programming Function Window (see Figure 3-1) lists commands that are
      available to execute. Any of the programmer’s enabled features can be selected using
      the mouse, the up and down arrow keys, or by typing the two-letter command
      abbreviations that appear to the left of the list of programming functions into the Status
      Window. The Status Window also displays any error messages that might result from
      the commands that you perform.
      Pressing ENTER or double clicking the mouse in the Choose Programming Function
      Window will execute the highlighted entry if it is enabled. The user will be prompted
      for any additional information that is required to execute the selected function. Before
      you can program a module from an S record file, you must select such a file. If you try
      to execute a program module function and you have not selected a file, you will be
      asked to select one.
                                                                                             20
                                              PROGACMP User Manual
4. a) Use the "EM" (Erase Module) command to erase the module at that
   location. The process of erasing the module will vary according to the
   size of the flash, but should take no longer than 30 seconds. If this proce-
   dure seems to be taking much longer than 30 seconds, then the computer
   is probably not getting a proper response from the board. If this is the
   case:
   b) Check the jumper setting on your target board, as well as the
   programming voltage.
5. Some programming algorithms have a special command, such as "BE,"
   for block erase. If you are unable to double-click the "EM" (Erase Module)
   command, try using the "BE" (Block Erase) command. Some commands
   are hidden and you may need to use the scroll bar to scroll down to these
   commands.
6. You may check to see whether or not the module has been erased by
   double-clicking the "BM" command (Blank Check Module). If the flash is
   not properly erased then this command will give you an error message.
   You may also check the contents of the memory locations by double-click-
   ing the "SM" (Show Module) command. If the flash has been erased
   properly then all the memory locations will display "FF".
7. Now use the "SS" command (Specify S Record) to load the object file
   (.S19), which you should have generated previously by using a compiler
   or an assembler. This command will ask for the name of the .S19 file.
8. Now you ready to program the flash. Double click the "PM" command
   (Program Module) to begin the programming process.
9. In order to check the results, use the "SM" command (Show Module) with
   the appropriate base address to view the contents of the flash. You should
   see that the flash has been correctly programmed. You may also double-
   click the “VM” command (Verify Module) to verify that all the bytes of the
   flash are correctly programmed.
                                                                            21
                                                          PROGACMP User Manual
                                                                                       22
                                                           PROGACMP User Manual
8     HARDWARE INTERFACES
      PEmicro’s Multilink & Multilink FX debug probes and Cyclone LC & Cyclone FX
      production programmers are compatible hardware interfaces for use with
      PROGACMP. The Multilink and Multilink FX are development tools that communicate
      via USB and will enable you to debug your code and program it onto your target. The
      Cyclone LC & Cyclone FX are more versatile and robust development tools that
      communicate via Ethernet, USB, or Serial Port, and include advanced features and
      production programming capabilities, as well as Ethernet support.
      Below is a review of their features and intended usage.
PEmicro                                                                                  25
                                                              PROGACMP User Manual
PEmicro                                                                                     26
                                                              PROGACMP User Manual
Multilink Universal enables you to debug, program, and test your code on your board.
8.1.3   Software
        Multilink debug probes work with NXP’s MCUXpresso, Kinetis and S32 Design
        Studios, Codewarrior, as well as PEmicro’s flash programmer, PROGACMP.
PEmicro                                                                                       27
                                   PROGACMP User Manual
PEmicro                                                   28
                                                             PROGACMP User Manual
PEmicro                                                                                   29
                                                             PROGACMP User Manual
8.2.4   Software
        The Cyclone LC and Cyclone FX come with intuitive configuration software and
        interactive programming software, as well as easy to use automated control software
        call. These Cyclones also function as full-featured debug interfaces, and are
        supported by software from PEmicro and third-party vendors.
PEmicro                                                                                    30
                                                               PROGACMP User Manual
9     PROGRAMMING UTILITIES
      The following no-cost programming utilities are available on PEmicro’s website.
      www.pemicro.com, by navigating to Support -> Documentation & Downloads ->
      Utilities.
9.1   Serialize
      The Serialize utility allows the generation of a .SER serial number description file. This
      graphical utility sets up a serial number which will count according to the bounds set
      by the user. The .SER file can be called by the PROG flash programmer to program a
      serial number into the target.
      More information on how to use the Serialize utility can be found on PEmicro’s
      website at: www.pemicro.com/newsletter/experts_corner/2005_08_17/serialize.cfm.
                                                                                             25
                                                             PROGACMP User Manual
    REQUIRES_PROG_VERSION=x.xx/
          Sometimes algorithms will require features to be built into the PEmicro flash
          programmer itself. If the algorithm requires a minimum version number of the
          programmer, use this command. The interactive programmer will give the user a
          warning if the programmer version is not greater than or equal to the version
          referenced in this command. The commandline programmer will halt with error
          14.
    NO_ON_CHIP_RAM
          This command has 14 characters and tells the programmer not to perform any
          action to turn on the on chip ram. You must provide RAM to run the calibration
          routines and load your .ARP file S records. If not deactivated by this command,
          the on chip RAM is turned on after all other setup commands are executed. On
          chip RAM is automatically enabled in most processor in order to load the
          programming algorithm. If your processor has on chip ram and it is turned on
          automatically, use this command without any writes to chip select. If your
          processor has no on_chip RAM, use this command and follow it with either
          WRITE_BYTE, WRITE_WORD or WRITE_LONG in order to turn on chip selects
          to enable external RAM. The RAM should be turned on at the location where the
          S records in the .CFP file start.
    NO_TIMING_TEST
      This command has 14 characters and tells the programmer not to evaluate the target
      processor speed during the initialization process. Instead, both timing constants are
      set to 1. This option is only used when programming timing functions are not needed.
    WRITE_LONG=llllllll/aaaaaaaa/
      This command has 29 characters. It writes the hex long llllllll to the hex address
      aaaaaaaa in the current space. This command is most often used to enable the chip
PEmicro                                                                                    43
PROGACMP User Manual
      selects to allow the CPU to see the flash at address 0. By default the debugger
      assumes the flash is on CSBOOT. You may also do all sorts of system configuration
      with these command.
     WRITE_WORD=wwww/aaaaaaaa/
      This command has 25 characters. It writes the hex word wwww to the hex address
      aaaaaaaa in the current space. This command is most often used to enable the chip
      selects to allow the CPU to see the flash at address 0. By default the debugger
      assumes the flash is on CSBOOT. You may also do all sorts of system configuration
      with these command.
     WRITE_BYTE=bb/aaaaaaaa/
      This command has 23 characters. It writes the hex byte bb to the hex address
      aaaaaaaa in the current space. This command is most often used to enable the chip
      selects to allow the CPU to see the flash at address 0. By default the debugger
      assumes the flash is on CSBOOT. You may also do all sorts of system configuration
      with these command.
     BOUNDARY_MASK=mmmmmmmm/
      This command has 23 characters. It indicates to the programmer that when buffering
      data down to the target, the data may not cross certain boundaries. If a value of
      $FFFFFF80 was used, this would indicate to the programmer that only 128 byte
      sections may be programming at once (aligned on 128-byte boundaries). This does
      not mean that the whole 128 bytes need to be programmed, only that the flash
      programmer will split the data up to be programmed in chunks which never cross a
      certain boundary. This is very useful for paged memory, or to adhere to block
      programming requirements of certain motorola flash.
     BLOCKING_MASK=mmmmmmmm/
      This command has 23 characters. First it tells the programmer that only full blocks of
      data can be programmed into the device and that blocks must occur on a block
      boundary. The mask mmmmmmmm is used to select those address lines which occur
      within a block. For example, blocks of 8 bytes would have a mask of 00000007. The
      buffer provided in the target must in size be an integral multiple of the blocking size in
      bytes.
     BLANK_MODULE_ONLY
      This command has 17 characters. It indicates to the programmer that if a blank byte
44                                                                                     PEmicro
                                                           PROGACMP User Manual
      address or blank word address is provided they can only be used to enable a blank
      module command.
    NO_BASE_ADDRESS
          or
    NO_BASE_ADDRESS=bbbbbbbb/
      The 15 character command version tells the prog software to use a base address of 0
      and not to ask the user to enter one. The 25 character version is the same except it
      sets the base address to bbbbbbbb.
    ADDR_RANGE=aaaaaaaa/bbbbbbbb/
      Normally the valid flash range is set by the module_length constant in the algorithm
      which the programmer then uses to decide how to display memory in the code
      window. If not all memory between module_address and
      module_address+module_length is valid, this command can be used to override the
      default functionality and describe to the programmer what is valid memory which
      should be displayed and changed. Note that these addresses are relative to the base
      address of the flash. aaaaaaaa is the start address relative to the base address and
      bbbbbbbb is the end address relative to the base address.
PEmicro                                                                                   45
PROGACMP User Manual
     Users who wish to make significant modifications to a programming algorithm may need
     to modify the table entries in their assembly (.ASM ) file. Table entries provide information
     to the PROG software, including what functions are in the algorithm and where they are
     located. Each table entry consists of 32 bits and must be in the following order:
         Stack Address
             Address of the stack during routine execution. The stack is initialized each time
             one of the user-supplied routines is called.
         Buffer Address
             Address of the buffer used to transfer data from the PC to the target. This is data
             to be placed into the module.
         Buffer Length
             Length of available buffer space in bytes. The buffer should be at least 4,096
             bytes long in order to accommodate the largest possible S record.
         Module Address
             The physical address of the beginning of the module to be programmed or
             erased.
         Module Length
             Length of the module to be programmed in bytes.
         Blank Bytes Address
             The address of a routine to check a block of bytes to see if they are erased. R1
             contains the starting address and R2 contains the number of bytes to check.
             Checking is done on a byte by byte basis. If R2<>0 on return then an error
             occurred at word address R1-1. R2 = 0.
         Blank Words Address
             The address of a routine to check a block of words to see if they are erased. R1
             contains the starting address and R2 contains the number of bytes to check.
             Checking is done on a word by word basis. If R2<>0 on return then an error
             occurred at word address R1-2.R2 = 0.
         Erase Bytes Address
             The address of a routine to erase a block of bytes. R1 contains the starting
             address and R2 contains the number of bytes to erase. Erasing is done on a byte
46                                                                                       PEmicro
                                                            PROGACMP User Manual
          by byte basis. R2 = 0.
      Erase Long Address
          The address of a routine to erase a block of longs. R1 contains the starting
          address and R2 contains the number of bytes to erase. Erasing is done on a word
          by word basis. If R2<>0 on return an erase error occurred. R2 = 0.
PEmicro                                                                                   47
PROGACMP User Manual
         address to be read.
      After Read Address
         The address of a routine which takes the module out of read mode.
      User Function Address
         This is an optional user function. It is created with a USER = statement in the
         .ARP file and a corresponding address as an extra address in the table. On entry,
         R2 is the module length, R1 is the module address, R4 is the user parameter if
         any, and R3 is the buffer address. If on return R2<>0 an error occurred.
48 PEmicro