Free RTOS

Getting Started With FreeRTOS And ChibiOS

If operating systems weren’t so useful, we would not be running them on every single of our desktop systems. In the same vein, embedded operating systems provide similar functionality as these desktop OSes, while targeting a more specialized market. Some of these are adapted versions of desktop OSes (e.g. Yocto Linux), whereas others are built up from the ground up for embedded applications, like VxWorks and QNX. Few of those OSes can run on a microcontroller (MCU), however. When you need to run an OS on something like an 8-bit AVR or 32-bit Cortex-M MCU, you need something smaller.

Something like ChibiOS (‘Chibi’ meaning ‘small’ in Japanese), or FreeRTOS (here no points for originality). Perhaps more accurately, FreeRTOS could be summarized as a multi-threading framework targeting low-powered systems, whereas ChibiOS is more of a full-featured OS, including a hardware abstraction layer (HAL) and other niceties.

In this article we’ll take a more in-depth look at these two OSes, to see what benefits they bring. Continue reading “Getting Started With FreeRTOS And ChibiOS”

An Anti-Tamper Mesh Plugin For KiCad

Physical access to electronics generally means all bets are off when it comes to information security. But in special cases this is just unacceptable and a better solution must be found. Consider the encryption keys used by point of sale machines. To protect them, the devices incorporate anti-tamper mechanisms that will wipe the keys from memory if the device is opened. One such technique is to use a mesh of traces on a circuit board that are monitored for any changes in resistance or capacitance. [Sebastian Götte] has been researching in this area and wrote a KiCad plugin to automatically generate tamper-detection mesh.

The idea is pretty simple, place traces very close to one another and it makes it impossible to drill into the case of a device without upsetting the apple cart. There are other uses as well, such as embedding them in adhesives that destroy the traces when pried apart. For [Sebastian’s] experiments he’s sticking with PCBs because of the ease of manufacture. His plugin lays down a footprint that has four pads to begin and end two loops in the mesh. The plugin looks for an outline to fence in the area, then uses a space filling curve to generate the path. This proof of concept works, but it sounds like there are some quirks that can crash KiCad. Consider taking a look at the code if you have the expertise to help make it more stable.

We’ve seen these anti-tamper meshes in practice in the VeriFone payment terminal that [Tom Nardi] tore down a couple of years ago. The approach that [Sabastian] took with the plugin actually produces a more complex mesh than was in use there as it only really used vertical lines for the traces.

Ask Hackaday: What’s Your Favourite Build Tool? Can Make Ever Be Usurped?

What do you do whilst your code’s compiling? Pull up Hackaday? Check Elon Musk’s net worth? Research the price of a faster PC? Or do you wonder what’s taking so long, and decide to switch out your build system?

Clamber aboard for some musings on Makefiles, monopolies, and the magic of Ninja. I want to hear what you use to build your software. Should we still be using make in 2021? Jump into the fray in the comments.

Continue reading “Ask Hackaday: What’s Your Favourite Build Tool? Can Make Ever Be Usurped?”

3D Printing 90° Overhangs With Non-Planar Slicing

When slicing a model for 3D printing, the part is divided into a stack of flat, 2D layers. But there’s an alternative in the form of non-planar slicing, where the layers can follow 3D curves. [Rene K. Mueller] took this a step further and successfully used non-planar slicing to print 90° overhangs on a normal Cartesian FDM printer.

Non-planar layers have been around for a while, but were generally limited to creating smooth curves without layer lines. The idea of using the technique for overhangs had been floating around in [Rene]’s head for a while, and he was spurred to action after seeing the rotating tilted nozzle printer featured here on Hackaday. The idea is only to have the outer edge of each layer overhang, by making each layer slope downward toward the overhang. [Rene] programmed a conic slicer algorithm for this purpose, which splits the model into dome-shaped layers, like an onion.

