2025-08-31 11:52 PM
I'm developing a LoRaWAN device using STM32CubeIDE with the LoRaWAN stack (SubGHz_Phy and LoRaMac) on an STM32WLE5JCI6 microcontroller. When I try to enable the AS923 region, I'm consistently getting the debug error DEBUG: Region not defined in MW, which prevents the stack from initializing correctly.
I've taken the following steps to troubleshoot the issue:
Project Settings: I've confirmed that -DREGION_AS923 is added to the compiler's defined symbols and that other region-specific files, like RegionAU915.c, are excluded from the build.
Code Modification: I changed the switch statements in Region.c to use direct function calls with case LORAMAC_REGION_AS923: instead of macros like AS923_...(). This resolved the compiler warnings, but the runtime error persists.
Based on the logs, LmHandlerInit attempts to initialize with region 9, so the value seems to be passed correctly. I suspect the issue is that the compiler is not correctly linking the functions from RegionAS923.c with the calls in Region.c and LmHandler.c.
Could anyone with advice or similar experience please help me resolve this?
I am using an AI to formulate this question.
Thank you.
R_JPstudent