Learn to Optimize Code in Assembly… for Android

When programming a microcontroller, there are some physical limitations that you’ll come across much earlier than programming a modern computer, whether that’s program size or even processor speed. To make the most use of a small chip, we can easily dig into the assembly language to optimize our code. On the other hand, modern processors in everyday computers and smartphones are so fast and have so much memory compared to microcontrollers that this is rarely necessary, but on the off-chance that you really want to dig into the assembly language for ARM, [Uri Shaked] has a tutorial to get you started.

The tutorial starts with a “hello, world” program for Android written entirely in assembly. [Uri] goes into detail on every line of the program, since it looks a little confusing if you’ve never dealt with assembly before. The second half of the program is a walkthrough on how to actually execute this program on your device by using the Android Native Deveolpment Kit (NDK) and using ADB to communicate with the phone. This might be second nature for some of us already, but for those who have never programmed on a handheld device before, it’s worthwhile to notice that there are a lot more steps to go through than you might have on a regular computer.

If you want to skip the assembly language part of all of this and just get started writing programs for Android, you can download an IDE and get started pretty easily, but there’s a huge advantage to knowing assembly once you get deep in the weeds especially if you want to start reverse engineering software or bitbanging communications protocols. And if you don’t have an Android device handy to learn on, you can still learn assembly just by playing a game.

A New Kid On The Mini ARM Block

The breadboard microcontroller experimenter has a host of platforms to work with that can be had in the familiar DIP format. Old-school people can still find classic 8-bit platforms, the Ardunisti have their ATMegas, and PIC lovers have a pile of chips to choose from. But ARM experimenters? Out of luck, because as we have previously reported, popular past devices such as the LPC810 in a DIP8 package are now out of production.

News comes from China though of a tiny ARM Cortex M0 for pennies that may not be in a DIP8, but is in almost the next best thing. The Synwit SWM050 can be had in a TSOP8, which though it’s not quite as friendly as its larger SOIC8 cousin, is still easily solderable onto a DIP8 adaptor for breadboard use. Spec-wise it’s 5 V tolerant, has an 8 kB FLASH and 1 kB of RAM, 6 GPIOs, and can clock away at a not incosequential 36 MHz.

We have [Sjaak] to thank for the discovery of this device, and for doing a lot of work including getting some die shots taken to dig up and make sense of the Chinese documentation, and to provide some dev tools should anyone want to play with it.  There’s even a small breakout board for the experimenter unwilling to design their own.

Earlier this year we marked the passing of the DIP8 version of the LPC810 microcontroller, and for those mourning it we made an important point. It’s now normal to use one of the vast array of single board computers instead of a bare microcontroller, you might wish to ask yourself why you would do so.

Thanks [Ziew] for the tip.

Tiny WiFi-Enabled ARM MCU for Tiny Projects

Ever since the ESP8266 WiFi-enabled microcontroller came on the scene, it seemed like suddenly everyone came up with WiFi-enabled projects. But the ESP8266 is not the only game in town! Reader [PuceBaboon] notified us of a new product released by Seeed Studios: the imaginatively called Air602 WiFi Development Board.

The core of this board is the tiny WinnerMicro W600 MCU, which integrates a 32-bit ARM Cortex M3 CPU, along with dual UARTs, I2C, SPI and I2S interfaces, as well as a real-time clock (RTC). Add to this hardware crypto, seven I/O pins (five broken out on the development board) and you have a very capable WiFi-enabled MCU which can be programmed using the usual ARM development tools (e.g. Keil) using the provided SDK.

The W600 module can be bought by itself, in all its diminutive 12 mm x 10 mm glory, for a mere $1.90 as of time of writing – without antenna – as noted in [PuceBaboon]’s thoughts on this MCU and the development board.

ARM-Based NAS Is A Low Cost, Low Power Beauty

A NAS is always a handy addition to a home network, but they can be a little pricey. [Blake Burkhart] decided to create his own, prioritising budget and low power considerations, with a secondary objective to produce some router and IoT functionality on the side.

A Banana Pi R2 was a good choice to meet these requirements, being a router-based development board that also sports dual SATA connectors and gigabit Ethernet. [Blake] had some retrospective regrets about the performance of this particular SBC, but it does just fine when functioning purely as a NAS.

The enclosure for the device is a three bay hot-swap HDD module, with one of the bays gutted and used for the Banana Pi. It’s a simple idea, elegantly executed, which looks great. To access the ports of the Banana Pi, a custom acrylic side panel was laser cut, which also allowed LEDs to shine through – obligatory for any DIY server/computer build. When mounting this panel to the existing enclosure, [Blake] was reluctant to take his chances tapping the brittle acrylic, instead opting to melt the threads into the plastic with a pre-torched screw. We find that tapping acrylic is usually okay if you take it slow, but heat-tapping does sound fun.

The 12 V fan that came built into the hot-swap enclosure was too loud and awkwardly came in a non-standard size with a non-standard connector. What’s more, a buzzer alarm was triggered any time the fan was disconnected and 0 RPM was detected. [Blake]’s solution was to rewire the power pin of the connector to a 5 V rail; he found that running the fan at 5 V led to much quieter performance whilst keeping the HDDs sufficiently cool.

We find that when it comes to DIY network gear and routers, there are two approaches. Either create your own bespoke solution that perfectly fits your needs, like this perfect home router, or work around your current gear and build some tech to automatically reboot it for you.

 

FOSSCON 2018: Developing the FreedomBox

The modern Internet can be a dangerous place, especially for those who might not have the technical wherewithal to navigate its pitfalls. Whether it’s malware delivered to your browser through a “drive-by” or online services selling your data to the highest bidder, its gotten a lot harder over the last decade or so to use the Internet as an effective means of communication and information gathering without putting yourself at risk.

But those are just the passive threats that we all have to contend with. What if you’re being actively targeted? Perhaps your government has shut down access to the Internet, or the authorities are looking to prevent you from organizing peaceful protests. What if you’re personal information is worth enough to some entity that they’ll subpoena it from your service providers?

It’s precisely for these sort of situations that the FreedomBox was developed. As demonstrated by Danny Haidar at FOSSCON 2018 in Philadelphia, the FreedomBox promises to help anyone deploy a secure and anonymous Internet access point in minutes with minimal user interaction.

It’s a concept privacy advocates have been talking about for years, but with the relatively recent advent of low-cost ARM Linux boards, may finally be practical enough to go mainstream. While there’s still work to be done, the project is already being used to provide Internet gateways in rural India.

Continue reading “FOSSCON 2018: Developing the FreedomBox”

$99 Pinebook Gets KDE Neon Port

If you’re the kind of person who likes small and cheap Linux devices, you’re definitely alive in the perfect moment in history. It seems as if every few months we’ve got another tiny Linux board competing for our pocket change, all desperate to try to dethrone the Raspberry Pi which has already set the price bar exceptionally high (or low, as the case may be). We’ve even started to see these Linux boards work their way into appropriately cheap laptops, though so far none have really made that great of an impression.

But thanks to the efforts of Blue Systems and Pine64, the situation might be improving: they’ve worked together on a build of KDE Neon for the $99 Pinebook. The fact that they’ve gotten Plasma, KDE’s modern desktop environment, running on the rather mediocre hardware at all is an accomplishment by itself. But they’ve also set out tailor the entire system for the Pinebook, from the kernel and graphics drivers all the way up to Qt and Plasma tweaks.

In a blog post announcing the release candidate of the OS, Neon developer [Jonathan Riddell] says that these top-to-bottom improvements show that you can turn a super cheap Linux laptop into a practical computer if you’re willing to really get in there and optimize it. He also says the project has been something of a two-way street, in that improvements made for the Pinebook build have also been applied to upstream development.

The last time we looked at the Pinebook, we came away cautiously optimistic. It wasn’t great, but it was about as good as you could possibly expect given the price. If more developers are willing to go out on a limb and start optimizing their software for the device, it might become a very promising platform for low-cost mobile hacking.

FCC Filing Reveals Tasty Hardware McSecrets

If you’ve visited a McDonald’s recently, you might have noticed something of a tonal shift. Rather than relying on angsty human teenagers to take customer orders, an increasing number of McDonald’s locations are now using self-serve kiosks. You walk up, enter your order on a giant touch screen, and then take an electronic marker with you to an open table. In mere minutes your tray of nutritious delicious cheap food is brought to you by… well that’s still probably going to be an angsty teenager.

Thanks to a recent FCC filing pointed out to us by an anonymous tipster, we now know what kind of tech Ronald has packed into the electronic table markers (referred to as “tents” in McDonald’s parlance). It turns out they are Bluetooth Low Energy beacons powered by the Nordic nRF52832 chipset, and include some unexpected features such as an accelerometer to detect falls.

The Nordic nRF52832 features a 32-bit ARM Cortex M4F processor at 64 MHz with 512 KB flash and 64 KB SRAM. Quite a bit of punch for a table marker. Incidentally, this is the same chip used in the Adafruit Feather nRF52 Pro, so there’s already an easily obtainable development toolchain.

A image of the backside of the PCB shows a wealth of labeled test points, and we imagine figuring out how to get one of these table markers doing your own bidding wouldn’t be too difficult. Not that we condone you swiping one of these things along with your Quarter Pounder with Cheese. Though we are curious to know just why they need so much hardware to indicate which table to take a particular order to; it seems the number printed on the body of the device would be enough to do that.

This isn’t the first time we’ve taken a peek behind the Golden Arches. From reverse engineering their famous fries to hacking the toys they give out with Happy Meals, there’s more to do at the local McDonald’s than get thrown out of the ball pit again.