Firmware Compile Instruction -- STM32
Table of Contents:
- 1. Introduction
- 2. Set Up Build Environment
- 3. Get and compile Source Code
- 4. Video Reference
- 5. Frequency Ask Questiones (FAQ)
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.
1. Open the Webpage: http://www2.keil.com/stmicroelectronics-stm32/mdk
2. Download the Keil MDK, record the PSN here, we will use it later.
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.
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.
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.
Input PSN
Active via mail
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.
Add LIC
9. Finish Install Keil
Finish install Keil
2.2 Install STM32L0 Series Device in Keil
1. Open the webpage: https://www.keil.com/dd2/stmicroelectronics/stm32l072cztx/#/eula-container;
2. Find STMicroelectronics STM32L0 Series Device and download it.
Finish install Keil
3. Find the Software Pack and install it.
Install the downloaded pack in Keil
Install the downloaded pack in Keil
4. Add the Device, then you can rebuild the project.
rebuild project
Note: If you don't add the Device, then Keil will report this error:
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:
project files
4. Video Reference
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.
Support Frequency
If you want to change frequency, modify the Preprocessor Symbols. For example, change EU868 to US915 to complie a US915 firmware.
Change Marco for frequency