cancel
Showing results for 
Search instead for 
Did you mean: 

Hi, i want to transform HAL function call 'HAL_I2C_Mem_Read_DMA' and 'Mem_Write' into Low Layer call. How it is done?

B_12159
Associate II

 I found examples in STM32CubeIDE but they don't concern the special topic 'Mem', meaning writing device address and internal register address together within one data packet.

3 REPLIES 3
Amira
Associate III

Hello B_12159,

The HAL and LL are complementary and cover a wide range of application requirements:

  • The HAL offers high-level and feature-oriented APIs with a high-portability level. These hide the MCU and peripheral complexity from the end-user.
  • The LL offers low-level APIs at register level, with better optimization but less portability. These require deep knowledge of the MCU and peripheral specifications.

But mixed use of low-layer APIs and HAL drivers is possible, several examples showing how to use HAL and LL in the same application are provided within stm32f4 firmware package (refer to Examples_MIX projects).

You can refer to the following user manual for more details (5.2 section) : https://www.st.com/resource/en/user_manual/dm00189702-description-of-stm32f7-hal-and-lowlayer-drivers-stmicroelectronics.pdf

PS: Once your question is answered, please click on "Select as Best" for the comment containing the answer to your initial question.

I would this help you !

Thanks & Regards,

Amira

B_12159
Associate II

Hello Amira, thanks for your answer. Mixing is big problem. I have to choose HAL or LL in CubeIDE. LL is mandatory in my application. Have to fit in motor control application. I already used HAL in this case but it was too slow. Working with MC Workbench stopped.

Amira
Associate III

If I'm not wrong, you're using CubeMX to generate your code that's why you cannot MIX HAL & LL drivers ?