Table of Contents:

1. Introduction

This introduction is to show how to compile the source code for Dragino's stm32 base products.

2. Set Up Build Environment

2.1 Set up Keil Compile Environment

Assuming you already have Keil uVision5 installed, the steps below show how to install the MDK support and get a license.

 

2.  Download the Keil MDK, record the PSN here, we will use it later.

 

image-20220526180802-1.png

Download Keil MDK

 

3.  Login with an account that has administration rights.

4.  Right-click the µVision icon and select Run as Administrator… from the context menu.

5.  Open the dialog File — License Management… and select the Single-User License tab.

 

image-20220526180902-2.png

Install Keil

6.  Click the button Get LIC via Internet..., then click the button OK to register the product. This action opens the License Management page on the Keil web site.

image-20220526180942-3.png

Install Keil

7.  Enter the Product Serial Number (from step 2.) 4RMW3-A8FIW-TUBLG along with your contact information and click the button Submit. An e-mail is sent back with the License ID Code (LIC) within a few minutes.

image-20220526181014-4.png

Input PSN

image-20220526181041-5.png

Active via mail

image-20220601135048-3.png

Active via mail

8.  To activate the Software Product, enter the LIC in the field New License ID Code (LIC) of the dialog License Management… and click Add LIC.

image-20220526181138-7.png

Add LIC

9.   Finish Install Keil

image-20220526181207-8.png

Finish install Keil

2.2 Install STM32L0 Series Device in Keil

2.   Find STMicroelectronics STM32L0 Series Device and download it.

image-20220526181351-11.png

Finish install Keil

3.  Find the Software Pack and install it.

image-20220526181302-10.png

Install the downloaded pack in Keil

image-20220526181434-12.png

Install the downloaded pack in Keil

4.  Add the Device, then you can rebuild the project.

image-20220526181509-13.png

rebuild project

Note: If you don't add the Device, then Keil will report this error:

image-20220526181543-14.png

Error without Device

3. Get and compile Source Code

  • Get the source code for the product.
  • Use Keil to open the project file.
  • You can see the libraries related for example NBSN50 project as below:

image-20220526181605-15.png

project files

4. Video Reference

https://youtu.be/ctdUNx4XCEg

5. Frequency Ask Questiones (FAQ)

5.1 How to change the frequency band for LoRaWAN source code

In Keil, you can see what frequency band the code support.

image-20220526181628-16.png

Support Frequency

If you want to change frequency, modify the Preprocessor Symbols. For example, change EU868 to US915 to complie a US915 firmware.

image-20220526181651-17.png

Change Marco for frequency

 

Tags:
Created by Xiaoling on 2022/05/11 17:05
    
Copyright ©2010-2024 Dragino Technology Co., LTD. All rights reserved
Dragino Wiki v2.0