Welcome to Sensor Node Lora documentation!

Version:1.40
Copyright:(C)2017 Avnet Silica company
Date:14 Mar 2017
Reference name:BAEVTSS002

Microchip’s Long Range Low Power End Node solution

_images/logo_silica_microchip.jpg _images/board_on.jpg

Sensor Node Lora

INTRODUCTION

Microchip’s Long Range Low Power End Node solution

With the growing Internet of Things, Microchip has a LoRa® Technology wireless solution to address increasing demands on end-devices for long range connectivity, low power for battery operation, and low infrastructure cost for volume deployment.

Microchip’s LoRa Technology solution is ready to run out-of-the box and with the complete LoRaWAN™ Protocol and certifications in place, it reduces time to market and saves development costs.

The RN2483 is a LoRa™-integrated modem with a range of more than 15 km (suburban), low power enabling a battery life greater than 10 years and the ability to connect millions of wireless sensor nodes to LoRa gateways and IoT-connected Cloud Servers. This robust system is due to LoRa’s unique spread-spectrum based modulation that is capable of demodulation 20 dB below the noise level. This enables high sensitivity for ultra-long range, improved network efficiency and eliminates interference. The RN2483 modem operates over the 433 and 868 MHz license-free Industry Scientific and Medical (ISM) frequency bands and serves as the end-device in the LoRa network infrastructure.

_images/LoRa-Main-Lrge.jpg

The RN2483 is a fully-certified 433/868 MHz module based on wireless LoRa® technology.

The module’s embedded LoRaWAN™ Class A protocol enables seamless connectivity to any LoRaWAN compliant network infrastructure, whether public or privately deployed.  The module is specifically designed for ease of use, which shortens development time and speeds time to market.  LoRa technology is ideal for battery-operated sensors and low power applications such as IoT, M2M, Smart City, Sensor networks, Industrial automation, and more.

Features:

  • On-board LoRaWAN™ Class A protocol stack
  • ASCII command interface over UART
  • Compact form factor 17.8 x 26.7 x 3 mm
  • Castellated SMT pads for easy and reliable PCB mounting
  • Device Firmware Upgrade (DFU) over UART
  • 14 GPIO for control, status, and ADC
  • Highly integrated module with MCU, crystal, EUI-64 Node Identity Serial EEPROM, Radio transceiver with analog front end, and matching circuitry
  • Environmentally friendly, RoHS compliant
  • European R&TTE Directive Assessed Radio Module

Developement tools

Firmware developed using: NXP Kinetis Design Studio. For installation and configuration of the project, follow instruction inside Quick start guide for firmware 1.6 or major

Document references

The board reference documentation is available on the Avnet Silica website.

Contents:

Quick start guide for firmware 1.6 or major

In this guide you will be able to upload your board with the last firmware and join the Lora Network in ABP or OTAA mode.

Update firmware

If you are unsure about which firmware version you have then update your board with the lastest firmware avaiable.

  1. Download the file Lora_v16.bin.zip and unzip it.
  2. Connect the board to the PC via Mini Usb cable.
_images/board_usb.jpg
  1. Go to the mbed site.
  2. Download the lastest mbed serial port driver, it is named as mbedWinSerial.
  3. Install the driver.
  4. When the driver is installed, a MBED mass storage device and a Serial line and a HID device are finded out. Open the MBED mass storage.
_images/mbed_open.jpg

Warning

If the window opened is named BOOTLOADER repeat the procedure, the window must be named MBED.

  1. Copy the file Lora_v16b.bin into the MBED mass storage.
  2. The Green led on the board will blink while the file is programmed into the device flash memory.

Warning

If accidentally has been copied the firmware in the BOOTLOADER window you have corrupted the MBED firmware and you have to fix it. Please read the fix procedure going to the page How to fix the MBED firmware

Setup Module

Now you have to choose which kind of connection you want OTAA or ABP.

  • Over-the-Air Activation (OTAA) is the most secure way to connect the device. The module will perform a join-procedure with the network, during which a dynamic DevAddr is assigned and security keys are negotiated with the device.
  • The Activation-by-Personalization permit you to hardcode the DevAddr as well as the security keys in the module. This way is simpler than OTAA, because you skip the join procedure, but it is less safer than the OTAA.

