A (Pre)production Unit

With the end of year 2016 some more folks wanted to have a tracker on board and therefore I started to ponder how to build more units in a nicer or even, let’s say – a professional form.

The amount and complexity of code was growing while not only 8kB nor 32KB FLASH was not enough. 1000 bytes of RAM would be still enough but various almost-undetectable problems started to arise – mainly rare unexpected memory leaks followed by a bit more expected watchdog reboots. It was the highest time to leave the Atmel AVR realm and move to some other, unexplored area where code can be debugged better that by prints into serial terminal.

A new design based on mighty STM32 microcontroller was born. In this case it was the STM32F042 chip – possessing 32 still well-solderable legs, 64kB of FLASH, 32kB RAM, clocked up to 48MHz – a “perfect” embedded supercomputer until the moment 64kB of FLASH was not enough again.

Having spent some considerable amount of time on thinking, searching and comparing various ICs the choice was obvious – STM32L152. It is a low power (good!) microcontroller with 128kB of FLASH, 32kB RAM. Its 48 tiny legs with considerably smaller pitch among them (and that is not so good).

During January a perfect schematic was drawn in Kicad with even better layout. Having double-checked the dimensions of everything at hand I ordered PCB manufacturing and waited. As soon as the boards arrived I’ve started ordering all the parts. This day entered history as Mr. Farnell who claimed to have the L151s readily available for shipment gave me a call that those are not available anymore and asked if I wanted to wait for another 6 months. Luckily are the ST comrades quite smart so the missing hole can be (relatively easily) replaced by the ubiquitous F103.

Physical footprint match is one thing. The architecture is other.  While the F042 is Cortex-M0, the F103 is Cortex-M3 which means all the libraries accessing particular registers need to be again rewritten to reflect all the bloody nuances of that or the other architecture. Shit hit the fan.

Moreover, its March and season is so close..