关键词: SDK, OpenOCD, load, loading, programming, ELF, command line, JTAG, SWD, serial wire debug, Arm, Cortex, Cortex-M4
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.
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:
Figure 1. Welcome screen
Select the desired installation path and click Next.
Figure 2. Installation folder selection
Only select the following components:
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.
Figure 4. License agreement
Figure 5. Shortcut location
Figure 6. Installation confirmation
Figure 7. Device drivers prompt
Figure 8. Installation is complete
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
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.
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