RIoTing in Berlin

Teemu and I just came back from Berlin, where the RIoT folks had arranged a very good workshop on how RIoT and Ell-i could work together.  It was an excellent workshop, a report will follow later.  Below some images to give you a feeling.

IMG_5446

IMG_5433

Workshop atmosphere.

Preparing for Bare Metal

_3

The Ell-i Bare Metal hackathon is two weeks from now. Thanks to Saleae, we will also have very useful prizes, a Saleae Logic Pro 16 for the first prize winner, and Logic 8 and Logic 4 for the second and third prizes.

The vendors, ST, NXP, and Atmel have already delivered boxes full of boards to us, and EIT ICT Labs, Ericsson, Helvar, and Reaktor have promised to supply us with enough of fuel (food and drinks) to last through the 48 hours. We have a full house and the registration is closed. However, if you or someone you know definitely wants to attend the hackathon, we can arrange a few extra seats if really needed.

From ST we have received 15 pieces of STM32F407 discovery kits, each with an Cortex-M4F CPU, 1 MB of flash, and 192 kB of SRAM. NXP has supplied us with 10 pieces LPC1227 LPCEspresso, another 10 pieces of LPC11U14 boards and even a couple of LPC4330-Xplorer Boards. Hence, their range covers pretty much everything from low end LPC11Uxx line, with build-in USB, to the high end dual-core LPC4330 with both a Cortex-M4F and a Cortex-M0 core. Finally, Atmel has provided us with 15 pieces of the SAMD20 explained pro kits, with Cortex-M0+, 256 kB of flash and 32 kB of SRAM. With our own Ellduino boards, with Power-over-Ethernet and STM32F051 providing Cortex-M0, 64 kB of flash and 16 kB of SRAM, we have a plenty of MCUs for starting different designs.

circular-staircases-lateral-stringer-metal-frame-glass-steps-62007-1989027

I myself am quite busy preparing my tutorial presentations, trying to condense what I’ve learned about bare metal programming during the last few decades. In a sense, I tipped my toes to bare metal already back in the late 80s, when I fixed bugs in the Altos Unix System V kernel, eventually using adb to patch the live kernel in machine code since in that way the development cycle was much faster than with patching an image rebooting. If it worked, it worked, and then I could apply the patch to the image without rebooting. If it didn’t work, then it crashed, and I needed to reboot anyway.

LegoMindstormsRCX

In late 90s I then did my first deep plunge into the embedded world. In 1998-99 I developed a small operating system for the Lego Mindstorms robotics system, which back at that time had a Hitache H8 8-bit microcontroller with some 24 kilobytes of flash and 4 kilobytes of SRAM, if I remember correctly. Through tweaking the GCC back end to produce more efficient code, carefully integrating assembler, C, C++, and Java code (compiled with gcj to binary), I somehow managed to build a minimal but pretty full fledged Java runtime, with threads, monitors, and everything. Unfortunately the runtime took almost 20 kilobytes, leaving only 4 kilobytes of flash for the actual application, thereby making it an academicly interesting but practically useless experiment.

The third time I really encountered the embedded world in 2005, when I started to renovate our house and wanted to have a home automation system — what a fool idea at that time :-). In the end, I managed to build a working system using the Linet products from Sitecno, a small Finnish electronics design comapany. At that time I managed to design and prototype an AVR-based intelligent light dimmer, but unfortunately the Linet network latency was too long, making the system annoying in practical use. Additionally, I had sensor and actuator problems due to inductive and capacitive coupling, ground currents, and leak currents, which I wasn’t able to solve back at that time. Hence, I ended up with a partical system that controls the lights but nothing else, even though there are unused sensors throughout the house and digital relays and control for the sauna and ventilation.

3189412afaff4903b6e70830c1d8405b

From 2011, I’ve been mostly dealing with embedded systems. I joined Senseg, a leading haptics startup. From the technical point of view, the Senseg system is very much an embedded system, including physical effect generation, electronics, microcontrollers, and software. While I have mostly been working with software at Senseg, being responsible for the software architecture, I have also learned a lot about electronics just by looking and listening. Hence, now with three years of full-time development work at Senseg and one year of practicing electronics design as a hobby at the Ell-i co-operative, I consider having a pretty complete understanding of most aspects of embedded design.