You have to setup the board in order to send correctly messages to your operator. Follow next steps correctly:

  1. Insert antenna and Micro-USB from the windows PC to the board and put the board on the table.
  2. If you did not installed the mbed serial driver then go to mbed website otherwise go to the step 5
  3. Download the lastest mbed serial port driver, it is named as mbedWinSerial.
  4. Install the driver.
  5. Now switch on the Lora Sensor Node.
_images/board_switch.jpg
  1. If the MBED Windows serial port driver is installed correctly Windows will recognize the board as a memory storage called MBED and as a Serial Com Port.
_images/storage_mbed.jpg
  1. Now we have to connect a terminal to the Serial Com. First step, find which number is, going to “Device Manager” and finding the node called “Ports (COM and LPT)”. In this example the number port is 170.
_images/device_manager.jpg
  1. Open a terminal like putty, you can find it here. Launch it and set the properties signed in red in the figures:
_images/putty_session.jpg _images/putty_serial.jpg
  1. Press the Open button. Now reset the board pressing S3 button
  2. On the putty console you will see the booting text:
Module Version: BAEVTSS002 firmware version 1.6
RN2483 1.0.1 Dec 15 2015 09:38:06
  1. After that you have 5 seconds in order to press S2 button. Doing so it is possible enter in a menu where you can run special commands.
  2. From this menu you will be able to setup your board:
Send commands to RN2483. Write 'quit' to exit.
    Enter 1 > Write/Read REGS
    Enter 2 > RESET Module
    Enter 3 > Send Payload
    Enter 4 > Advanced Settings

Now if you want to use OTAA go to the paragraph OTAA Configuration otherwise if you want to use ABP go to ABP Configuration

OTAA Configuration

The OTAA configuration requires the following parameters:

  • DevEUI: 64 bit end-device identifier. It is unique for every device.
  • AppEUI: 64 bit application identifier. It is unique for every device.
  • AppKey: 64 bit application identifier. It is unique for every device.
  1. From the main menu press ‘1‘ you will select “Write/Read REGS”. Will be showed this menu:
Enter 1 > set DEVADDR (ABP mandatory)
Enter 2 > set NWKSKEY (ABP mandatory)
Enter 3 > set APPSKEY (ABP optional)
Enter 4 > set DEVEUI (OTAA and ABP mandatory)
Enter 5 > set APPEUI (OTAA mandatory)
Enter 6 > set APPKEY (OTAA mandatory)
Enter 7 > Save Changes
Enter 8 < back
  1. Enter 4 to insert DevEUI address.
  2. Insert 16 hexadecimal numbers. You can read the last numbers on the label of the board as in the image.
_images/euid_label.jpg
  1. If it succeed will apper value changed
  2. Now you have to program the AppEUI pressing the key 5
  3. Insert 16 hexadecimal numbers. For example 0123456789ABCDEF.
  4. If it succeed will apper value changed
  5. The last value to insert is the APPKEY pressing the key 6
  6. Insert 32 hexadecimal numbers. For example 0123456789ABCDEF0123456789ABCDEF.
  7. If it succeed will apper value changed
  8. Now you have to save these changes pressing the key 7

Once the board is configurated correctly you have to register the device to your provider. In this guide we used Thingpark. To follow the next steps go to Register Module.

ABP Configuration

The ABP configuration requires the following parameters:

  • DevAddr: 32 bit device address (non-unique)
  • NwkSKey: 64 bit register, it is used for network layer security
  • DevEUI: 64 bit end-device identifier. It is unique for every device
  1. From the main menu press ‘1‘ you will select “Write/Read REGS”. Will be showed this menu:
Enter 1 > set DEVADDR (ABP mandatory)
Enter 2 > set NWKSKEY (ABP mandatory)
Enter 3 > set APPSKEY (ABP optional)
Enter 4 > set DEVEUI (OTAA and ABP mandatory)
Enter 5 > set APPEUI (OTAA mandatory)
Enter 6 > set APPKEY (OTAA mandatory)
Enter 7 > Save Changes
Enter 8 < back
  1. Enter 1 to insert DevAddr address.
  2. Insert 8 hexadecimal numbers. You can read the last numbers on the label of the board as in the image.
