Skip to main content
Visitor II
July 7, 2021
Question

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

  • July 7, 2021
  • 3 replies
  • 994 views

 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.

    This topic has been closed for replies.

    3 replies

    Visitor II
    July 7, 2021

    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_12159Author
    Visitor II
    July 7, 2021

    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.

    Visitor II
    July 7, 2021

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