Quadcopter Uses Bare Metal STM32

[Tim Schumacher] got a Crazepony Mini quadcopter and has been reprogramming it “bare metal” — that is to say he’s programming the STM32 without using an operating system or do-it-all environment. His post on the subject is a good reference for working with the STM32 and the quadcopter, too.

If you haven’t seen the quadcopter, it is basically a PC board with props. The firmware is open source but uses the Keil IDE. The CPU is an STM32 with 64K of program memory. In addition, the drone sports a wireless module, a digital compass, an altimeter, and a gyro with an accelerometer.

Although the post is really about the quadcopter, [Tim] also gives information about the Blue Pill which could be applied to other STM32 boards, as well. On the hardware side, he’s using a common USB serial port and a Python-based loader.

On the software side, he shows how to set up the linker and, using gcc, control output ports. Of course, there’s more to go to work the other peripherals, and Tim’s planning to investigate CMSIS to make that work easier. Our earlier post on STM32 prompted [Wassim] over on Hackaday.io to review a bunch of IDEs. That could be helpful, too.

New Part Day: The STM32 That Runs Linux

There are a lot of ARM microcontrollers out there, and the parts from ST are featured prominently is the high-power builds we’re seeing. The STM32F4 and ~F7 are powerhouses with great support, and the STM32F0 and the other younger children of the family make for very good, low-power microcontrollers. Now, the STM32 family is getting a big brother. It runs Linux. It’s two ARM Cortex-A7 cores and one M4 core on the same chip. The STM32MP1 is the chip you want if you still can’t figure out how to waste computing cycles by blinking LEDs.

Block diagram of the STM32MP157 Image: ST

First, that Linux support. The STM32MP157C was mainlined into Linux last summer, and there is support for Android. So yes, this chip can run Linux. There is an optional 3D GPU in this family, a MIPI-DSI controller, support for HDMI-CEC, USB 2.0, and 10/100M or Gigabit Ethernet. This brings us the inevitable question of whether you can build a Raspberry Pi clone with these parts. Maybe, champ, but if you’re asking that question it’s probably not you that’s going to build one. It looks as if this chip is designed for phones, set-top boxes, and smart TVs. That doesn’t preclude a single board computer, but the biggest problem there is maintaining software support anyway.

The chip family in question all come with dual ARM Cortex-A7 processors running at a nominal 650MHz. There’s also a Cortex-M4 running at 209MHz, and the ST literature suggests that engineers are already running Linux on the A7 and an RTOS on the M4. This chip will need external memory, but DDR3 / DDR3L / LPDDR2 / LPDDR3 are supported.

This chip is only announced right now, you can’t get it on Mouser or Digikey yet, and there’s no information on pricing. However, there are two development boards available, the Evaluation board, which features 1 GB of DDR3L, 128 MB of Flash, and an 8 GB eMMC. There’s a 5.5″ display, and enough connectors to make your heart flutter. The Discovery board is a bit more cut down, and comes with a 4″ 480×800 LCD, WiFi, Bluetooth LE, and of course it comes with GPIO expansion connectors for an Arduino and Raspberry Pi. The Discovery Board is not available at this time, but it will sell for $99 USD.

Playing Pokemon On A CRT Thanks To A Powerful Microcontroller

Microcontrollers come in a broad swathe of capabilities these days. There are the venerable 8-bit micros that have been around forever and valiantly crunch away, all the way up to modern 32-bit powerhouses with advanced peripherals and huge amounts of RAM and ROM. If you’re blinking a few LEDs or opening a garage door, the former is fine. For what [Jared] had in mind, a little more horsepower was required.

[Jared]’s project started out as an experiment with composite video output on a STM32F446RE microcontroller. Using a 4-bit resistor DAC, the device was able to output NTSC signals, using interrupts and NOPs to handle timing. The hardware worked, and was tested by playing the entirety of Star Wars: A New Hope from an SD card.

Attention then turned to creating a Game Boy emulator for the platform. After many hurdles with various bugs and edge cases, things started working, albeit slowly. The Pokemon game ROM wouldn’t fit in the microcontroller’s limited flash storage, so [Jared] implemented a complicated bank switching scheme. This combined with the limited computational resources meant the game was playable, but limited to just 10 FPS.

Enter the STM32H7. With over double the clock speed and capable of 856 DMIPS versus 225 of the original chip, things were coming together. Pokemon now ran at 60 FPS, and the built-in DAC greatly improved the sound. The DMA subsystem allowed further performance gains, and even running in debug mode, performance far exceeded that of the previous hardware.