_images/euid_label.jpg
  1. If it succeed will apper value changed
  2. Now you have to program the NwkSKey pressing the key 2
  3. Insert 32 hexadecimal numbers. For example 0123456789ABCDEF0123456789ABCDEF.
  4. If it succeed will apper value changed
  5. The last value to insert is the DevEUI pressing the key 4
  6. Insert 32 hexadecimal numbers. For example 12345678901234567890123456789012.
  7. If it succeed will apper value changed
  8. Now you have to save these changes pressing the key 7
  9. Once the board is configurated correctly you have to register the device to your provider. In this guide we used Thingpark. To follow the next steps go to Register Module.
Register Module
  1. In order to see working the Sensor Node Lora you have to register the device on the activity website clicking on Try.
  2. After the registration login and you will access the main page.
  3. Register your Microchip RN2483 device, to do this, click on Device Manager to open a new window.
_images/actility_device_manager.jpg
  1. Click on the + Create button.
_images/actility_create.jpg
  1. In this form you have to insert the data we have stored in the RN2483. You have to choose if to use ABP or OTAA mode in the first field named Device activation of the Device identification group.
_images/actility_device_activation.jpg
  1. Insert in every field the values wrote before in the device (OTAA Configuration or ABP Configuration paragraph).
  2. Make sure to define as Device profile: LoRaWAN 1.0 - class A - ETSI
  3. Select a valid Connection plan

Optional field but useful:

  • Name: insert a name just to recognize your device.
  1. Click on the top right + create.

Warning

If you don’t enter the same keys wrote in the device you will be unable to send data correctly in the Lora network.

  1. After the registration, you can close the window device manager and on the main page go to Logger.
_images/actility_logger.jpg
  1. In this page you will see all the messages sent by your device.
Use your board

17. From the main menu of the device you have to select which mode will be used in the demo. You can have these options:

Enter 5 > Change mode Demo to OTAA join
Enter 6 < Start Demo in ABP mode

or

Enter 5 > Change mode Demo to ABP join
Enter 6 < Start Demo in OTAA mode

Select the correct one, your choose will be stored in flash memory and used every time you will turn-on the board. Then start the demo, the device will enter automatically in sleep mode.

  1. Every 2 minutes it will wake up for a short time in order to send a message. It is possible skipping the sleeping phase pressing the S2 button. When the board is sending a message a blue led will be turned on.
_images/board_s2.jpg
  1. After pressing S2 button you will see the first message sent by your device. Now tilt your board to 90 degrees and wait 30 seconds.
_images/board_tilt.jpg
  1. The board will send another message.
  2. Now it’s time to see the data sent. Power off the board.
  3. In the logger window, you will have 2 rows, every row is a message received from the server.
_images/actility_logger_messages.jpg
  1. If you click on the + node you can see the unencrypted data received Payload (hex):.
_images/actility_logger_messages2.jpg
  1. All messages start with the number 18, the other three number couples are the data read from the accelerometer mounted on the board. You will see the data changed when you have tilted the board and sent the second message. The accelerometer data are marked in red.
_images/actility_logger3.jpg
  1. From the firmware version 1.6 sends also the light ambient value, you can read it from the payload after the number 48. In the following figure it is marked with a red line.
_images/actility_logger4.jpg

The dark will be rappresented with a low number and a strong light with a high number.

LEDs functionality

The board has four LEDs:

_images/board_leds.jpg
LED Color Brief Note
1 Blue RN2483 GPIO_12
2 Red RN2483 GPIO_13
3 not fitted
4 Green OpenSDA & MBED
5 Blue Firmware status
  • LED1 & LED2 are connected directly via RN2483 GPIOs. By default, they are turned ON during Power-On and on Reset status of the RN2483. After that the firmware sends commands to the RN2483 in order to turn OFF the LEDs. The purpose is to save battery life.
  • LED4 when the Mini-USB cable is connected the led will be turned ON.
  • LED5 is turned ON when the KL26Z is running sending a message over Lora network. It is turned OFF during the deepsleep phase.

Quick start guide for firmware 1.4 or major

This guide permits to send messages over the Lora network. This page is written for Windows users.

Check on the backside of the board a label like this one:

