Pigweed: A Collection of Embedded Libraries
opensource.googleblog.com
Pigweed: A Collection of Embedded Libraries
1–10 of 14 posts
Re: Pigweed: A Collection of Embedded Libraries
#2Is it bare-metal embedded developers? Can it work with yocto or buildroot for those who rely on deploying linux on embedded?
Re: Pigweed: A Collection of Embedded Libraries
#3I'm just starting to wrap my head around embedded development but what kind of audience is this aimed at? Is it bare-metal embedded developers? Can it work with yocto or buildroot for those who rely on deploying linux on embedded?
Re: Pigweed: A Collection of Embedded Libraries
#4Re: Pigweed: A Collection of Embedded Libraries
#5In the embedded space I've found unit tests to mostly be useful for testing logic and algorithms but not terribly useful for testing hardware integration, which is where all the really painful and tedious problems happen. If the unit test passes on the board but fails on your host it's likely due to a compiler bug or a bug in the MCU, and you usually just work around those.
What would be more interesting is creating an environment to support manual and automated integration and system-level testing. I haven't seen such a system in practice because such systems require a very lengthy and painful characterization of the system under test. They also require hardware support, meaning a tool needs to be integrated with the software to interface with and measure the output of the system under test. These can range from simple I2c-based GPIO expanders for monitoring and controlling IO lines to pressure and flow meters for pneumatic measurements, or current probes for instantaneous and aggregate power draw measurements. This is more like laboratory automation so I think a lot of software people try to avoid doing these things.
Do you have any plans to implement APIs that might enable development of such a system in the future?
Re: Pigweed: A Collection of Embedded Libraries
#6> Pigweed’s pw_watch module solves this inefficiency directly, providing a watcher that automatically invokes a build when a file is saved, and also runs the specific tests affected by the code changes. This drastically reduces the edit-compile-flash-test cycle for changes.
Eh, no thanks. Web dev environments can get away with this because the turnaround time is so quick, but even a medium sized embedded C++ project can easily take minutes to build, plus 30+ seconds to download, even with a debugger.
Please don't try to bring webdev workflows into the embedded space. This isn't javascript.
Re: Pigweed: A Collection of Embedded Libraries
#7Correct me if I'm wrong, but this seems to run unit tests on the embedded target. Why? In the embedded space I've found unit tests to mostly be useful for testing logic and algorithms but not terribly useful for testing hardware integration, which is where all the really painful and tedious problems happen. If the unit test passes on the board but fails on your host it's likely due to a compiler bug or a bug in the M…
Re: Pigweed: A Collection of Embedded Libraries
#8> This is a huge disparity from web development workflows where file watchers are prevalent—you save a file and instantly see the results of the change. > Pigweed’s pw_watch module solves this inefficiency directly, providing a watcher that automatically invokes a build when a file is saved, and also runs the specific tests affected by the code changes. This drastically reduces the edit-compile-flash-test cycle for c…
Re: Pigweed: A Collection of Embedded Libraries
#9> This is a huge disparity from web development workflows where file watchers are prevalent—you save a file and instantly see the results of the change. > Pigweed’s pw_watch module solves this inefficiency directly, providing a watcher that automatically invokes a build when a file is saved, and also runs the specific tests affected by the code changes. This drastically reduces the edit-compile-flash-test cycle for c…
And then pushing it to a target and testing it. Again, are you nuts? I work in the real world, with physical devices that can and will break if I misuse them. Blindly flashing my latest unfinished change is a great way to wreck equipment, even if it happens to compile.
Maybe it makes sense for something like the MCU on a network switch. But it doesn't sound like something I want anywhere near any codebase I'm committing to.
Handling the dependency management and environment is nice though. That part is absolutely a low-grade irritation that would be nice to get rid of.
Re: Pigweed: A Collection of Embedded Libraries
#10Correct me if I'm wrong, but this seems to run unit tests on the embedded target. Why? In the embedded space I've found unit tests to mostly be useful for testing logic and algorithms but not terribly useful for testing hardware integration, which is where all the really painful and tedious problems happen. If the unit test passes on the board but fails on your host it's likely due to a compiler bug or a bug in the M…
I've found a lot of value in running unit tests on target hardware. For one thing, it means you can actually include peripheral drivers in the test. Also, as you said, embedded compilers tend to be more buggy than host compilers. I've actually found compiler bugs through embedded unit testing.
Running them on-target is more of an integration test -- useful too, obviously, but gives a quite low level of assurance.