Cheat sheet · Build products
Embedded systems and IoT cheat sheet (STM32)
Opens with creditsFor students and early-career engineers building devices on STM32, from C and registers to the HAL, protocols, FreeRTOS and a connected dashboard. Snippets use the STM32Cube HAL generated by STM32CubeMX and built in STM32CubeIDE or VS Code.
Chapters
10 chapters · 73 concepts
1C for embeddedThe parts of C that matter most on hardware: exact-width integers, bitwise operations, pointers to registers, volatile and where your variables live in memory.7 concepts
- 1Fixed-width integersTypes from stdint.h such as uint8_t, int16_t and uint32_t whose size is the same on every compiler and chip, unlike int, whose size depends on the platform.
- 2Bitwise set, clear, toggle and testUsing OR to set a bit, AND with an inverted mask to clear it, XOR to toggle it and AND to test it, with shifts to build the mask.
- 3Memory-mapped registersPeripheral control and status registers appear at fixed addresses, so C reads and writes them through pointers to those addresses.
- 4volatileA qualifier telling the compiler a variable can change outside the code it can see, so every read and write must really happen.
- 5Pointers on hardwareA pointer holds an address.
- 6Flash, RAM, stack and heapCode and constants live in flash.
- 7const and staticconst marks data that never changes, so the toolchain can keep it in flash. static inside a function keeps a value between calls; at file level it hides the…
7 in this chapterOpen this chapter2Electronics you needEnough circuit theory to wire things without smoke: Ohm's law, resistors for LEDs, dividers, logic levels, pull-ups, a shared ground and clean power.7 concepts
- 1Ohm's law and powerVoltage equals current times resistance (V = I x R), and power equals voltage times current (P = V x I).
- 2LED current-limiting resistorA resistor in series with an LED sets its current: R = (supply voltage minus LED forward voltage) / desired current.
- 3Voltage dividerTwo resistors in series across a voltage give Vout = Vin x R2 / (R1 + R2) at their midpoint.
- 4Logic levels: 3.3 V and 5 VThe voltages a chip reads as low and high.
- 5Pull-up and pull-down resistorsA resistor that holds an input at a known level when nothing drives it: a pull-up to the supply, a pull-down to ground.
- 6Common groundAll connected devices must share the same ground, because every voltage is measured relative to it.
- 7Power supply and decouplingA regulator gives the board a steady voltage, and small capacitors (often 100 nF) placed next to each chip smooth out quick dips in current.
7 in this chapterOpen this chapter- Microcontroller basicsHow a board runs your code: the build and flash cycle, GPIO modes, debouncing, timers and PWM, interrupts and timing without blocking.8 conceptsOpens with credits
- Protocols: UART, I2C and SPIThe three wired buses nearly every sensor and module uses, how to wire each one and how they compare.6 conceptsOpens with credits
- Sensors and actuatorsReading the physical world and acting on it: datasheets, ADCs, filtering and calibration, and switching loads such as motors and relays safely.7 conceptsOpens with credits
- RTOS basicsRunning several jobs at once safely: the superloop, FreeRTOS tasks, queues, mutexes and semaphores, and on the Raspberry Pi, Linux threads and services.7 conceptsOpens with credits
- Wireless and IoTGetting data off the device: Wi-Fi, MQTT and its topics and QoS, BLE, long-range radios, security and updates in the field.10 conceptsOpens with credits
- Cloud dashboards for devicesWhere readings go after MQTT: a broker you run, a payload format, time-series storage, flows and dashboards, and alerts people can trust.7 conceptsOpens with credits
- Debugging hardwareFinding faults when the problem might be code, wiring or power: meters, logic analysers, debuggers, logs, watchdogs and brownouts.7 conceptsOpens with credits
- Portfolio: a working deviceTurning a prototype into proof: a power budget, low-power modes, a tidy build, a bill of materials, measured results and a write-up.7 conceptsOpens with credits
- 11Glossary, A to ZEvery concept in the sheet and the smaller terms it uses, in one list.140 terms
About this sheet
C, microcontrollers, sensors, MQTT.
Related on Sefism
Picked from the other libraries by shared topics.
Project structures
See allCareer questions
See all- Can I learn programming with an old laptop or slow internet?Yes. Most programming needs very little computing power. Choose lightweight tools, download documentation and material when you have a connection, work offline in focused blocks, and plan around power cuts. Avoid heavy setups such as large IDEs, emulators and big local containers until you have better hardware.
- Should I start embedded systems with Arduino, ESP32, STM32 or Raspberry Pi?Start with Arduino and ESP32 if you want quick, cheap wins and connected projects, STM32 if you want industry-style firmware and a real debugger, and Raspberry Pi if your project needs Linux, a camera or a gateway. Pick one, go deep for a few months, and the others become easy later.
- How do I become an embedded systems engineer as a computer or electrical engineering student?Learn C properly, enough electronics to wire safely, one microcontroller in depth, the UART, I2C and SPI buses, an RTOS and a debugger, then finish one real device with measured results. Employers hire embedded engineers on evidence that you can make hardware work, so your projects and write-ups matter more than certificates.
Work with me
Stuck on something specific?
Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.
- 1:1 Mentorship
- Fresh Graduate Mentorship
- Career Guidance
Brand deals, promos and partnerships: tauseeffayyaz@gmail.com