_images/label_prod.jpg

If the serial number S/N is lesser than 199 then you have to update the firwmare otherwise skip the next paragraph.

Update firmware

Update your board with the lastest firmware avaiable:

  1. Download the file Lora_v15b.bin.zip and unzip it.
  2. Connect the board to the PC via Mini Usb cable.
_images/board_usb.jpg
  1. Go to the mbed site.
  2. Download the lastest mbed serial port driver, it is named as mbedWinSerial.
  3. Install the driver.
  4. When the driver is installed, a MBED mass storage device and a Serial line and a HID device are finded out. Open the MBED mass storage.
_images/mbed_open.jpg

Warning

If the window opened is named BOOTLOADER repeat the procedure, the window must be named MBED.

  1. Copy the file Lora_v15b.bin into the MBED mass storage.
  2. The Green led on the board will blink while the file is programmed into the device flash memory.

Warning

If accidentally has been copied the firmware in the BOOTLOADER window you have corrupted the MBED firmware and you have to fix it. Please read the fix procedure going to the page How to fix the MBED firmware

Register Module
  1. In order to see working the Sensor Node Lora you have to register the device on the activity website clicking on Create an account.
  2. After the registration login and you will access the main page.
_images/actility_main.jpg
  1. Register your Microchip RN2483 device, to do this, click on Device Manager arrow to open a new window.
_images/actility_device_manager.jpg
  1. Click the right mouse button on the Devices folder and select + Create.
_images/actility_create.jpg
  1. In this form you have to insert the data we have stored in the RN2483. The following fields are mandatory:
  • Device EUI: the 16-hex identification key of the device. It is unique for every device, you can read it on the label of the board as in the image. For example the code can be 0004A30B001B9954
_images/euid_label.jpg
  • Network Address: This is the device address provided by the operator, contains the NetworkID where you want to connect the device.
  • Device profile: LoRaWAN 1.0 class A
  • Network key (hexa): we have already saved it in the RN2834 device, it is the Device EUI key copied twice, for example if the device EUI is 0004A30B001B9954 then the network session key you have to insert will be 0004A30B001B99540004A30B001B9954.
  • Application keys: Insert AFBECD56473829100192837465FAEBDC, port 4. We have saved it in the RN2834 device. This is the application sessio key.
  • Connectivity plan: choose yours

Optional field but useful:

  • Name: insert a name just to recognize your device.
  1. Click on the top right + create.

Warning

If some key is wrong then the device will be unable to send data correctly in the Lora network.

  1. After the registration, you can close the window device manager and on the main page go to Logger.
_images/actility_logger.jpg
  1. In this page you will see all the messages sent by your device.
Use your board

Now take your board:

_images/board_bare.jpg

The board doesn’t have the correct device address in order to send correctly messages to your operator, so you have to set it. Follow next steps correctly:

  1. Insert antenna and Micro-USB from the windows PC to the board and put the board on the table.
  2. If you did not installed the mbed serial driver then go to mbed website otherwise go to the step 5
  3. Download the lastest mbed serial port driver, it is named as mbedWinSerial.
  4. Install the driver.
  5. Now switch on the Lora Sensor Node.
_images/board_switch.jpg
  1. If the MBED Windows serial port driver is installed correctly Windows will recognize the board as a memory storage called MBED and as a Serial Com Port.
_images/storage_mbed.jpg
  1. Now we have to connect a terminal to the Serial Com. First step, find which number is, going to “Device Manager” and finding the node called “Ports (COM and LPT)”. In this example the number port is 170.
_images/device_manager.jpg
  1. Open a terminal like putty, you can find it here. Launch it and set the properties signed in red in the figures:
_images/putty_session.jpg _images/putty_serial.jpg
  1. Press the Open button. Now reset the board pressing S3 button and after keep the S2 button pressed for 5 seconds.
_images/board_s2_s3.jpg
  1. On the putty console you will see the starting boot text:
BAEVTSS002 firmware version 1.5b
RN2483 1.0.1 Dec 15 2015 09:38:06
  1. Keeping the S2 button pressed you will see after some seconds the text Please release the button S2. Will be displayed a menu like this one:
