Possible issue with LPM calls in generated code for STM32WB?
I've found something curious in the code generated by CubeMX for a BLE application on STM32WB. In APP_BLE_Init we have this:
/**
* Do not allow standby in the application
*/
UTIL_LPM_SetOffMode(1 << CFG_LPM_APP_BLE, UTIL_LPM_DISABLE);My understanding is that this prevents CPU1 from going into standby while CPU2 is booting. Then, in APPE_SysUserEvtRx, we have this:
UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);Again, my understanding is that this is in response to a message from CPU2 indicating that it has finished booting, so standby mode can once again be enabled.
However, what I've just noticed is that these two calls use different IDs (the first disables standby mode for CFG_LPM_APP_BLE, and the second enables it for CFG_LPM_APP). The effect is that standby mode is never re-enabled when CPU2 finishes booting.
These are the only two calls to UTIL_LPM_SetOffMode in the generated code, so it seems unlikely that the change in ID is intentional--why would we see exactly one disable and one enable, but for different IDs?
Is this intentional, or a bug in the generated code? If it's intentional, can someone explain to me in a little more detail where the missing enable/disable for each ID should go?
Thanks!
Michael
