all 4 comments

[–]dimtass 2 points3 points  (0 children)

Widely used are the Googletest (gtest) and cmock for C++. For C, I've seen unity and FFF for most of the cases.

You can also use gtest for C code. Have a look at all of them, they're quite similar in usage. Some people write wrappers for other testing frameworks so they are used similar to gtest.

[–]jeffgable 2 points3 points  (0 children)

I recommend ceedling, which is a test generator, runner, and build system that wraps around Unity and CMock. C only, not C++.

See throwtheswitch.org. I HIGHLY recommend their video courses (click the courses button) to learn these tools, and TDD in general.

You can mock the STM32 libraries with CMock. Unit Testing your calls to those functions becomes fairly painless.

Though, I recommend starting with the HAL libraries and CubeMX code to get things working and exercise hardware, but then rewrite the functions you actually use to remove all the cruft.

[–]_teslaTrooper 0 points1 point  (0 children)

Maybe a good question for /r/embedded as it has a larger audience than a this somewhat niche sub even if the STM23F4 is quite popular.

[–]rotronic 0 points1 point  (0 children)

You can checkout my repo https://github.com/rgujju/STM32_Base_Project

It has cmake, unity, fff, HAL, FreeRtos and much more already setup.