*** MENU CONFIG RN2483 ***
Enter 0 to print this menu
Enter 1 to see values in DEVEUI and DEVADDR registers
Enter 2 to modify DEVEUI
Enter 3 to modify DEVADDR
Enter 4 to modify APPSKEY
Enter 5 to modify NWKSKEY
Enter 6 to save changes
Enter 7 to Microchip default reset
Enter 8 to Avnet default reset
Enter 9 to exit

From this menu you will be able to change the registers DEVEUI, DEVADDR, APPSKEY and NWKSKEY. furthermore it is possible reset the RN2483 with factory reset by Microchip or by Avnet.

Warning

The BAEVTSS002 is setted by default with Avnet reset.

  1. In this case, we want change the networkID so you have to press the key 2 to be able to change the DEVEUI register, it will be showed:
Changing deveui register, current value: 001B9954
Enter new deveui value, 8 hex numbers lenght (press ENTER to abort):
>>

As you can see in the first line it is displayed the current value in the register and how many numbers you have to insert in order to change the register.

Note

The current value of the register it is displayed only for DEVEUI and DEVADDR registers. APPSKEY and NWKSKEY register are write-only so their current value won’t be showed.

  1. Insert 8 hexs numbers, for example 12345678. After the last key will be pressed automatically the value of register will change.
Changing deveui register, current value: 001B9954
Enter new deveui value, 8 hex numbers lenght (press ENTER to abort):
>> 12345678

Note

If you press Enter before to insert all the keys the procedure will abort. 12345678 is just for example, please contact your Operator in order to know which networkID you have to use. Without the correct networkID you won’t be able to send messages.

  1. If the procedure will have success will appear the message value changed:
Changing deveui register, current value: **001B9954**
Enter new deveui value, 8 hex numbers lenght (press ENTER to abort):
>> 12345678
value changed
  1. Now the DEVEUI register is changed but if the RN2843 will be turned off the modify will be lost. In order to keep the modify you have to save it. To do it, from the menu press the key 6 referred to Enter 6 to save changes. During the saving will be showed:
Saving modifies, please don't turn off the device...
please wait...
  1. The saving will terminate when will appear the message success:
Saving modifies, please don't turn off the device...
please wait...success

Note

If you have to change other values use the appropiate keys. If you want only see the value of the readable register press the key 1

  1. Now to start the demo exit from the menu pressing the key 9. The device will enter automatically in sleep mode.
  2. Every 2 minutes it will wake up for a short time in order to send a message. It is possible skipping the sleeping phase pressing the S2 button. When the board is sending a message a blue led will be turned on.
_images/board_s2.jpg
  1. After pressing S2 button you will see the first message sent by your device. Now tilt your board to 90 degrees and wait 30 seconds.
_images/board_tilt.jpg
  1. The board will send another message.
  2. Now it’s time to see the data sent. Power off the board.
  3. In the logger window, you will have 2 rows, every row is a message received from the server.
_images/actility_logger_messages.jpg
  1. If you click on the + node you can see the unencrypted data received Payload (hex):.
_images/actility_logger_messages2.jpg
  1. All messages start with the number 18, the other three number couples are the data read from the accelerometer mounted on the board. You will see the data changed when you have tilted the board and sent the second message. The accelerometer data are marked in red.
_images/actility_logger3.jpg
  1. From the firmware version 1.5 sends also the light ambient value, you can read it from the payload after the number 48. In the following figure it is marked with a red line.
_images/actility_logger4.jpg

The dark will be rappresented with a low number and a strong light with a high number.

LEDs functionality

The board has four LEDs:

_images/board_leds.jpg
LED Color Brief Note
1 Blue RN2483 GPIO_12
2 Red RN2483 GPIO_13
3 not fitted
4 Green OpenSDA & MBED
5 Blue Firmware status
  • LED1 & LED2 are connected directly via RN2483 GPIOs. By default, they are turned ON during Power-On and on Reset status of the RN2483. After that the firmware sends commands to the RN2483 in order to turn OFF the LEDs. The purpose is to save battery life.
  • LED4 when the Mini-USB cable is connected the led will be turned ON.
  • LED5 is turned ON when the KL26Z is running sending a message over Lora network. It is turned OFF during the deepsleep phase.

Quick start guide for firmware 1.0

