Monday, 28 July 2014

stm32 - CubeMX HAL Libraries state or stateless




I wonder if the STM32F4 CubeMX peripheral HAL libraries saves the internal state of the peripherals OR if they are stateless? I am concerned about this because I want to know the possibility and safety of mixing the use of HAL libraries with direct register accesses at places where time-saving is more critical.



Answer



Look at the Low Level library (LL) this provides a much lighter weight wrapper around the registers.



You can generate the LL code from Cube by selecting LL from the advanced settings tab in the Project Manager section.


You should see a list of peripherals and be able to select HAL or LL. I have not had much joy in mixing HAL and LL so generally pick one or the other for every peripheral. As for the state held by each peripheral the best place to start looking is the reference manual Cheers.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...