Hence, I’m now trying to condense the essence of those years of experience into a few hours of tutorials. As there are quite a lot of generic material about bare metal programming available, in the tutorials I’m trying to focus on the gist, what is essential from the practical point of view, what are the things that are hard to get right or where the related documentation spreads over different works.

Of course, just a few hours of explaining things won’t be enough to transfer even a fraction of the practical lessons I’ve learned. We have to think also about other media, such as creating some wiki pages or something.

Eero Hakala nominated as the President and CEO for ELL-i cooperative

Eero Hakala has been nominated as the President and CEO for ELL-i cooperative.  ELL-i develops an Open Source hardware and software platform for intelligent Power-over-Ethernet (PoE) devices.  ELL-i provides both makers and professionals with open source software, schematics, layouts, and instructions for designing and building PoE-powered, intelligent, wire line-communicating devices.

Eero Hakala has over 40 years of business experience from telecommunications and IT sectors.  Having worked for Nokia Solutions and Networks (NSN) and Nokia at various product management and R&D management positions, Eero has gained solid experience in productisation processes.  He has impressive international experience from Chengdu and Beijing where he was working for 2.5 years for Nokia.  He has also strongly contributed to technical press development in Finland having founded several journals for It industry professionals and hobbyists.  Eero holds a B.Sc. Economics degree from Helsinki School of Business.  He is devoted to lifelong learning and is always open for new development projects.

 
Pekka Nikander, Prime Mover and founding member of ELL-i is happy to move managerial responsibilities to Eero Hakala: “I’m extremely happy to have Eero on board, with his  long career experience in managing R&D organisations and complex technical products.  I am confident that with Eero we will be able to advance to the next step, from providing the developers with designs and and source code to producing a concrete, ready-to-use fully open development platform.”

Eero Hakala aims at building an intelligent sensor network to monitor and tune heating and lightning of his own house with ELL-i technology.  “My goal is to create credibility, stability and predictability by applying agile practises to leading our pack of international team while keeping red tape on minimal level and focusing on getting things done with quality.  Our challenge is to create innovative and excellent hardware driven by equally innovative and excellent software!  Succeeding in both areas will make us an exceptional home base for as well people as business spin offs based on our technologies!”

Turku Centre for Computer Science (TUCS) students play with their brand new bucks

Eero and I had fun today with the TUCS students, teaching them how to build buck converters. Even though we had only three hours for our lab exercise, three of the groups got so far that they were able to drive an HP LED with their buck converter designs. One group even got fancy and did some disco lights! The smiles were bright.

Core coding

I recently started to rewrite the ELL-i runtime from scratch. The old runtime had grown organically for a about year, gaining support for most of the Arduino APIs, most of Contiki, and finally a scouts-honour threading system, allowing the Arduino and Contiki environments to run in parallel. Unfortunately, the code had also started to rot, mainly since I hadn’t understood what I was doing when I had started and because I had written parts of the code in too much hurry. In the end, adding even simple features — for demo purposes — was a constant battle against running out of RAM or Flash, or the code not working for some other obscure reason.

Hence, it looked like a perfect time for rewriting everything, and this time properly. So, in the beginning of November I started from a completely clean slate. I started with an empty repository, https://github.com/ell-i/Runtime (note the name may still change), starting with making the compiler to work with the Arduino IDE, without any real source code, yet. Then I added low-level initialisation code from ST and CMSIS from ARM, only to later rewrite parts of the initialisation code. A next step was to write an utterly simple hardware emulator, using C++ objects to model peripherals, allowing the code to run also on the host, printing out all interactions with the hardware. With that, the system was ready to boot, but not able to do anything, yet.

So, at this moment, the code boots and includes partial support for GPIO, which is a good start. The system part of the code is Clean C, compiling with both gcc and g++, with the intention of gradually moving over to LLVM. The work continues with adding a rudimentary test suite using the Robot Framework; thereafter we will start adding back the currently missing Arduino and Contiki APIs, slowly and carefully.

— Pekka