Performance Comparison: STM32 HAL vs mbed

30 Jan 2018

Hey guys, I am really new to STM32 development using the Nucleo boards. I have been exploring both toolchains of using the mbed library as well as making use of the STM32CubeMX/SW4STM toolchains. I have figured out how a simple example like blinking led works for both methods of development. But one thing that is of concern to my present project is code performance. I come from a software engineering background so I have a pretty good understanding that sometimes when libraries are wrapped in layers, it could present some performance degradation. But being new to embedded systems, I'm doing my best to refrain from passing the same judgment. But to those whose familiar with both or either methods, can you share with me what your thoughts are when it comes to performance comparison between the two methods of development?

P.S. I do admit that using mbed requires a lot less coding. But I have also read one of the posts/replies from someone in this community. mbed C++ is like 7 layers on top of the hardware, whereas coding with HAL is at maybe level 3/4 I think.

05 Feb 2018

If you're concerned about code size then the ST HAL is probably smaller. The tradeoff with mbed is portability and ease of use, but it comes at the cost of code size. That said most MCU's these days are CortexM with more size and speed than you will actually use, so its kind of a null concern.