cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32WLE5JC][LoRaWan - End_Node] How to change device_eui, epp_eui, app_key from program ?

SC26
Associate II

Hi,

I have build a custom application from end_node project example on LoRa-E5 board.

All works fine with comissioning from CubeMX.

But now I want to use values loaded from flash.

So I added 3 variables :

uint8_t device_eui[8];

uint8_t app_eui[8];

uint8_t app_key[16];

I can read/write values from flash.

But now : how to use this values for LoRa-Wan OTAA joining ???!!!!

How could this be sooooo hard to do ???!!!!!

Thanks for help.

17 REPLIES 17
Andrew Neil
Evangelist III

The software does OTAA as-is - no changes needed. ��

See this series of videos:

https://www.youtube.com/watch?v=vuc6914B0KM - Part 1; parts 2 & 3 follow

SC26
Associate II

Hi,

I know OTAA is well done ... that's not my answer.

The question was : how to change End device commissioning parameters without rebuibind firmware for each device ?

( I already have read this parameters in variables from flash )

thanks.

SC26
Associate II

I have look the 4 video ... not what I'm lokoing for ... he just edit identity.h to change commissioning parameters ...

As it tells you in those videos, the Device EUI is taken from the STM32's unique ID.

To change the other parameters, just look at where those values get used - use your IDE's browsing facilities - and supply your own instead.

I have try that ... And don't find.
So i ask here ...

So how far did you get with that? Where are you stuck?

SC26
Associate II

The problem is to find where set parameters in the end_node example project.

Of course this must be in USER CODE BEGIN / USER CODE END section for not beiing overwrite by CubeMX on next code generation ...

SC26
Associate II

In anycase : thanks for your answers ;)

SC26
Associate II

Where am I ?

I have found in "se-identity.h" all the MX's #define :

#define LORAWAN_DEVICE_EUI                 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }

#define LORAWAN_JOIN_EUI                  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }

#define LORAWAN_APP_KEY                  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

And also found where they are used :

[ soft-sec.c :: 527 ]

SecureElementStatus_t SecureElementInit( SecureElementNvmData_t *nvm, SecureElementGetUniqueId seGetUniqueId )

But this section is not user-allowed.

I also see some tools functions :

SecureElementStatus_t SecureElementSetKey( KeyIdentifier_t keyID, uint8_t* key )

SecureElementStatus_t SecureElementSetDevEui( uint8_t* devEui )

SecureElementStatus_t SecureElementSetJoinEui( uint8_t* joinEui )

But I don't found how (from where) I can use this ...