Well after months of waiting and designing, I’ve finally managed to build the Eon V smartwatch! Why its version 5, I’m not to sure other than other few that actually worked though five sounds good so I’m going to keep it. I came across a fair few problems with the implementation of this watch, predominantly around the microcontroller I decided to use – the STM32L051R8. After learning all of my STM32 based programming using the standard peripheral library, it came to me as a complete shock to know that the STM32L051R8 is no longer supported by the standard peripheral library and the library itself is now deprecated!
Shocked, I posted on the STM32 forum asking whether the standard peripheral library had been ported to the STM32L051, to which I found out it wasn’t and the only method of interfacing this chip would be to directly access the registers or to use… STmicroelectronics CubeMX……………………….
One thing I’m really not a fan of when it comes to programming is programming through a “wizard” or graphical interface based package. I can’t stand the layer of abstraction between the user code and the underlying peripherals as it feels like the code ends up bloated and convoluted. Regardless, I decided to give the CubeMX a go since I’d already invested my time and effort into designing around this chip. I started setting up my pins to then realise: What am I supposed to do when I need to change pins on the fly?!
It then occurred to me that if I needed to make these changes, I’d need to end up doing direct register writes, hence taking me back to the first option of writing directly to registers. After this though, I started to write a couple of my own standard peripheral libraries. After getting as far as a GPIO and SPI implementation, I was in the position to test out whether the LCD worked or not. It then further became obvious that I’d have to go through a fair bit of my own code to make it suited to the STM32L051 as I’d originally written it for the STM32F051 (at the time, it wasn’t obvious to me that the change of 1 letter would make the code so incompatible). Both frustrated and having potentially wasted a fair bit of my time, I had a brief look through my component selection and remembered that I actually had some STM32F051K8’s from a previous project! So after this find, I decided to whip up another board based on this chip instead of the ‘L’ equivalent and other than changing a few defines, my whole development program worked. For those interested, I made a short 2 minute vlog with a comparison of all my previous watches too.
- STM32F051R8 – 48MHz, 64kB Flash, 8kB SRAM
- 160x128px 16bit 1.8″ LCD
- MicroSD card (up to 2GB, SDHC isn’t supported as of yet…)
- GPS with integrated ceramic antenna
- Software controlled torch!
- Integrated magnetometer for a compass bearing
Keep tuned for more updates on the watch!