Embedded Systems Weekly #102
Tags: embedded, c99, struct
Published: 2022-05-31 10:51:50

Happy Friday readers! Today I would like to share with you something that I read every week. It's Weekly Robotics, a tech newsletter (like Embedsys Weekly) focused on robotics. Weekly Robotics is hand picked and it is delivered every Monday. If you like my work, I'm sure you'll like [Weekly Robotics](https://www.weeklyrobotics.com/). Give it a try!

Thank you to [Harrison Broadbent](https://unsplash.com/@harrisonbroadbent) for the header's [picture](https://embedsysweekly.com/img/issues/102/Atmel-ATmega328P@2x.jpg).

Happy reading!

### Articles 
[Coding in C for MCUs: Sort Structs to Save Code Size](https://philmulholland.medium.com/coding-in-c-for-mcus-sort-structs-to-save-code-size-7a311e83a5db)  
Great article that starts from an example to explain, very clearly, the impact of a struct declaration order on the memory usage and on the memory accesses.

[How I think about C99 strict aliasing rules](https://alanwu.space/post/strict-aliasing/)  
Article fascinating on how we can be fooled by the strict aliasing rule. The second part is a practical example from an actual project.

[(Unofficial) Firmware Upgrade for Dyson V6/V7 Vacuum Battery Management System](https://github.com/tinfever/FU-Dyson-BMS)  
By disassembling the original firmware and analysing the IC doing the battery management, the author discovered that Dyson decided to shutdown by software and definitely the battery of their vacuum as soon as a moderate unbalance of the cells appears. Pushed by the apparent unfairness of this Dyson design decision, he patched together a new firmware to continue to be able to use his vacuum. All the details and code are in the Git repository.

[Designing a programmable sound generator board](https://mcjack123.github.io/PSG/)  
The author designed its own card based on the PIC16LF1613 and coded everything in assembler.

[The Bombe Machine on an FPGA](https://people.ece.cornell.edu/land/courses/ece5760/FinalProjects/s2022/az292_kw456_lh479/az292_kw456_lh479/index.html)  
The bombe, created by Turing in 1939, is an electromechanical device that could decrypt the Enigma machine during WWII. Authors replicated the machine on a FPGA and they share how they did it in this article.

[Introduction to Firebloom (iBoot)](https://saaramar.github.io/iBoot_firebloom/)  
Interesting to read about Apple effort on securing the code C of its bootloader. Of course Apple did not open source the code, so the author reversed the binary to discover what Apple actually did. There are some interesting techniques to discover here.

### Jobs
[wolfSSL Inc., Embedded Systems Software Engineer, Full-time, Remote (Open to remote)](https://jobs.embedsysweekly.com/job/WMKpNYgb/embedded-systems-software-engineer)  
wolfSSL is a growing company looking to add a top notch embedded systems software engineer to our organization. wolfSSL develops, markets and sells the leading Open Source embedded SSL/TLS protocol implementation, wolfSSL.

[Enphase Energy, Sr. Firmware Test Engineer, Full-time, Austin TX (Partially remote)](https://jobs.embedsysweekly.com/job/xRmNqY6b/sr-firmware-test-engineer)  
Our mission at Enphase Energy is to advance a sustainable future for all. Today, our intelligent microinverters, which turn sunlight into an affordable, safe, reliable, and scalable source of energy, work with virtually every solar panel made, and when paired with our award-winning smart battery technology, we engineer one of the industry's best-performing clean energy systems.

### Tools / Libraries
[TinyUSB](https://docs.tinyusb.org/en/latest/)  
TinyUSB is an USB Host/Device stack for embedded systems. It is memory-safe (no dynamic allocation), thread-safe and supports an impressive list of MCUs.

### Education / Community
[Lets Build 8 Bit Computer](https://www.youtube.com/playlist?list=PLNUL7DzXzp_J4TztZYOVtayTfp0DV1z5H)  
Even though this video series is 8 years old, it is still a really good introduction series.

[x86 Opcode Structure and Instruction Overview](https://pnx.tf/files/x86_opcode_structure_and_instruction_overview.pdf)  
I think it is the clearer document available showing the relation between opcodes and instructions.

### Misc
[Symbian OS Kernel](https://github.com/SymbianSource/oss.FCL.sf.os.kernelhwsrv)  
The source code of the Symbian OS has been open sourced this week. Ahead of its time years ago, we now have access to the code of this piece of history.