Step-by-step guide for ARMGCC

Setup tool chains

Parent topic:Step-by-step guide for ARMGCC

Install GCC Arm embedded tool chain

Download and install the installer from www.launchpad.net/gcc-arm-embedded.

Parent topic:Step-by-step guide for ARMGCC

Install MinGW

  1. Download the latest mingw-get-setup.exe.

  2. Install the GCC Arm Embedded toolchain. The recommended path is C:/MINGW.

    Note: The installation path should not contain a space.

  3. Ensure that the mingw32-base and msys-base are selected under basic setup.

  4. Click “Installation” and “Apply changes”.

    |

|

  1. Add paths C:/MINGW/msys/1.0/bin;C:/MINGW/bin to the system environment. If the GCC Arm Embedded tool chain was not installed at the recommended location, the system paths added should reflect this change else the tool chain will not work. An example using the recommended installation locations is shown below.

    |

|

Parent topic:Step-by-step guide for ARMGCC

Add new system environment variable ARMGCC_DIR

Create a new system environment variable ARMGCC_DIR. The value of this variable should be the short name of the Arm GCC Embedded tool chain installation path.

|

|

Parent topic:Step-by-step guide for ARMGCC

Install CMake

  1. Download CMake 3.0.1 from www.cmake.org/cmake/resources/software.html.

  2. Install CMake 3.0.1 and ensure that the option “Add CMake to system PATH” is selected.

    |

|

Parent topic:Step-by-step guide for ARMGCC

Build the USB demo

  1. Change the directory to the project directory:<install_dir>/boards/twrk22f120m/usb_examples/usb_host_hid_mouse/bm/armgcc.

  2. Run the build_all.bat. The build output is shown in this figure:

    |

|

Parent topic:Step-by-step guide for ARMGCC

Run a demo application

This section describes steps to run a demo application using J-Link GDB Server application.

  1. Connect the J-Link debug port to the SWD/JTAG connector of the board.

  2. Open the J-Link GDB Server application and modify your connection settings as shown in this figure.

    |

|

**Note:** The target device selection should be MK22FN512xxx12. The target interface should be SWD.
  1. After the connection is estabilished, the screen would resemble the figure below:

    |

|

**Note:** The CPU selection should be CPU to: MK22FN512xxx12.
  1. Open the Arm GCC command prompt and change the directory to the output directory of the desired demo. For this example, the directory is:

    <install_dir>/boards/twrk22f120m/usb_examples/usb_host_hid_mouse/bm/armgcc/debug.

  2. Run the command “arm-none-eabi-gdb.exe <DEMO_NAME>.elf”. Run these commands:

    • “target remote localhost: 2331”

    • “monitor reset”

    • “monitor halt”

    • “load”

    • “monitor reset”

  3. The application is downloaded and connected. Execute the “monitor go” command to start the demo application.

  4. See the example-specific document for more test information.

Parent topic:Step-by-step guide for ARMGCC

Parent topic:Compiling or running the USB stack and examples