This guide is valid if you can choose by yourself the devaddr on the registration device of the Actility webpage. If you want upgrade the firmware to the newest version then go to Quick start guide for firmware 1.4 or major.

In order to see working the Sensor Node Lora you have to register the device on the activity website clicking on Create an account. After the registration login and you will access the main page.

_images/actility_main.jpg

First up we have to register your Microchip RN2483 device, to do this, click on Device Manager arrow to open a new window.

_images/actility_device_manager.jpg

Click the right mouse button on the Devices folder and select + Create.

_images/actility_create.jpg

In this form you have to insert the data we have stored in the RN2483. The following fields are mandatory:

  • Device EUI: the 16-hex identification key of the device. It is unique for every device, you can read it on the label of the board as in the image. For example the code can be 0004A30B001B9954
_images/euid_label.jpg
  • Network address: last 4 less significant bytes from the Device EUI key, for example if the code is 0004A30B001B9954 then the network address will be 001B9954

Note

if your board has the Mini-USB connector then the key will be the last 4 less significant bytes from the Device EUI key but the second character will be 8 and not 0. So in this example it will be 081B9954

  • Device profile: LoRaWAN 1.0 class A
  • Network key (hexa): we have already saved it in the RN2834 device, it is the Device EUI key copied twice, for example if the device EUI is 0004A30B001B9954 then the network key you have to insert will be 0004A30B001B99540004A30B001B9954.
  • Application keys: Insert AFBECD56473829100192837465FAEBDC, port 4. We have saved it in the RN2834 device.
  • Connectivity plan: choose yours

Optional field but useful:

  • Name: insert a name just to recognize your device.

Then click on the top right + create.

Warning

If some key is wrong then the device will be unable to send data correctly in the Lora network.

After the registration, you can close the window device manager and on the main page go to Logger.

_images/actility_logger.jpg

Here you will see all the messages sent by your device. Now take your board:

_images/board_bare.jpg

insert antenna and battery and keeping the board on the table switch on the Lora Sensor Node.

_images/board_switch.jpg

Now the device is in sleeping mode, in 30 seconds it will wake up and it is going to sent a message. For skipping the sleeping phase, press S2 button.

_images/board_s2.jpg

After pressing S2 button you will see the first message sent by your device. Now tilt your board to 90 degrees and wait 30 seconds.

_images/board_tilt.jpg

The board will send another message. Now it’s time to see the data sent. Power off the board. And in the logger window, you will have 2 rows, every row is a message received from the server. If you click on the + node you can see the unencrypted data received Payload (hex):. All messages start with the number 18, the other three number couples are the data read from the accelerometer mounted on the board. You will see the data changed when you have tilted the board and sent the second message.

_images/actility_logger2.jpg

Developing guide

This guide will provide instructions to install the development environment needed to compile and debug the demo firmware of the Sensor Node Lora. The development system is multiplatform, it supports Windows and Linux. This guide is written using Windows. The main steps are:

  • Install Kinetis Design Studio 3.2.0, upgrade it and install KSDK 1.3.0
  • Import build & debug the source project

Hardware required:

  • Sensor Node Lora with battery or Mini-USB cable
  • if you don’t use Mini-USB cable Segger it is required a J-Link (Segger website) with SWD debug interface.
  • PC with Windows or Linux
Install & Update Kinetis Design Studio
  1. First up, register at the NXP website registration form
  2. Download the IDE from this page. Clicking on Download button.
_images/download_kinetis_0.jpg
  1. Click on Downloads for Kinetis Design Studio for Microsoft Windows.
_images/download_kinetis_1.jpg
  1. Agree the terms and download the file Installer: Kinetis Design Studio 3.2.0 Installer for Windows.
_images/download_kinetis_3.jpg
  1. Next, launch the downloaded file kinetis-design-studio_3.2.0.exe following all the default options.
  2. Launch the KDS and select a directory for the workspace. Our project will be imported in this folder. In this guide we used this path:
_images/kds_workspace.jpg
  1. At this point, if you want to modify the project using processor expert it is required to install also the package KSDK 1.3.0 in order to be compatible with the project. You can find this package on KINETIS-SDK page. Select Download button from Kinetis SDK.
