cancel
Showing results for 
Search instead for 
Did you mean: 

Is HAL driver Require more space compared to LL?

parth kothiya
Senior

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

1 ACCEPTED SOLUTION

Accepted Solutions
Piranha
Chief II

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.

View solution in original post

2 REPLIES 2
Piranha
Chief II

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
Guru

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".