The last week has been an interesting experience as I have been working on a hodge-podge of unrelated things. As I finished up my last project, DAQLiteFirmware, I was a little stuck about what to proceed with next. But fortunately, I settled my sights quickly on new projects, many new projects.
Firstly, I began looking at increasing my C fundamentals. I first began my programming journey as a Java developer because my dad was a Java developer; I have taken a lot of classes and completed a lot of assignments in Java over the years. But when I picked up C, I never rigorously practiced my C skills. I have relied on online forums and Stack Overflow posts to accumulate knowledge of C terminology and paradigms. While this method worked, I still wanted a solid base of fundamentals that I could rely on in the future. To achieve this, I have dedicated myself to learning from The C Programming Language (Second Edition) by Brian Kernighan and Dennis Ritchie. I decided to learn from a textbook as opposed to an online course because in the past, I have had the most success from reading technical literature. While it is certainly more difficult than learning from a teacher, I have found that I remember things better if I have read them in the past. And, Kernighan and Ritchie’s book is the gold standard for C textbooks as far as I have heard. I expect nothing less as Ritchie himself developed C at the prestigious Bell Labs. This last week, I have worked my way through the first chapter and completed most of the exercises in the chapter. I tested my solutions for the exercises somewhat strictly but then again I did not have the official solutions or official test cases to compare my answer to. So I can only give my seal of approval for the solutions as opposed to any legitimate guarantee that they are correct. In other words, use this code at your discretion. I have also uploaded my exercise solutions to a repository called Cprojects.
Next, I wanted to improve my knowledge of the STM32 chipset. You might wonder why I would revisit STM32 when I spent such a long time working with an STM32 Discovery Board, and to be honest I should probably work with a different chipset. I have learned a lot about how the STM32 chips work through the DAQLiteFirmware project, but my experimentation was significantly aided by STM32CubeMX. CubeMX is a great tool for being able to leverage powerful and sophisticated STM32 chips towards regular projects; however, CubeMX also hides a lot of the details that go towards writing embedded firmware. I want to familiarize myself with this detail because as far as I know, the other chip manufacturers don’t have a tool like CubeMX. Even if these chip manufactures had such a sophisticated tool, I’m not sure I would want to rely completely on it as I have had my fair share of mishaps with CubeMX. So, I went looking for textbooks that would further my understanding of STM32 chips, and luckily, I cam across Beginning STM32 by Warren Gay. This textbook has been pretty great because it is delves into the basics of the STM32 chip quite closely with clear and concise language. The book works with a development board for the STM32F10C8T6 chip, the same chip I was initially considering using for the DAQLiteFirmware project. The development board comes in a small form and in a shade of blue so many have termed it the Blue Pill.
I have found that to get the most use out of the textbook, I will need a Linux system to work closely with the Blue Pill, so I spent a good bit of the weekend setting up my laptop to be able to run Ubuntu 19.04. In the past I have tried to run Ubuntu off a bootable USB; however, my laptop, a Lenovo Flex 5, seemed to struggle with running a bootable Ubuntu USB and Windows 10 OS side-by-side. Whenever I would want to use either of the OSes, I would have to modify BIOS settings, which was always very annoying. So, I simply stuck with using Ubuntu for Windows or Cygwin for my Unix needs, but working with the firmware for the Blue Pill needed a full Linux system. Thankfully, I was able to get the bootable USB working on my system with the help of this blog post. Thanks to Petra Gospodnetić’s helpful tutorial, I was able to configure the BIOS to accept my Ubuntu USB, and once I got the Ubuntu USB working, I went through the first couple chapters of Beginning STM32 and installed all the necessary software. All the code I will be writing in the future for this book will be uploaded to a new, yet to be created repository. I will inform you guys about it in my next post.