Run a demo application using CodeWarrior
This section describes the steps required to build, run, and debug example applications provided in the MCUXpresso SDK.
Note: CodeWarrior for DSC v11.2 is used as an example to show below steps, and the DSC toolchain should correspond to the latest supported version, as described in MCUXpresso SDK Release Notes for TWR-MC56F8200 (document MCUXSDKMC56F8200RN).
Download CodeWarrior for DSC v11.2, and ServicePack1 for DSC devices from CodeWarrior for 56800 Digital Signal Controller v11.2.
Install CodeWarrior for DSC v11.2.
Install ServicePack1 within CodeWarrior from the menu.
Click the Help menu and select Install new software > Add > Archive. Select the SP on your computer, check MCU v11.2 DSC Service Packs, and click Next.
Build an example application
To build the hello_world
example application, perform the following example steps:
Launch CodeWarrior and in the workspace launcher, choose a workspace which holds the projects to use. If the dialogue box does not pop up, enter a workspace folder and create one workspace.
|
|
Then the CodeWarrior Development Studio workspace with empty projects appears.
|
|
Import the project into the workspace.
Click Import project in the Commander pane. A form pops up. Click Browse to the SDK install directory.
|
|
Then all available demo projects are shown as [Figure 3](build_an_example_application.md#FIG_PROJECTIMPORT). Select the `hello_world` project in the list and click **Finish**.
If you already know the project location, navigate to the folder when clicking **Browse**, and only one project can be seen.
To locate most example application workspace files, use the following path:
```
<install_dir>/boards/<board_name>/<example_type>/<application_name>/codewarrior
```
Using the TWR-MC56F8200 hardware platform as an example, the `hello_world` workspace is located in:
```
<install_dir>/boards/twrmc56f8200/demo_apps/hello_world/codewarrior
```
Select the desired build target from the drop-down menu. For this example, select hello_world – flash_sdm_lpm_debug, as shown in Figure 4.
|
|
To build the demo application, click Build (All) in the Commander pane.
The build completes without errors.
Parent topic:Run a demo application using CodeWarrior
Run an example application
To download and run the application, perform the following steps:
Connect USB cable between the host PC and the JM60 USB(J18) port on the TWR-MC56F8200 target board. It sets OSJTAG and COM port in PC device manager.
Install the OSJTAG driver and USB CDC driver as PC hint if it is the first time you run it on your PC. The OSJTAG and USB CDC driver are provided by CodeWarrior by default.
The CodeWarrior may prompt to update the JM60 firmware, which requires to connect the J17 with a jumper on TWR-MC56F8200 board and then follow the instruction by CodeWarrior to finish the firmware update. The default debug interface is OSJTAG for TWR-MC56F8200 board.
Open the terminal application on the PC, such as PuTTY or TeraTerm, and connect to the debug COM port (to determine the COM port number, see How to determine COM port). Configure the terminal with these settings:
115200, defined by
BOARD_DEBUG_UART_BAUDRATE
in the board.h fileNo parity
8 data bits
1 stop bit |
|
For this example, click Debug in the Commander pane, and select the
hello_world_flash_sdm_lpm_debug_OSJTAG
launch configuration.|
|
|
|
Then the application is downloaded onto target board and automatically runs to the `main()` function.
To run the code, click **Run** on the toolbar.
**Note:**
- Generally there are four build configurations for DSC SDK 2.1x.x: `flash_sdm_lpm_debug`, `flash_sdm_lpm_release`, `flash_ldm_lpm_debug`, and `flash_ldm_lpm_release`.
`debug` uses optimization level 1 and `release` uses optimization level 4. `sdm` means small data memory model. `ldm` means large data memory model. `lpm` means large program memory model.
- Check each demo `readme` document, which includes detailed instructions for HW and SW settings.
|
|
The
hello_world
application is now running and a banner is displayed on the terminal, as shown in Figure 5. If it does not appear, check your terminal settings and connections.|
|
Parent topic:Run a demo application using CodeWarrior