1. Before you set up an Eclipse workspace, you must run the cmake command.
Run the following command to work with the aws_demos Eclipse project.
cmake DVENDOR=marvell DBOARD=mw320 DCOMPILER=armgcc S . Bbuild -DAFR_ENABLE_TESTS=0
Run the following command to work with the aws_tests Eclipse project.
cmake DVENDOR=marvell DBOARD=mw320 DCOMPILER=armgcc S . Bbuild -DAFR_ENABLE_TESTS=1
Tip
Run the cmake command every time you switch between the aws_demos project and the aws_tests project.2. Open Eclipse and, when prompted, choose your Eclipse workspace as shown in the figure below.
Marvell MW32x AWS IoT Starter Kit
3. Choose the option to create a Makefile Project: with Existing Code as shown in the figure below.
4. Choose Browse, specify the directory of the existing code, and then choose Finish.
96
Marvell MW32x AWS IoT Starter Kit
5. In the navigation pane, choose aws_demos in the project explorer. Right-click aws_demos to open the menu, then choose Build.
If the build succeeds, it generates the build/cmake/vendors/marvell/mw300_rd/
aws_demos.bin file.
6. Use the command line tools to flash the Layout file (layout.txt), the Boot2 binary (boot2.bin), the MCU firmware binary (aws_demos.bin), and the Wi-Fi firmware.
a. Before you flash the firmware image, prepare the development board's flash with the common components, Layout and Boot2. Use the following commands.
cd amzsdk_bundle-x.y.z
Marvell MW32x AWS IoT Starter Kit
./vendors/marvell/WMSDK/mw320/sdk/tools/OpenOCD/flashprog.py -l ./vendors/marvell/
WMSDK/mw320/sdk/tools/OpenOCD/mw300/layout.txt --boot2 ./vendors/marvell/WMSDK/
mw320/boot2/bin/boot2.bin
The flashprog command initiates the following:
• Layout – The flashprog utility is first instructed to write a layout to the flash. The layout is similar to partition information for the flash. The default layout is located at /lib/
third_party/mcu_vendor/marvell/WMSDK/mw320/sdk/tools/OpenOCD/mw300/
layout.txt.
• Boot2 – This is the boot-loader used by the WMSDK. The flashprog command also writes a bootloader to the flash. It is the bootloader's job to load the microcontroller's firmware image after it is flashed. Make sure you get the same output as shown in the figure below.
b. The firmware uses the Wi-Fi chipset for its functionality, and the Wi-Fi chipset has its own firmware that must also be present in the flash. You use the flashprog.py utility to flash the Wi-Fi firmware in the same way that you did to flash the boot2 boot-loader and the MCU firmware. Use the following commands to flash the Wi-Fi firmware.
cd amzsdk_bundle-x.y.z
./vendors/marvell/WMSDK/mw320/sdk/tools/OpenOCD/flashprog.py --wififw ./vendors/
marvell/WMSDK/mw320/wifi-firmware/mw30x/mw30x_uapsta_W14.88.36.p135.bin
Make sure the output of the command is similar to the figure below.
98
Marvell MW32x AWS IoT Starter Kit
c. Use the following commands to flash the MCU firmware.
cd amzsdk_bundle-x.y.z
./vendors/marvell/WMSDK/mw320/sdk/tools/OpenOCD/flashprog.py --mcufw build/cmake/
vendors/marvell/mw300_rd/aws_demos.bin -r
d. Reset the board. You should see the logs for the demo app.
e. To run the test app, flash the aws_tests.bin binary located at the same directory.
cd amzsdk_bundle-x.y.z
./vendors/marvell/WMSDK/mw320/sdk/tools/OpenOCD/flashprog.py --mcufw build/cmake/
vendors/marvell/mw300_rd/aws_tests.bin -r
Your command output should be similar to the one shown in the figure below.
Debugging
• Start Eclipse and choose Help and then choose Install new software. In the Work with menu, choose All Available Sites. Enter the filter text GDB Hardware. Select the C/C++ GDB Hardware Debugging option and install the plugin.
MediaTek MT7697Hx development kit
Troubleshooting
Network issues
Check your network credentials. See "Provisioning" in Build and run the FreeRTOS demo project (p. 88).
Enabling additional logs
• Enable board specific logs.
Enable calls to wmstdio_init(UART0_ID, 0) in the function prvMiscInitialization in the main.c file for tests or demos.
• Enabling Wi-Fi logs
Enable the macro CONFIG_WLCMGR_DEBUG in the freertos/vendors/marvell/WMSDK/
mw320/sdk/src/incl/autoconf.h file.
Using GDB
We recommend that you use the arm-none-eabi-gdb and gdb command files packaged along with the SDK. Navigate to the directory.
cd freertos/lib/third_party/mcu_vendor/marvell/WMSDK/mw320
Run the following command (on a single line) to connect to GDB.
arm-none-eabi-gdb -x ./sdk/tools/OpenOCD/gdbinit ../../../../../../build/cmake/vendors/
marvell/mw300 _rd/aws_demos.axf
Getting started with the MediaTek MT7697Hx development kit
This tutorial provides instructions for getting started with the MediaTek MT7697Hx Development Kit.
If you do not have the MediaTek MT7697Hx Development Kit, visit the AWS Partner Device Catalog to purchase one from our partner.
Before you begin, you must configure AWS IoT and your FreeRTOS download to connect your device to the AWS Cloud. See First steps (p. 15) for instructions. In this tutorial, the path to the FreeRTOS download directory is referred to as freertos.
100
MediaTek MT7697Hx development kit
Overview
This tutorial contains instructions for the following getting started steps:
1. Installing software on the host machine for developing and debugging embedded applications for your microcontroller board.
2. Cross compiling a FreeRTOS demo application to a binary image.
3. Loading the application binary image to your board, and then running the application.
4. Interacting with the application running on your board across a serial connection, for monitoring and debugging purposes.
Set up your development environment
Before you set up your environment, connect your computer to the USB port on the MediaTek MT7697Hx Development Kit.