![]() |
Morse Micro IoT SDK
2.6.4-esp32
|
This getting started guide walks through the process of using the MM-IoT-SDK Framework. This will go through the process of setting up the software infrastructure, building firmware for ESP32S3, and loading it onto the device.
v5.1.1 as this is the version that is currently supported by the MM-IoT-SDK. This is done by checking out the appropriate tag before running the install script. See ESP-IDF Versions for more information on the topic.git checkout v5.1.1git submodule update --init --recursiveesp32s3 by executing ./install.sh esp32s3 from the esp-idf directory during installation.Note that these instructions were tested on Ubuntu 22.04.
From the directory where IDF is installed execute the following command to export IDF variables to the environment:
. ./export.sh
Additionally we need to add an environment variable, MMIOT_ROOT. This allows the ESP-IDF to find the MM-IoT-SDK components when building. This can be done by running:
export MMIOT_ROOT=<path>/mm-iot-sdk-<VER>
Replace <path> and ver with the appropriate value for your install. Ensure this is an absolute path. You can add the above line to your ~/.bashrc or ~/zshrc (depending on which shell you use) for a more permanent solution.
The first step is to create an appropriate directory and unzip the software package into it. For example:
unzip mm-iot-sdk-<VER>.zip -d mm-iot-sdk-<VER> cd mm-iot-sdk-<VER>
Where <VER>= is the package version number.
The following is a brief overview of the contents of the MM-IoT-SDK package as it relates to using the framework. There are additional files that are used for PlatformIO that we will be ignoring.
| Path | Description |
|---|---|
framework/doc/ | HTML documentation, including Getting Started Guide and API documentation |
framework/mk/ | Makefile fragments for the various SDK components (not used when building using IDF) |
framework/morsefirmware/ | Firmware and board configuration files for supported Morse Micro chips and modules |
framework/morselib/ | Headers and .a files for morselib. Libraries can be found under morselib/lib/<architecture> |
framework/src/mm_shims/ | Source code for Hardware Abstraction Layer shims, Operating System abstraction layer shim, etc. |
examples/ | Example applications in source form. |
This version of the IoT SDK has been tested against Morse Micro AP with software version 1.9.3. It is assumed that you have this configured and within range of your Morse Micro IoT Reference Platform for ESP32.
This SDK includes several example applications, source code for which can be found in the mm-iot-sdk-<VER>/examples/<example> directory.
To build the examples:
First change into the example directory (e.g., examples/porting_assistant)
cd examples/porting_assistant
For the scan and sta_connect examples it is necessary to make a small source code modification to set the country code to that of the applicable regulatory domain. Edit the source code in main/src/scan.c or main/src/sta_connect.c and uncomment the following line, changing AU to the appropriate two character country code:
// #define COUNTRY_CODE "AU"
Now it possible to build the firmware by executing the following commands
idf.py set-target esp32s3 idf.py fullclean idf.py build
Some of the components delivered as part of the MM-IoT-SDK may require some configuration. For this the (Kconfig system)[https://docs.espressif.com/projects/esp-idf/en/v5.1.1/esp32s3/api-reference/kconfig.html] supplied as part of the ESP-IDF. To access this run the following command in your project.
idf.py menuconfig
The configuration options are located in (Top) → Component config → Morse Micro Shim Configuration
This components allows you to configure:
The Board Configuration File (BCF) is a configuration file for the Morse Micro chip that provides board-specific information and is required for the system to function properly. BCFs for Morse Micro modules are included in the MM-IoT-SDK package. These modules can be identified by the part numbers printed on their labels, which take the form MM6108-MFxxxxxx.
Execute the following commands to load the firmware to the ESP32 and start a serial monitor:
idf.py -p /dev/ttyACM0 flash monitor
Note: substitute
/dev/ttyACM0for the appropriate device name.
The porting assistant example runs through a variety of tests to provide initial validation of HAL implementation. Verifiation includes checking whether it is possible to communicate with the device via SPI. Expected output of this application is as follows:
The scan example performs a scan for access points (APs) and displays the results. Output of this application will vary depending on the APs in range but will look something like the following...
The STA Connect example demonstrates how to connect as a station (STA) to an AP. For this example to operate it requires that an AP be available to connect to and that the SSID and passphrase of the AP match the #defines in the source file main/src/sta_connect.c.
This example application will first establish connection then will send an ARP request for IP address 192.168.1.1. It will also print information about any received packets.
Output will vary depending on the AP configuration, but should look something like the following...
Each of the example applications provides an sdkconfig.defaults that is used to set the FreeRTOS tick rate to 1 kHz. This is necessary for the MM IoT SDK to operate properly.