_images/download_kinetis_KSDK_1.jpg
  1. Select KSDK v1.3.0 Mainline releases
_images/download_kinetis_KSDK_2.jpg
  1. Agree the terms and then download Kinetis SDK 1.3.0 Mainline - Windows.exe
_images/download_kinetis_KSDK_3.jpg
  1. Install it following all the default options, it will be installed into C:\Freescale\KSDK_1.3.0
  2. Now launch KDS 3.2.0
  3. Select Help -> Install New Software
  4. Click on Add... button
  5. Then click on Archive button
  6. Now select from C:\Freescale\KSDK_1.3.0\tools\eclipse_update the file KSDK_1.3.0_Eclipse_Update
  7. Select the package KSDK 1.3.0 Eclipse Update
  8. Continue with the wizard. Accept the license agreement during the installation process.
  9. Restart KDS

Now you are ready to import the project in your KDS.

Import Project
  1. Download the project 1083_SW_BAEVTSS002_REL5b.zip.
  2. Then go to File->Import and select Existing Projects into Workspace.
_images/kds_archive.jpg
  1. Browse to the zip file containing the project and select the project.
_images/import_lora.jpg
  1. Press on Finish. Now you are ready to build and debug it. There are two ways to debug the board, the easiest is debug it via USB.
Build & Debug via USB

With the Mini-USB connector you are able to use OpenOCD inteface. It is necessary to install the mbed serial port driver.

  1. Go to the mbed website
  2. Download the lastest mbed serial port driver, it is named as mbedWinSerial.
  3. Install the driver.
  4. After the installation, connect the lora-node board to the PC via the CN2 connector.
_images/board_usb.jpg
  1. Turn On the board switching the SW1 as in figure.
_images/board_usb_on.jpg
  1. Windows will recognize it as a MBED mass storage device.
_images/mbed_open.jpg
  1. On the KDS from the menu click on Project->Build All, to compile the entire project.
  2. Then click on Run->Debug Confiuration->Lora_Debug_OpenOCD.
_images/kds_debug_openocd.jpg
  1. Clicking on Debug button the debug will start entering on the first line code of the main() function.
_images/eclipse_debug.jpg

Warning

  • Due some problem with KDS, sometimes you have to launch the debug twice before the KDS will run the debug correctly.
  • During the debug session the sleeping mode doesn’t work.
Build & Debug via SWD
  1. Go to Project->Build All, to compile the entire project. In order to debug it connect the J-Link to the connector CN4.

Note

Connector CN4 is not fitted on the lora-node board. It is a connector SMD MALE STRIP 2x5 P1.27mm. You have to fit it in order to debug the board via SWD.

  1. The used debug interface is SWD. Then turn on the board switching the SW1.
_images/board_jlink.jpg
  1. Always on the KDS click on Run->Debug Confiuration->GDB Segger J-Link Debug.
_images/kds_debug.jpg
  1. Clicking on Debug button the debug will start entering on the first line code of the main() function. During the debug session the sleeping mode doesn’t work.
Reset Factory

From the release 1.4 you can reset the RN module throught the menu. Follow the next steps:

  1. Download the file Lora_v15b.bin.zip and unzip it
  2. Connect the board from your PC to the board via micro-USB cable. Open the MBED mass storage.
_images/mbed_open.jpg
  1. Copy the Lora_v15b.bin file into the MBED mass storage
  2. The Green led on the board will flash while the file is programmed into the device flash memory.
  3. Now we have to connect a terminal to the Serial Com. First step, find which number is, going to “Device Manager” and finding the node called “Ports (COM and LPT)”. In this example the number port is 170.
_images/device_manager.jpg
  1. Open a terminal like putty, you can find it here. Launch it and set the properties signed in red in the figures:
_images/putty_session.jpg _images/putty_serial.jpg
  1. Press the Open button. Now reset the board pressing S3.
_images/board_s2_s3.jpg
  1. On the putty console you will see the starting boot text:
BAEVTSS002 firmware version 1.5b
RN2483 1.0.1 Dec 15 2015 09:38:06
  1. Keeping the S2 button pressed you will see after some seconds the text Please release the button S2. Will be displayed a menu like this one:
