I had B-L072Z-LRWAN1 board working with PlatformIO via built-in ST-LINK. I was able to upload programs and run them just fine.
Then, to read back DevEUI on Murata module, I switched to STM32CubeIDE and uploaded “LoRaWAN_End_Node” (demo program supplied by ST). This is maybe silly thing to do to just read DevEUI, but I don’t know any other way to do it.
I got the DevEUI and went back to PlatformIO and now I can’t upload anything to B-L072Z-LRWAN1.
The module is just a “STM32L072CZ microcontroller and SX1276 transceiver”, there is no item named “DevEUI” statically burned in these components by themselves. The way I read it, when it connects to a LoRaWAN network it uses the activation methhod
So it uses OTAA to join the network, which needs a DevEUI, AppEUI (and JoinEUI). Since the app is configured for
which means it will use a callback function to acquire the DevEUI as per
The callback is set through this function
which is used as
and callbacks->GetUniqueId from that function is sourced from
which initializes it as its input parameter
which finally at the highest level is called from here
so for the DevEUI, the function GetUniqueId here is used.
You can see this impelmentation here
The function LL_FLASH_GetUDN() only exists for the STM32WL devices here, so I assume it actuallyl is taking the upper path for the STM32L0 chip in the module. In that case, the UniquE ID is simply uses the 12-byte microcontroller’s unique ID (UID), which every STM32L0 (and others) microcontroller gets during the factory production process, and combines the first and last 32-bit word of that into a single 32-bit word, to get a 8 byte ID out according to the code above.
(Otherwise, in the lower path, which uses LL_FLASH_GetUDN() (4 bytes), LL_FLASH_GetDeviceID() (1 bytes) and LL_FLASH_GetSTCompanyID() (3 bytes) to generate the DevEUI).
So, to repeat, there is no directly designed “DevEUI” burned in the module, the code and this application just initializes the LoRaWAN stack in a way that uses the UniqueID of the microcontroller and specific transformation (addition of the first and last 32-bit word) to calculate the DevEUI. The application could have done that in an arbitrary way.
When creating a LoRaWAN device, one can also just generate any DevEUI in the LoRa Network Server (LNS), e.g., TTN or Chirpstack, and copy that value into the firmware of the firmware of the device, and it would work too.