Skip to main content
Visitor II
August 22, 2020
Solved

Is HAL driver Require more space compared to LL?

  • August 22, 2020
  • 2 replies
  • 1541 views

i want to know which drivers require less space(small HEX FILE) and good optimization HAL or LL driver?

    This topic has been closed for replies.
    Best answer by Piranha

    Yes, HAL takes much more code space and is terribly buggy and ineffective. And LL is useless, because it is just a register/bit redefinition and doubles the amount of information one has to learn. Using it one has to look at LL code and translate LL function names to register/bit names back and forth all the time to find them in reference manual. LL is not so terrible, but it's not very effective either, because mostly every bit is set with a separate RMW (read-modify-write) operation, while with direct register access it can be done with a single RMW in a single C code line.

    2 replies

    PiranhaAnswer
    Graduate II
    August 22, 2020

    Yes, HAL takes much more code space and is terribly buggy and ineffective. And LL is useless, because it is just a register/bit redefinition and doubles the amount of information one has to learn. Using it one has to look at LL code and translate LL function names to register/bit names back and forth all the time to find them in reference manual. LL is not so terrible, but it's not very effective either, because mostly every bit is set with a separate RMW (read-modify-write) operation, while with direct register access it can be done with a single RMW in a single C code line.

    Super User
    August 22, 2020

    HAL definitely produces larger code than LL, which produces larger code than direct access.

    FLASH space is typically not a concern unless you're developing on a chip with 64kB or less of RAM.