cancel
Showing results for 
Search instead for 
Did you mean: 

Is license needed to use MotionAC libraries

owain-home
Associate III

Hi,

I am working on project using ZephyrOS and I am trying to link in and use some of your motion libraries.

I have successfully linked but the call to MotionAC_GetLibVersion() is returning zero. Looking at assember in my debugger a variable is being tested at the start of that routine "licenses_ok". This leads to the call exiting.

What must I do to use the library? Are any license files necessary; I thought the libs were free to be used if you are using ST chipsets?

Regards,
Owain

1 ACCEPTED SOLUTION

Accepted Solutions

I think I have managed to pull in the HAL_CRC_Init(); this is being called before the AC library Init. I am still getting the same failure as before. See screenshot;  as far as I have decoded in assembler it is checking some CPU ID registers; some system ROM tables; then doing some CRC stuff before spinning/asserting?
Is it checking some kind of license?

Is it spinning as license not valid?



View solution in original post

8 REPLIES 8
Miroslav BATEK
ST Employee

Hello Owain,
you have to first call MotionAC_Initialize() functions. Please be aware the library is designed for STM32.

I am using STM32H7 library. Currently just running check to check feasibility of using STM motion libraries from zephyr system. Currently not plumbed in the low level zephyr based driver to the library; but had/have called MotionAC_Initialize() as you suggested. 

I see in assembler the processor spinning @ MotionAC_Initialize+0x4c.

Obviously I do not have visibility of exact issue here. I can only assume it is some form of ASSERT. Prior to the spin a few variables are checked to see if initialised. I assume these being some kind of globals to check other libraries of initialisations have been done.

I am working from the um2182-getting-started-with-motionac-accelerometer-calibration-library-in-xcubemems1-expansion-for-stm32cube-stmicroelectronics.pdf and looking to the AccelerationCalibration example. I can only guess that the GPIO, DMA, CRC and RTC related initialisations prior to the motionAC_Initialize() are "hidden" dependencies.
I can see some code included in zephyr related to stm32 cube; but this seems to be just lower level processor clock config related.

Any idea how to proceed; I think the STM Motion libs are stripped so I have limited visability.
Any hints here.

Looking at my zephyr map file I can see various stm32cube modules pulled int te system at low level; but it would be good to have some more hints at what these dependencies are. What I really need to have to do to use this library; shame zephyr is not one of the OS flavours a shrink wrapped example is given for.

 

 

Miroslav BATEK
ST Employee

Please enable CRC peripheral, it is mandatory for library initialization. No other peripherals are needed.

Hi Miroslav,

are you saying that the HW CRC needs initialising or are you saying that the actual STM HAL function HAL_CRC_init() must be called. As you probably know Zephyr is not very STM centric.

So do I need to just do the HW initialisations of HAL_CRC_Init(); I assume you mean just do the appropriate HW initialisations (as I don't see any undefined calls from the MotionAC lib; must mean MotionAC just uses direct HW accesses to CRC unit? If it uses it at all?).
I shall try.

 

I think I have managed to pull in the HAL_CRC_Init(); this is being called before the AC library Init. I am still getting the same failure as before. See screenshot;  as far as I have decoded in assembler it is checking some CPU ID registers; some system ROM tables; then doing some CRC stuff before spinning/asserting?
Is it checking some kind of license?

Is it spinning as license not valid?



Did you also enable clock for CRC peripheral __HAL_RCC_CRC_CLK_ENABLE(); ?

It is checking if it is running on STM32.

I suspect no HW clock enable in RCC AHB4ENR for CRC.

Commented out the HAL_CRC_Init(); added the __HAL_RCC_CRC_CLK_ENABLE();
Lib init worked and I can read the library version.
"ST MotionAC v2.6.1"
Thanks for your help