APPLICATION NOTE 6973

How to Load Application Files to Maxim’s Arm Cortex-M4 Microcontrollers


Abstract:

This document describes how to load an application file to one of the Maxim® Arm® Cortex® microcontrollers over Serial Wire Debug (SWD) or JTAG without using an IDE. The document also covers the minimum set of tools to be installed.


Introduction

After development is complete on a firmware project, the next logical step is to deploy the application onto multiple devices. Using an IDE to build the application from source code each time a device is loaded wastes time and is unnecessary. Device loading only requires the binary to load and a few simple tools. This application note discusses the minimum set of required tools and the steps to use them.

Installing the Tools

The Maxim Low-Power Arm Micro Toolchain contains the tools necessary to work with the Maxim line of Arm Cortex-M4 processors. Begin the installation process by downloading the ARMCortexToolchain.exe file for Windows® or ARMCortexToolchain.dmg for Mac OS®. Not all the components of the toolchain are necessary when only loading the application files.

Perform the following the steps to install the required set of tools:

  1. Launch the downloaded ARMCortexToolchain application file.
  2. Click on Next.

    Welcome screenFigure 1. Welcome screen

  3. Select the desired installation path and click Next.

    Installation folder selectionFigure 2. Installation folder selection

  4. Only select the following components:

    1. Olimex USB Adapter Drivers
    2. Minimalist GNU for Windows
    3. Open On-Chip Debugger
    4. The Toolchain package for any of the Maxim microcontrollers you are using
    5. The minimum set of componentsFigure 3. The minimum set of components

  5. Accept the license agreement that appears by clicking on the I accept the license. radio button and clicking Next.

  6. License agreementFigure 4. License agreement

  7. Select the Start Menu in which to install the program's shortcuts and click Next.
  8. Shortcut locationFigure 5. Shortcut location

  9. Click Install
  10. Installation confirmationFigure 6. Installation confirmation

  11. As the installation runs, when prompted, click Install to install the device software. This message appears multiple times.
  12. Device drivers promptFigure 7. Device drivers prompt

  13. When the installation is complete, click Finish to dismiss the application.
  14. Installation is completeFigure 8. Installation is complete

Connecting the Hardware

When the toolchain installation completes and you are ready to load code onto a Maxim microcontroller, connect the device to the computer as shown in Figure 9. Also ensure that the microcontroller board is powered.

Device connectionsFigure 9. Device connections

Loading the Application File

One of the items installed with the toolchain is OpenOCD, an open-source project used to connect microcontrollers to computers for debugging purposes. To begin using OpenOCD, launch a command prompt window and change the directory to the location containing the application files you want to load. Load the file by running the following command line:

[install_path]\Toolchain\bin\openocd -s
[install_path]\Toolchain\share\openocd\scripts -f interface\[adapter].cfg -f target\[device].cfg -c "program [elf_file] verify exit"

Replace the parameters in [brackets] to match your configuration.

  • [install_path]: The path where you installed the toolchain. The default installation path is C:\Maxim.
  • [adapter]: The JTAG or SWD adapter connected to your board. Table 2 lists the three supported adapter types and the [adapter] parameter to use.
  • Adapter Type Value
    Olimex ARM-USB-OCD-H ftdi\olimex-arm-usb-ocd-h
    Olimex ARM-USB-TINY-H ftdi\olimex-arm-usb-tiny-h
    Generic CMSIS-DAP cmsis-dap
  • [device]: The part number of the device you are programming.
  • [elf_file]: The name of the file you are programming.

Figure 10 shows an example of loading a hello.elf file to the MAX32660 using a CMSIS-DAP SWD adapter.

Example load of the MAX32660Figure 10. Example load of the MAX32660