How to Load Application Files to Maxim’s Arm Cortex-M4 Microcontrollers
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.
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:
- Launch the downloaded ARMCortexToolchain application file.
- Click on Next.
Figure 1. Welcome screen
Select the desired installation path and click Next.
Figure 2. Installation folder selection
Only select the following components:
- Olimex USB Adapter Drivers
- Minimalist GNU for Windows
- Open On-Chip Debugger
- The Toolchain package for any of the Maxim microcontrollers you are using
Figure 3. The minimum set of components
Accept the license agreement that appears by clicking on the I accept the license. radio button and clicking Next.
- Select the Start Menu in which to install the program's shortcuts and click Next.
- Click Install
- As the installation runs, when prompted, click Install to install the device software. This message appears multiple times.
- When the installation is complete, click Finish to dismiss the application.
Figure 4. License agreement
Figure 5. Shortcut location
Figure 6. Installation confirmation
Figure 7. Device drivers prompt
Figure 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.
Figure 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\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.
- [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.
Figure 10. Example load of the MAX32660