TDD in avr microcontroller

54 views
Skip to first unread message

Cristian Chacha

unread,
Aug 11, 2023, 6:58:41 AM8/11/23
to ThrowTheSwitch Forums
Hello.

I just read a TDD embedded C and I would like to test in atmega328p, but I have a strange behavior, compilation process its ok but execution in atmega328p not corresponding with test in host . I only use a TEST_FAIL_MESSAGE macro.

I'm using cmake to compile, let me share my github repo: https://github.com/CristianChachaLeon/TDD-atmega328p

you can reproduce in your side. I can see 2test run , but when I add a test without added in Test_group ( I think that this change may not have effect) execution in atmega-328p fail, no show run test.

Any idea, or maybe Unity-C test is not developo for avr microcontroller ?

Mark Vander Voord

unread,
Aug 11, 2023, 8:44:48 AM8/11/23
to throwth...@googlegroups.com
Unity definitely works on AVR. It's been awhile, but I've used it for testing AVR code myself. It appears that you're building test code to run on the AVR directly. This isn't usually a good way to do unit testing (see this article: ). Plus, if you run on the host and/or simulator, then you can simulate a larger version of the same part and handle larger test cases.

Atmega's are small parts. You'll want to disable any features you're not using. In your case, things like floating point support or 64 bit numbers seems like a good place to start.

I don't work with the unity_fixture addon, so I don't have any advice for the way you're working with the code. Perhaps someone who uses the addon will jump on and have more specific advice.

Mark

--
You received this message because you are subscribed to the Google Groups "ThrowTheSwitch Forums" group.
To unsubscribe from this group and stop receiving emails from it, send an email to throwtheswitc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/throwtheswitch/332393e4-da36-4c24-830c-ed15f87bd29bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages