The Newlib Embedded C Standard Library And How To Use It

When writing code for a new hardware platform, the last thing you want to do is bother with the minutiae of I/O routines, string handling and other similarly tedious details that have nothing to do with the actual project. On bigger systems, this is where the C standard library would traditionally come into play.

For small embedded platforms like microcontrollers, resources are often tight enough that a full-blown stdlib won’t fit, which is why Newlib exists: to bring the portability benefits of a standard library to microcontrollers.

Whether you use C, C++ or MicroPython to program an MCU, Newlib is likely there under the hood. Yet how exactly does it integrate with the hardware, and how are system calls (syscalls) for e.g. file and input/output handling implemented? Continue reading “The Newlib Embedded C Standard Library And How To Use It”

Inside A 20-Watt Traveling Wave Tube Amplifier From Apollo

When the Apollo astronauts made their way to the Moon, their communication equipment had a transmission power of a mere 20 W, which the sensitive receivers back on Earth managed to pick up. But this isn’t just any amplifier, it’s a Traveling Wave Tube amplifier (TWT), as [Ken Shirriff] explains in a recent article.

The most fascinating thing about these TWTs isn’t just their role during the Apollo missions, but the fact that even today this type of vacuum tube is still among the most efficient and compact types of RF amplifier. As a result today’s high-tech satellites still commonly feature these devices.

As always, [Ken] entertains and enlightens us with how the TWT and the rest of the amplifier system worked.

 

Using Ghidra To Extract A Router Configuration Encryption Key

Who doesn’t know the struggle? Buying an interesting piece of hardware for a song and a dance, and then finding that the device’s firmware and/or configuration file is locked down with various encryption or obfuscation methods. This was the experience [Ali Raheem] had when he got a TP-Link TL-MR3020 V3 for a mere 18 British Pounds, intending to use this 4G-capable router to increase internet reliability.

Naturally this can all be done when staying inside the vendor-provided marked lines, which in this case meant ignoring the encrypted configuration files. As the owner of the hardware, this was of course unacceptable and thus [Ali] got a firmware image from the TP-Link site to see what could be gleaned from it in terms of encryption keys and other hints.

After obtaining the TP-Link-provided BIN file, the application of binwalk helpfully extracted the files embedded in it, followed by John the ripper decrypting the passwords in the /etc/passwd.bak file, and ultimately finding the encrypted /etc/default_config.xml file. Searching for this filename string in the rest of the extracted files led to /lib/libcmm.so.

Dropping this shared library file into Ghidra to disassemble its code, [Ali] found a function suspiciously called decryptFile. Inside was a reference to the global key string, which when tossed into OpenSSL and after some fiddling turned out to decrypt the XML configuration file in des-ecdb mode. From this point dropping in one’s own configuration files should be no problem after encrypting them to make the firmware happy. Nice work!

Design A Custom Enclosure Using Modelling Clay And Photogrammetry

When it comes to designing enclosures which aren’t simple boxes or other basic shapes, the design process tends to get somewhat tedious and involved as the number of measurements to be transferred into the CAD program begins to skyrocket. One possible shortcut here is detailed by [Sebastian Sokolowski], who describes a process that combines modelling clay with photogrammetry.

[Sebastian] covers the design of a hand-held controller that should fit ergonomically when grasped. This starts off with the electronics and mechanical components that have to fit inside the controller: inside a CAD tool (demonstrated in Fusion 360), these components are arranged with a simple box enclosure around them. This box is then 3D printed and with modelling clay the desired shape of the controller is created around this box.

With a modelling clay version of the controller ready, it is photographed from as many angles as possible before these photos are processed by the open source Meshroom tool into a 3D model. After fixing up some issues in the mesh and knocking down the vertex count on this model so that the CAD tool doesn’t suffer a seizure importing it, it’s ready for final processing.

Within the CAD tool all that is left now is to refine the imported model to refine its outer shape and to create the inner details for mounting the electronics, switches and other components.

Continue reading “Design A Custom Enclosure Using Modelling Clay And Photogrammetry”

Fixing Noisy Measurements On An Owon XDM2041 Bench Multimeter

After purchasing an Owon XDM2041 bench multimeter for an automated test setup, [Petteri Aimonen] was disappointed to find that at especially the higher mega Ohm ranges, the measured values were jumping around a lot and generally very inaccurate. Since this is an approximately $170 bench multimeter and Owon support wasn’t cooperating, [Petteri] set out to fix the issue, starting with a solid teardown.

As noted by [Petteri], there’s not a whole lot inside one of these multimeters. The main board with the guts of the whole system contains a GigaDevices GD32F103CBT6 MCU coupled with the star of the show: the HYCON Technology Corporation’s HY3131 multimeter chip. After a peek at the HY3131 datasheet, the culprit was quite apparent: while sampling the presence of mains voltage noise is usually suppressed through the selection of an appropriate crystal.

Unfortunately, instead of the recommended 4.9152 MHz crystal per the reference schematic for the HY3131, Owon’s engineers had apparently opted for a 4 MHz crystal instead, and so it’s essentially aliasing the line noise.

[Petteri] figured that the resulting sampling timing might work well enough with 60 Hz line frequency, but clearly with 50 Hz there was a lot of noise sneaking into the measurements. After swapping the crystal with a 3.072 MHz one, there was a marked improvement, as the plot shows.

Checking Up On Earth’s Sister Planet: NASA’s Upcoming Venus Missions

Even as we bask in the knowledge that our neighboring planet Mars is currently home to a multitude of still functional landers, a triplet of rovers and with an ever-growing satellite network as well as the first ever flying drone on another planet, our other neighboring planet Venus is truly playing the wallflower, with Japan’s Akatsuki orbiter as the lone active Venusian mission right now.

That is about to change, however, with NASA having selected two new missions that will explore Venus by the end of this decade. The DAVINCI+ and VERITAS missions aim to respectively characterize Venus’ atmosphere and map its surface in unprecedented detail. This should provide us information about possible tectonic activity, as well as details about the Venusian atmosphere which so far have been sorely missing.

Despite Venus being the closest match to our planet Earth, how is it possible that we have been neglecting it for so long, and what can we expect from future missions, including and beyond these two new NASA missions?

Continue reading “Checking Up On Earth’s Sister Planet: NASA’s Upcoming Venus Missions”

TerraPower’s Natrium: Combining A Fast Neutron Reactor With Built-In Grid Level Storage

Most new nuclear fission reactors being built today are of the light water reactor (LWR) type, which use water for neutron moderation into thermal neutrons as well as neutron capture. While straightforward and in use since the 1950s in commercial settings, they are also essentially limited to uranium (U-235) fuel. This is where fast neutron reactors are highly attractive.

Fast neutron reactors can also fission other fissile elements, covering the full spectrum of neutron cross sections. TerraPower’s Natrium reactor is one such fast reactor, and it’s the world’s first fast reactor that not only targets commercial use, but also comes with its own grid-level storage in the form of a molten salt reservoir.

The upshot of this is that not only can these Natrium reactors use all of the spent LWR fuel in the US and elsewhere as their fuel, but they should also be highly efficient at load-following, traditionally a weak spot of thermal plants.

TerraPower and its partners are currently looking to build a demonstration plant in Wyoming, at the site of a retiring coal plant. This would be a 345 MWe (peak 500 MWe) reactor.

Continue reading “TerraPower’s Natrium: Combining A Fast Neutron Reactor With Built-In Grid Level Storage”