DEV Community

loading...
Cover image for Home office for Embedded Developers

Home office for Embedded Developers

_vsaw profile image Valentin Sawadski ・2 min read

In light of Covid-19 I see a lot of people making the switch to work from home. However, I fear that in some cases embedded developers are not given the benefits of working from home due to outdated development methodologies, which still rely on HW more then necessary. Therefore I thought I'd give some pointer on how to lose the HW dependancy and work from home as an embedded developer.

Virtualizing HW

The way I see it, embedded developers have two options: taking HW home (which can be impossible or very impractical) or virtualise the HW

Besides easier logistics, virtualising the hardware has some added benefits:

  • Testability: Virtual HW is easy to mock, so you can run simulate and test abnormal sensor values and errors
  • Automatable: Virtual HW is much easier to set up than a real test bench. Therefore you can automate a lot more scenarios and run them more often
  • Portable: If you got it working in a virtual environment, you can also get it working on the new HW platform!

Emulation vs. Mocking

To virtualize HW you can go down two roads:

  1. Full HW Emulation a.k.a. run your binary on QEMU
  2. HAL Mocking a.k.a. compile your application for your host, and give it HW mocks

Full HW Emulation gives you greater depth, but it's much harder to setup and depending on your application possibly overkill.

Therefore in most of the cases I've decided for HAL mocking. In HAL mocking you will compile the source code for a different target machine (e.g. an Intel CPU running Linux) instead of the target HW (e.g. ARM) and replace all hardware specific files with mocks. It does not mimic your application as closely since you get a different binary, but the beauty of it though is that now you get a binary that you can run on your development workstation natively, including full access to native development tools like (debuggers, profilers and tests)!

Finally

To sum it up: Virtualize your HW and work from home with a much better development workflow!

So, out of curiosity how are you guys holding up? If you are working from home, share your setup! If not, tell us why not and maybe we can figure out how to get you home safely!

P.S. Hit me if you want to talk more about HW mocking. I would like to help allowing everyone to work safely from home!
P.P.S. Cover image by deldevries

Discussion

pic
Editor guide