cancel
Showing results for 
Search instead for 
Did you mean: 

Enabling multiple LoRa regions on STM32WLE5JC

helixembedded
Associate II
Hello
We are developing a LoRa product using the STM32WLE5JC, and firmware package v1.3.0.
We would like to enable multiple regions. From the STM32CubeIDE we open the .ioc file, which opens up the configuration GUI. There we have the possibility of enabling multiple regions. We have chosen this antenna for the application.
  1. When multiple regions are chosen, how does this setting work exactly? Specifically, how does it work in relation to the "Active region" setting. Even though multiple regions are chosen, there can only be one active region.
  2. What is the purpose of the "Enable Hybrid mode" setting?
  3. With multiple regions enabled - consider this scenario: if a device is in the EU and then moves to the US, how will that work?
  4. With multiple regions enabled, would a sensible implementation be then to implement a downlink message to set the "active region"?
Thanks
1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @helixembedded 

When you enable multiple regions in the STM32CubeMX configuration GUI, the firmware will include the necessary code and configurations to support all the selected regions. This means that the device will have the capability to operate in any of the enabled regions, but only one region can be active at any given time. The "Active region" setting determines which region the device will use for its LoRaWAN operations. Even though multiple regions are enabled, the device can only operate in one region at a time. The active region is typically defined in the lora_app.h file with a line like:

 

#define ACTIVE_REGION LORAMAC_REGION_EU868

 

This setting must match one of the regions defined in lorawan_conf.h:

 

#define REGION_EU868
#define REGION_US915

 

The active region must be one of the enabled regions in lorawan_conf.h for the device to function correctly.

 

The "Enable Hybrid mode" setting is used to manage the channel mask configuration for regions like US915, where there are a large number of channels. Enabling hybrid mode allows the device to use a subset of channels, which can be beneficial in environments with limited network infrastructure. This setting is defined in lorawan_conf.h:

 

#define HYBRID_ENABLED 1

 

When hybrid mode is enabled, the device will use a predefined subset of channels, which can help in scenarios where the gateway supports only a limited number of channels.

 

If a device moves from one region to another (e.g., from the EU to the US), the active region must be updated to match the new region. This can be done through a downlink message from the network server. The downlink message can instruct the device to change its active region by updating the ACTIVE REGION macro. This approach ensures that the device operates correctly in the new region without manual intervention. The Downlink must happen on the last Communication before changing the region.

PS: in this case, don't forget to change the Region definition to use a Variable and not a Macro so you can update it.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
Andrew Neil
Evangelist III

@helixembedded wrote:
We have chosen this antenna for the application.

AndrewNeil_0-1725356680060.png

 

Apart from the antenna, you'll also have to ensure that all the rest of your RF hardware (filters, etc) works within the requirements of all the intended bands.

 


@helixembedded wrote:

3. With multiple regions enabled - consider this scenario: if a device is in the EU and then moves to the US, how will that work?


The easiest solution would be to "decommission" it on leaving the EU region, and then "re-commission" it to US parameters on entering  or deployment in the US.

That may be required anyhow if you're using different network operators in the different regions...

If you want that to happen automatically, you'd have to give the unit some sort of location awareness (eg, GNSS).

 


@helixembedded wrote:

4. With multiple regions enabled, would a sensible implementation be then to implement a downlink message to set the "active region"?


How could that work?

If the device is set to EU then, when it arrives in the US, there will be no network there operating on the EU bands - so it won't be able to receive any downlink!

Do you have a network provider in mind with global coverage? Do they have any recommendations?

eg, this from TTN: https://www.thethingsnetwork.org/forum/t/gps-device-across-different-frequency-regions/29120/11

 

For the US example, the idea is that we would send a downlink message to the device to switch the active region before we ship it (we are based in the EU). We would then confirm the device is sending uplinks via our US Gateway, located in a test room at the office.


@helixembedded wrote:

the idea is that we would send a downlink message to the device to switch the active region before we ship it (we are based in the EU). 


Right - that should work.

You'd need to ensure that the unit did not transmit anything until it arrived in the new region ...

STTwo-32
ST Employee

Hello @helixembedded 

When you enable multiple regions in the STM32CubeMX configuration GUI, the firmware will include the necessary code and configurations to support all the selected regions. This means that the device will have the capability to operate in any of the enabled regions, but only one region can be active at any given time. The "Active region" setting determines which region the device will use for its LoRaWAN operations. Even though multiple regions are enabled, the device can only operate in one region at a time. The active region is typically defined in the lora_app.h file with a line like:

 

#define ACTIVE_REGION LORAMAC_REGION_EU868

 

This setting must match one of the regions defined in lorawan_conf.h:

 

#define REGION_EU868
#define REGION_US915

 

The active region must be one of the enabled regions in lorawan_conf.h for the device to function correctly.

 

The "Enable Hybrid mode" setting is used to manage the channel mask configuration for regions like US915, where there are a large number of channels. Enabling hybrid mode allows the device to use a subset of channels, which can be beneficial in environments with limited network infrastructure. This setting is defined in lorawan_conf.h:

 

#define HYBRID_ENABLED 1

 

When hybrid mode is enabled, the device will use a predefined subset of channels, which can help in scenarios where the gateway supports only a limited number of channels.

 

If a device moves from one region to another (e.g., from the EU to the US), the active region must be updated to match the new region. This can be done through a downlink message from the network server. The downlink message can instruct the device to change its active region by updating the ACTIVE REGION macro. This approach ensures that the device operates correctly in the new region without manual intervention. The Downlink must happen on the last Communication before changing the region.

PS: in this case, don't forget to change the Region definition to use a Variable and not a Macro so you can update it.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


@STTwo-32 wrote:

The downlink message can instruct the device to change its active region by updating the ACTIVE REGION macro.


Errr ... surely, the macro is a compile-time thing - it can't be changed at run time?

So the source code would need to be modified to change this from a macro to a (non-volatile?) variable ?

Sorry, I've forgot to mention this. I've update it now.

Best Regards.

STTwo-32

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

helixembedded
Associate II

Thank you both for your detailed feedback and input @STTwo-32  and @Andrew Neil !