2021-05-18 06:07 PM
TL;DR version:
Is there a way to set/check the microcontroller software embedded pack you're using (ie stm32wb55 V1.11.1)?
I was working on trying to get a Stop2 Low Power mode working and was running into some issues so I checked the forum. I came across as post by @Scott L�hr that it was easy as of version 1.8. Below is the thread it discussed this (if you're interested):
He had mentioned it could be done in 4 lines:
LL_PWR_SetPowerMode(LL_PWR_MODE_STOP2);
LL_LPM_EnableDeepSleep();
__WFI();
sysClkCfg();
I tried the code but it didn't recognize the EnableDeepSleep command. I started looking through the *.h files and, sure enough, it wasn't there. I have several different package versions so I created a new project from scratch to see if it was there and it wasn't there in a recent one either.
So, the question I eventually came down to was, how do I know what version I'm actually running? Can I switch between versions? I currently don't even know what framework my projects are running on and, as much as I want to get the sleep commands to work (I'm sure it's easy enough), not knowing what version of framework I'm currently running on seems like a potentially bigger issue (depending on changes/updates made in different versions).
If you guys could help me find out where I can look to check/set which package I'm using, that would be awesome! I tried searching around in project folders but didn't have any luck.
Thanks!
Solved! Go to Solution.
2021-05-18 07:00 PM
> So, the question I eventually came down to was, how do I know what version I'm actually running?
There is this:
**
* @brief STM32WLxx HAL Driver version number
*/
#define __STM32WLxx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
#define __STM32WLxx_HAL_VERSION_SUB1 (0x00U) /*!< [23:16] sub1 version */
#define __STM32WLxx_HAL_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
#define __STM32WLxx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
#define __STM32WLxx_HAL_VERSION ((__STM32WLxx_HAL_VERSION_MAIN << 24U)\
|(__STM32WLxx_HAL_VERSION_SUB1 << 16U)\
|(__STM32WLxx_HAL_VERSION_SUB2 << 8U )\
|(__STM32WLxx_HAL_VERSION_RC))
...
/**
* @brief Returns the HAL revision
* @retval version : 0xXYZR (8bits for each decimal, R for RC)
*/
uint32_t HAL_GetHalVersion(void)
{
return __STM32WLxx_HAL_VERSION;
}
The HAL version and the package version can be different. For the STM32WL and some other families, they appear to coincide.
> Can I switch between versions?
In general, yes, but some things do change between versions that may require changes to your code. I would stick with one version once you get it working unless you need features or big fixes in later version. If you're using CubeMX to regenerate code, switching between package versions is easy.
2021-05-18 07:00 PM
> So, the question I eventually came down to was, how do I know what version I'm actually running?
There is this:
**
* @brief STM32WLxx HAL Driver version number
*/
#define __STM32WLxx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
#define __STM32WLxx_HAL_VERSION_SUB1 (0x00U) /*!< [23:16] sub1 version */
#define __STM32WLxx_HAL_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
#define __STM32WLxx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
#define __STM32WLxx_HAL_VERSION ((__STM32WLxx_HAL_VERSION_MAIN << 24U)\
|(__STM32WLxx_HAL_VERSION_SUB1 << 16U)\
|(__STM32WLxx_HAL_VERSION_SUB2 << 8U )\
|(__STM32WLxx_HAL_VERSION_RC))
...
/**
* @brief Returns the HAL revision
* @retval version : 0xXYZR (8bits for each decimal, R for RC)
*/
uint32_t HAL_GetHalVersion(void)
{
return __STM32WLxx_HAL_VERSION;
}
The HAL version and the package version can be different. For the STM32WL and some other families, they appear to coincide.
> Can I switch between versions?
In general, yes, but some things do change between versions that may require changes to your code. I would stick with one version once you get it working unless you need features or big fixes in later version. If you're using CubeMX to regenerate code, switching between package versions is easy.
2021-05-19 01:02 PM
Thanks for this! It does appear that my current project (and a fresh project I built on a newer software pack) both use the same HAL Framework version (V01.08.00.00). I think I now understand where my confusion was coming from. It sounds like the "software packs" do have HAL framework in it but the main difference between the files have to do with everything in the pack (including examples and such). So I can technically be using the same HAL version in two different software packs, which appears to be the case.
So yeah, now it makes a lot more sense to me. Thanks, @TDK ! I appreciate the help and insight!