He did a lot of testing and documented the results in detail. Conical slices were compared with tilted slices, which are also used for belt 3D printers. Both have some geometric limitations. Tilted slices can only print the overhang in one direction, but conical slices can do this in all directions, allowing it to create a mushroom-like shape without any support. The limitation is that it can only print inward or outward from a central point. More complex geometry must be segmented, and each sub-volume sliced separately. The slicing angle is also limited by the shape of the print head, to avoid it crashing into the print.

We think this technique has a lot of potential for widespread use, especially since it is compatible with most existing FDM printers. It is still a work in progress, but support has already been added for Slic3r and Prusa Slicer. We look forward to seeing how it develops and gets adopted.

Open Source CAM Software In The Browser

3D printers, desktop CNC mills/routers, and laser cutters have made a massive difference in the level of projects the average hacker can tackle. Of course, these machines would never have seen this level of adoption if you had to manually write G-code, so CAM software had a big part to play. Recently we found out about an open-source browser-based CAM pack created by [Stewert Allen] named Kiri:Moto, which can generate G-code for all your desktop CNC platforms.

To get it out of the way, Kiri:Moto does not run in the cloud. Everything happens client-side, in your browser. There are performance trade-offs with this approach, but it does have the inherent advantages of being cross-platform and not requiring any installation. You can click the link above and start generating tool paths within seconds, which is great for trying it out. In the machine setup section you can choose CNC mill, laser cutter, FDM printer, or SLA printer. The features for CNC should be perfect for 90% of your desktop CNC needs. The interface is intuitive, even if you don’t have any previous CAM experience. See the video after the break for a complete breakdown of the features, complete with timestamp for the different sections.

All the required features for laser cutting are present, and it supports a drag knife. If you want to build an assembly from layers of laser-cut parts, Kiri:Moto can automatically slice the 3D model and nest the 2D parts on the platform. The slicer for 3D printing is functional, but probably won’t be replacing our regular slicer soon. It places heavy emphasis on manually adding supports, and belt printers like the Ender CR30 are already supported.

Kiri:Moto is being actively improved, and it looks as though [Stewart] is very responsive to community inputs. The complete source code is available on GitHub, and you can run an instance on your local machine if you prefer to do so. Continue reading “Open Source CAM Software In The Browser”

The Famous Basic Computer Games Book Gets A 2021 Update

If you are a certain age, your first programming language was almost certainly BASIC. You probably at least saw the famous book by Ahl, titled BASIC Computer Games or 101 BASIC Computer Games. The book, published in 1973 by [David Ahl] was a staple in its day and the first computer book to sell over one million copies. Of course, if you want to run Super Star Trek or Hamurabi, you better fire up an old retrocomputer or a simulator because BASIC in 1973 doesn’t look like what we have today. Or, you can head to GitHub where [coding-horror] is inviting people to help update the programs using modern languages.

One of our favorites, Bagels, is there with directories for C#, Java, Javascript, Python, Ruby, and VB.net. It doesn’t appear that all of the games are in all the languages, though. There’s also a .Net solution file that apparently has a few entries in it. We were also happy to see Super Star Trek represented, along with a link to an article about a C++ language port. The original games were tweaked to run on VintageBasic.

Continue reading “The Famous Basic Computer Games Book Gets A 2021 Update”

Oddball X86 Instructions

David Letterman made the top ten list famous. [Creel] has a top ten that should appeal to many Hackaday readers: the top 10 craziest x86 assembly language instructions. You have to admit that the percentage of assembly language programmers is decreasing every year, so this isn’t going to have mass appeal, but if you are interested in assembly or CPU architecture, this is a fun way to kill 15 minutes.

Some would say that all x86 instructions are crazy, especially if you are accustomed to reduced instruction set computers. The x86, like other non-RISC processors, has everything but the kitchen sink. Some of these instructions might help you get that last 10 nanoseconds shaved off a time-critical loop.

Continue reading “Oddball X86 Instructions”