Skip to main content
parth kothiya
Associate III
Aug 22, 2020 11:11 AM UTC
Solved

Is HAL driver Require more space compared to LL?

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.
Piranha
PiranhaBest answer
Principal III
Aug 22, 2020 11:34 AM UTC

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

Piranha
PiranhaBest answer
Principal III
Aug 22, 2020 11:34 AM UTC

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.

TDK
Aug 22, 2020 12:26 PM UTC

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.

"If you feel a post has answered your question, please click ""Accept as Solution""."