*** MENU CONFIG RN2483 ***
Enter 0 to print this menu
Enter 1 to see values in DEVEUI and DEVADDR registers
Enter 2 to modify DEVEUI
Enter 3 to modify DEVADDR
Enter 4 to modify APPSKEY
Enter 5 to modify NWKSKEY
Enter 6 to save changes
Enter 7 to Microchip default reset
Enter 8 to Avnet default reset
Enter 9 to exit
  1. From the menu press the key 8 referred to Enter 8 to Avnet default reset. During the reset will be showed:
Starting Avnet default reset, please don't turnoff the board
  1. Wait until will be showed the message success.
  2. Now if you have to set correctly the DEVADDR register, see the paragraph Update firmware in Quick start guide for firmware 1.4 or major

Note

with the sources you can build the firmware 1.5b. You can generate the bin file to copy in the mass storage simpy using the Lora.bin

_images/lorabin.jpg
Processor Expert

The Kinetis software development kit (KSDK) is an extensive suite of robust hardware interface and hardware abstraction layers, peripheral drivers, RTOS abstractions, stacks, and middleware designed to simplify and accelerate application development on Freescale Kinetis MCUs. The addition of Processor Expert technology for software and board configuration provides unmatched ease of use and flexibility. Included in the Kinetis SDK is full source code under a permissive open-source license for all hardware abstraction and peripheral driver software. Mainline releases include support for a collection of Kinetis MCUs, whereas standalone releases offer support for one or a few additional Kinetis MCUs only. For details read KSDK page.

Hardware Guide

The board is provided with:

  • NXP MKL26Z microprocessor
  • NXP MK20DX128VFM5 microprocessor
  • Microchip RN2483 Module
  • Light Sensor
  • Reset button
  • Wake-up button
  • NXP FXOS8700CQR1 Accelerometer and Magnetometer sensor
  • LEDs which one is used directly by KL26Z

The Microchip RN2483 module provides LoRaWAN™ protocol connectivity using a simple UART interface. The NXP MKLS26Z is connected to the Microchip modules using the configuration 57600 8N1 without using RTS, CTS lines. Last version used is 1.0.1.

The Light Sensor is read from the ADC converter peripheral of the MKL26Z.

The Accelerometer sensor is read from I2C interface.

The microcontroller uses the deep sleep mode VLPS, it is waken up by LPTimer every 30 seconds or by pin interrupt connected to the S2 button.

Configuration RN2483

The connection used by RN2483 is ABP (Activation by Personalization). To use this connection it is required to setup the RN device only one time. Every Lora Sensor Node bought is already configured. The commands used were:

sys factoryRESET
sys get hweui
mac set deveui [hweui key read]
mac set devaddr [last less significant hexs of hweui key]
mac set appskey AFBECD56473829100192837465FAEBDC
mac set nwkskey [hweui key repeated two times]
mac save

After saving this setup is not required repeat the opeation of setup. In order to send data in the Lora network the two used commands are:

  • mac join abp: used to join the Lora network
  • mac tx cnf 4 18AABBCC48DD0000: used to send the frame “18AABBCC48DD0000” on the port 4
Datasheet and more

Please refer to Avnet Silica website.

How to fix the MBED firmware

This procedure has to be followed only if the MBED mass storage it isn’t recognized when you connect the board to the PC and the MBED drivers are installed in windows. The board uses the MK20 microprocessor in order to implementing the MBED interface. In this guide we will upload the firmware for the MK20. In this way the MBED interface will work again.

  1. Connect the board to the PC via USB cable.
_images/board_usb.jpg
  1. Switch on the Lora Sensor Node keeping the S3 button pressed.
_images/board_usb_on.jpg _images/board_s2_s3.jpg
  1. If the previously steps are done correctly will appear a window named BOOTLOADER.
  2. Download the file k20dx128_kl26z_if_mbed.bin.
  3. And copy the file k20dx128_kl26z_if_mbed.bin into the BOOTLOADER mass storage.
  4. The Green led on the board will blink while the file is programmed into the device flash memory.
  5. Unplug and replug the board from the PC. If the procedure has been successfull will popup the MBED window.
  6. Now with the MBED window it is possible update the firmware for the KL26Z microprocessor. See the Quick start guide for firmware 1.4 or major paragraph.