Just for future reference, here is how to configure the STM32 I-CUBE-LRWAN library for OTAA.
I now understand my basic mistake in configuring it, as discussed in OTAA Join Debugging.
Although there are some hints in the library code, mentioning LoraWAN 1.1.x specification, the project comes pre-configured using LoraWAN 1.0.x spec.
I just read carefully through the comments in
Commissioning.h and now understand, the Constant
LORAWAN_NWK_KEY has to be set to equal
LORAWAN_APP_KEY. Then, the
keyID = NWK_KEY can be left as it originally is. There is a #define switch in
LoRaMacCrypto.c to change to LoraWAN 1.1.x spec, but this causes my compiler to fail with a warning the program would not fit into memory any more.
So when staying with the default value of
#define USE_LRWAN_1_1_x_CRYPTO 0
LoRaMacCrypto.c, make sure you set
#define LORAWAN_NWK_KEY LORAWAN_APP_KEY
Then not only the Join Request will be signed with a valid MIC, but also the Join Accept Response by the Network will be understood by the End Node.
I couldn’t really find that pointed out clearly in ST’s documentation, also most online-tutorials won’t use OTAA but ABP and therefore use totally different settings in this file.
Hope this helps whoever might run into the same problem.