Skip to content

andrew-devs/nmsdk2-preview

Repository files navigation

Northern Mechatronics Software Development Kit 2.0 (NMSDK2) {#northern-mechatronics-software-development-kit-2-0-nmsdk2}

Overview {#overview}

The NMSDK2 is a platform library for the Northern Mechatronics NM180100 LoRa BLE module. It provides support for LoRa direct, LoRa real-time, LoRaWAN, and BLE wireless connectivity and a FreeRTOS framework for rapid application development across a wide range of use cases and environments.

Prerequisites {#prerequisites}

Northern Mechatronics recommends you complete the following steps when using the NMSDK2:

We recommend installing the following tools to debug your application:

Install Microsoft Visual Studio Code {#install-microsoft-visual-studio-code}

Microsoft Visual Studio Code (VS Code) is a source-code editor made by Microsoft for Windows, Linux, and macOS. We recommend using it as your integrated development environment (IDE) of choice due to its ease of use.

To install VS Code:

  1. Download the latest version of VS Code from the Download page. Choose the correct version for your operating system.
  2. On the Select Additional Tasks screen of the installation wizard, enable the Add to PATH (requires shell restart) checkbox.

VS Code Installation with PATH checked

  1. Click the Install button.

VS Code installation confirmation

  1. VS Code should now be installed.

Set up GitHub (Optional) {#set-up-github-optional}

For your source control, we recommend using GitHub. It works seamlessly with the command line interface (CLI) offered through VS Code. It also has a desktop version available for download, offering a feature-rich user interface that simplifies version control for those less familiar with git commands.

Get the latest version of GitHub Desktop from their Downloads page.

VS Code and GitHub Integration {#vs-code-and-github-integration}

Once GitHub is downloaded, perform these steps to enable it in VS Code:

  1. Make sure you have already created your account on GitHub.
  2. Open VS Code.
  3. Click on Settings or the gear icon.
  4. Type “Git: Enabled” in the search bar.
  5. Ensure the Git: Enabled checkbox is enabled:

Git Enabled

Download NMSDK2 source code {#download-nmsdk2-source-code}

Once you have your preferred IDE and source control in place, it’s time to access the NMSDK2 source code.

  1. Navigate to the main page of the NMSDK2 repository.
  2. Above the list of files, click Code.

Clone Repository button

  1. Copy the URL for the repository.

GitHub Copy Repository URL

  1. Open VS Code.
  2. Open the command palette with the key combination of Ctrl + Shift + P.
  3. At the command palette prompt, enter gitcl, select the Git: Clone command, and press Enter.
  4. When prompted for the Repository URL, select clone from GitHub, then press Enter.
  5. If you are asked to sign into GitHub, complete the sign-in process.
  6. Enter the copied URL for the repository in the Repository URL field.
  7. Select (or create) the local directory into which you want to clone the project.
  8. When you receive the notification asking if you want to open the cloned repository, select Open.

Install Git {#install-git}

After opening the repository folder in VS Code for the first time, you may be prompted to install Git.

Dowload Git Prompt

To download and install Git, follow these steps:

  1. Click the Download Git button, or go directly to the Git Downloads page.
  2. Download the 62-bt or 32-bit version of Git depending on your operating system.
  3. Select VS Code as the Git’s default editor

Git VS Code Selected

  1. Leave all other settings as default for the rest of the install options.

Install recommended VS Code extensions {#install-recommended-vs-code-extensions}

VS Code extensions let you add languages, debuggers, and tools to your installation to support your development workflow. We recommend installing several extensions. To view the recommended VS Code extensions, follow these steps:

  1. Open VS Code.
  2. Click on File in the menu bar, then Open Folder.

File menu with Open Folder option

  1. Open the folder that contains your local version of the project.

Open Folder

  1. When the project is opened, you should see the following pop-up message:

Recommended extension popup

If no pop-up appears, follow these instructions to install our recommended extensions:

  1. Open the downloaded NMSDK2 source code repository folder in VS Code.
  2. Click the Gear icon in the bottom-left of VS Code.
  3. Select Extensions.
  4. In the search bar that shows the prompt Search Extensions in Marketplace, enter the text “@recommended”.

Recommended Extensions

  1. Download all of the extensions that appear under the Workplace Recommendations heading.

Recommended Extensions List

If you cannot view these items listed in your workspace, manually install the following extensions:

  • C/C++
  • C/C++ Extensions
  • C/C++ Themes
  • Makefile Tools
  • Cortex-Debug
  • LinkerScript

Install and Configure MSYS2 {#install-and-configure-msys2}

MSYS2 is a collection of tools and libraries providing you with an easy-to-use environment for building, installing, and running native Windows software. Install MSYS2 on your machine by following the MSYS2 Getting Started guide. Verify the installation was successful by executing the following command in your terminal:

$ gcc --version

Adding MSYS2 to your PATH variable {#adding-msys2-to-your-path-variable}

To make the MYSYS2 commands available everywhere, you need to add them to the “path” variable. The following instructions are for Windows 10 machines. Add the MYSYS2 executable to your PATH:

  1. In the Start menu search box, type the text “edit the system environment variables”.
  2. Click the Environment Variables… button.
  3. Click the New… button.
  4. Click Browse Directory and add the following location of the bin folder under the usr directory to your path. The location will depend on where you chose to install and configure MSYS2.
    1. The default location for Windows 64-bit systems is: C:\msys64\usr\bin.
    2. The default location for Windows 32-bit systems is: C:\msys32\usr\bin.

MSYS2 Path highlighted

Download and Install GNU Arm Toolchain 11.3Rel1 Compiler {#download-and-install-gnu-arm-toolchain-11-3rel1-compiler}

The GNU Arm Embedded Toolchain is a ready-to-use, open-source suite of tools for C, C++, and assembly programming. We recommend downloading the compiler for use with our SDK.

Download and install GNU Arm Toolchain version 11.3.Rel1:

  1. Navigate to the Arm Downloads page and download version 11.3.Rel1.
  2. Download the following version: arm-gnu-toolchain-11.3.rel1-mingw-w64-i686-arm-none-eabi.exe
  3. Add the compiler to your PATH using the Add path to environment variable checkbox.

Arm Compiler Path v11

Download and Configure Python 3 {#download-and-configure-python-3}

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Python is required for the support scripts that come with the SDK.

To install Python:

  1. Download the latest version of Python 3 from the Downloads page.
  2. User the Installation Wizard to add Python 3 to your PATH.

Python Installer

  1. Verify that the installation was successful by running the following command in your terminal:
	python --version

Complete first-time build of the NMSDK2 {#complete-first-time-build-of-the-nmsdk2}

With the build prerequisitesin place, it is time to perform a build of the SDK.

To build the SDK for the first time:

  1. Open VS Code.
  2. Click on Terminal in the menu bar.
  3. Click on Run Build Task…
  4. Select build debug.

Run Build Debug

  1. The output of this operation should resemble the following image:

Run Build DebugOutput

Debugging {#debugging}

SEGGER J-Links are the most widely used line of debug probes on the market. These Debuggers can communicate at high speed with a large number of supported target CPU cores.

To successfully debug your application using the SEGGER J-Link tools, follow these steps:

  1. Download the J-Link Software and Documentation pack.
  2. Connect the J-Link debug probe to your NM180310 or NM180100EVB.
  3. Debug in VS Code.

Download the J-Link Software and Documentation pack {#download-the-j-link-software-and-documentation-pack}

Download the official J-Link Software and Documentation pack. The exact version will depend on your operating system. Download the version that applies to you from the J-Links Download page.

Connect the J-Link Debug Probe to your NM180310 or NM180100EV {#connect-the-j-link-debug-probe-to-your-nm180310-or-nm180100ev}

When you have acquired the J-Link Debug Probe, and downloaded the associated J-Link debugging software, it is time to connect the J-Link debugger and your NM180310 or NM180100EV.

JLink Device Manager connected

Debug in VS Code {#debug-in-vs-code}

To start debugging in VS Code:

  1. Select Run in the menu bar.
  2. Click Start Debugging.

Run start debugging

  1. When debugging has started, your screen should look like the following screenshot.

DebuggingStarted

Troubleshooting {#troubleshooting}

This section contains a list of common errors and issues our users face:

Device not connected {#device-not-connected}

If you see the following error message of “undefined GDB Server Quit Unexpectedly”, it is because the J-Link debug device is not being detected.

Device Not Detected

Follow these steps to resolve the issue:

  1. Disconnect the device fully.
  2. Wait for at least 10 seconds.
  3. Reconnect the device
  4. Check the connection has been established in the Device Manager:

JLink Device Manager

JLinkGDBServerCL.exe not found {#jlinkgdbservercl-exe-not-found}

If you see the following error: “Failed to launch undefined GDB Server: Error: spawn C:\Program Files(x86)\SEGGER\JLink\JLinkGDBServerCL ENOENT”, it’s because the JLinkGDBServerCL.exe executable cannot be found.

JLink GDB Sever Error

To solve this issue, check the JLinkGDBServerCL.exe was successfully installed under the SEGGER > JLink folder:

JLink GDB Solution

Python not found {#python-not-found}

You may encounter an error message in your console containing the text “Python was not found”:

Python Not Found error message

Complete the following steps to verify the installation of Python was successful.

  1. Check that Python has been added to your PATH.

PythonPath

  1. Check the installation folder for the Python executable:

Python Installation Folder

GNU GCC not found {#gnu-gcc-not-found}

You may see this message in the Output tab of your terminal:

GNU GCC Not Found Output

You may see a similar error in the Terminal tab itself:

GNU GCC Not Found Terminal

Perform the following checks to rectify the issue:

  1. Check the GNU Arm Toolchain Compiler has been added to your Environment Variable path:

GNU Path

  1. Check the bin folder contains the arm-none-eabi-gcc.exe executable:

GNU Bin Folder

Make not found {#make-not-found}

If you see an error in the terminal containing the text “The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program”, there may be an issue with your MSYS2 installation.

Make Not Found error

Check the following aspects of the installation:

  1. Check the bin folder for MYSY2 has been added to your path:

MSYS Path Highlighted

  1. Check the installation folder contains the make.exe executable:

Make Executable

About

NMSDK2 Technical Preview

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages