How to use the the LoRaWAN example code in MDK

If you had purchased our LoRa Node 151, LoRa Kit 151, Turtle Board, We will provide LoRaWAN example project (MDK5 version).

  • If you directly purchased from our website, you can see the download area in your account.
  • If purchased from our reseller, just contact your provider or email to us directly (

Here is the simple manual about how to use it:

1. Change the relative EUI, Key in Commissioning.h


  • Use OTAA, keep OVER_THE_AIR_ACTIVATION macro definitions 1;
  • Use ABP, change OVER_THE_AIR_ACTIVATION macro definitions 0;

2. Set the right sending frequency in the node example code

  • Change working band via Keil macro definitions

Click the C/C++ label, chang the red line with your working band

  • Determining that the listening frequency of the gateway is the same as the sending frequency of the node. The node’s sending frequency relative code.
    For example, the 915MHz sending frequency band is here (in LoRaMac.c);

Other band’s sending frequency also in LoRaMac.c file too.

Compile and download the .hex /.bin / .elf file into Node 151, it should working.

3. Print debug log via USB_CDC (USB virtual com port) or UART

  • Print via UART, please refer to this page: LoRa Node 151 debug log print problem
  • Print via USB_CDC (USB virtual com port)
    Add both USE_DEBUGGER and USB_VCP to the Keil Marco definitions:

If it’s working (via USB_CDC):

4. Enable low power

Just remove USE_DEBUGGER and USB_VCP in Keil macro definitions, recompile and redownload to your board. Test the current in the batter, if close to those value, it’s working:

Relative document:

How to Use Lora Node 151 and send data To TTN

How to Download Firmware into LoRa Node 151

I purchased three units of lora node 151 and never received the code samples despite my emails :roll_eyes::confused:

Oh, sorry.

Can you please send a simple email to We will provide it to you.


The basic example is working fine with STM32Cube. I get a Lora payload every 30 sec with OTAA on my 868Mhz TTN gateway.

But if I add the USE_DEBUGGER and USB_VCP symbols and compile with the Debug profile, the board doesn’t start anymore (no Lora transmission, no active port available)

I tested on two different boards, with power from USB or battery.

I suspect it crashes at startup but no way to confirm that.

Can you help ?

As we tested, the example code was working fine with USE_DEBUGGER and USB_VCP.

Which version example code did you use?

I have the version you emailed me on July, 19 since I don’t access resources from my personal space (I created an account after buying my nodes)

Can you provide me with any newer version that would fix the issue ?


I think your problem is caused by path setting, you may import this project manually, not auto-import by the software. can you check the “Include” and “Source Location” label?

I think what you mean is that after adding



#define USB_VCP

, does the node become unresponsive?

Yes, with the USB_VCP flag, I get no message on my Lora gateway.

Since I have no way of connecting to the node (no COM port appearing when I plug it) it is very hard to resolve.

I did a similar attempt again.

The node works fine and I can’t repeat what you said.
Can you tell me more about the details? I think this may be an uncommon case.


I am using the project archive from July, 22 and use the Debug profile in STM32Cube. Build succeeds in this profile both with and without the USB_VCP flag.
Without the flag, the node starts, join and send a lora message every 30sec.
With the flag, no join, no message and no way to connect to the node COM port.

Would you mind sharing your project so I can try to build and upload from your working source ?


No problem, of course, please contact me at

If you find other problems during use, you are welcome to continue to the discussion forum.

Wish you have a nice day.:grinning: