Tag Archives: build

A New Modular CMake Based Toolchain for Feather M0 HAL

In the past months, I developed firmware for a few Adafruit Feather M0 based projects. The reason why I use the Adafruit Feather platform, instead of using an MCU directly, is for modularity.

By using a board on sockets, it can be replaced at any later time with a more powerful one – or by one with additional peripherals.

The only downside of these boards is the programming toolchain. Either you use the Arduino IDE, or solder wires to the board to program the MCU directly using, e.g. Atmel Studio.

Using the Arduino IDE, I am bound to some really horrible written libraries. It is probably a good thing if you are really new to the concept of programming and just likes to get things working. In the long run, I think using these libraries will lead to bad coding habits. Yet, I like the simplicity of using this IDE – compiling and uploading the firmware using the bootloader.

The Atmel IDE is a pure Windows solution with a professional Visual Studio based IDE, introducing unnecessary complexity. The MCU is usually programmed directly, overwriting the bootloader.

So I worked on a compromise: A simple toolchain, which is reusing the tools from the Arduino IDE, also gives the comfort of the simple build and upload process, but it is based on CMake, a modular and widespread build system.

It is not meant to use for beginners. The idea is to provide a system which can be used in a prototype stage from professionals. Writing code to a fully abstract HAL which can later easily migrated to a professional firmware.

In this article, I will briefly describe this toolchain for the Feather M0 HAL. As for the HAL, it is a work in progress. It is meant as inspiration and example.

Requirements

I successfully tested the toolchain on macOS and it should work on Linux. There are a few requirements for both systems:

  • Works with any Adafruit Feather M0 based board.
  • Arduino IDE 1.8.9+
  • Python 3.7+
  • CMake 3.14+
Continue reading A New Modular CMake Based Toolchain for Feather M0 HAL

Cat Feeder Device (Quick Build)

I finished a very simple and quick project recently. It is a programmable cat feeder device. The device is just made for one single portion, but it uses this slide which produces the distinctive sound if the pellets hit the bowl. It is no replacement for the usual feeding of the cat, but some flexible addition to give food out of the regular times.

The whole build was done in roughly four days, using a very quick prototyping and build method.

Design and Build Process

First I had to make a decision about the final size of the device. I used Autodesk Fusion360 to create a model of the device and try to fit all required parts into the device.

Cat Feeder Construction

This is one of the last designs I made until I had the right size. I used a different mechanism as shown here, the important part was to get the right size.

Next I bought plywood in the right sizes for the outer shell of the case. I also got some additional panels fitting inside of the shell for the internal structure.

lucky-resistor-1

I created the shell with four sides, left the top and front side open. To work quickly I fastened the panels with hot glue in place. This has the benefit that you can remove panels using a hot air gun in the prototyping stage.

Continue reading Cat Feeder Device (Quick Build)