With unit prices of most microcontrollers being remarkably low, it goes to show that once you’ve tapped out on performance on one platform, there’s usually a faster option available. It’s possible to emulate the Game Boy on the ESP-32 too, as Sprite_TM showed us in 2016. Video after the break.

[Thanks to Ben for the tip!]

Continue reading “Playing Pokemon On A CRT Thanks To A Powerful Microcontroller”

Hackaday Podcast 004: Taking The Blue Pill, Abusing Resistors, And Not Finding Drones

Catch up on your Hackaday with this week’s podcast. Mike and Elliot riff on the Bluepill (ST32F103 boards), blackest of black paints, hand-crafted sorting machines, a 3D printer bed leveling system that abuses some 2512 resistors, how cyborgs are going mainstream, and the need for more evidence around airport drone sightings.

Stream or download Episode 4 here, and subscribe to Hackaday on your favorite podcasting platform! You’ll find show notes after the break.

Take a look at the links below if you want to follow along, and as always, tell us what you think about this episode in the comments!

Direct download (60 MB or so.)

Continue reading “Hackaday Podcast 004: Taking The Blue Pill, Abusing Resistors, And Not Finding Drones”

Short Length Of Wire Turns STM32 Microcontroller Into Good-enough Wireless UART Blaster

Hackaday regular [befinitiv] wrote into the tip line to let us know about a hack you might enjoy, wireless UART output from a bare STM32 microcontroller. Desiring the full printf debugging experience, but constrained both by available space and expense, [befinitiv] was inspired to improvise by a similar hack that used the STM32 to send Morse code over standard FM frequencies.

In this case, [befinitiv]’s solution is both more useful and slightly more legal, as the software uses the 27 MHz ISM band to blast out ASK modulated serial data through a simple wire antenna attached to one of the microcontroller’s pins. The broadcast can then be picked up by an RTL-SDR receiver and interpreted back into a stream of data by GNU Radio.

The software for the STM32 and the GNU Radio Companion graph are both available on Bitbucket. The blog post goes into some detail explaining how the transmitter works and what all the GNU Radio components are doing to claw the serial data back from the ether.

[cover image cc by-sa licensed by Adam Greig, randomskk on Flickr]

Send Smooches Over Skype With The Kiss Interface

This project of [Nathan]’s certainly has a playful straightforwardness about it. His Skype ‘Kiss’ Interface has a simple job: to try to create a more intuitive way to express affection within the limits of using Skype. It all came about from a long distance relationship for which the chat program was the main means of communicating. Seeking a more intuitive and personal means of expressing some basic affection, [Nathan] created a capacitive touch sensor that, when touched with the lips, sends the key combination for either a kissy face emoji or the red lips emoji, depending on the duration.

Capacitive touch sensing allows for triggering the sensor without actually physically touching one’s lips to the electrodes, which [Nathan] did by putting a clear plastic layer over the PCB traces. His board uses an STM32 microcontroller with software handling the USB HID and STM’s TSC (Touch Sensing Controller) functionality. As a result, the board has few components and a simple interface, which was in keeping with the goal of rejecting feature creep and focusing on a simple task.

Clearly the unit works; but how well does it actually fulfill its intended purpose? We don’t know that yet, but we do know that [Nathan] seems to have everything he needs in order to find out. Either way, it’s a fun project that definitely fits the spirit of the Human-Computer Interface Challenge of The Hackaday Prize.

LEDs Make An “Analog” Wristwatch

If you just came down in the last shower, you’re probably used to living in a world where LEDs are cheap, awesome, and practically everywhere. Spare a thought for those of us who lived before the invention of high brightness LEDs – these things still amaze us! A great example of how far we’ve come is this “analog” watch build by [Kevin], featuring no less than 73 of the critters.

The microcontroller running the watch is an STM32, chosen for its easy programmability. It’s running the LEDs in an emulation of the dial of an analog clock, hence the high part count. Naturally, it’s no simple task to cram 73 LEDs and all the necessary connections into the confines of a watch-sized PCB. [Kevin] goes into great detail about the challenges involved, from routing the traces to a tricky power draw problem caused by some odd blue LEDs.

Watch builds are always fun, and they make great conversation pieces for when you want to amaze strangers with your tales of battles fought in the PCB design suite. Now check out this similar build with an entirely different style.