Online course · Engineering
Embedded C on ARM and RISC-V: Registers, Interrupts, DMA and Drivers (RP2350 & ESP32-C3)
Bare-metal C on real boards: registers, interrupts, DMA, PIO and drivers you can test
Created by TrainSkool Trainer
- Engineering
- Intermediate
- English
- 30 lessons
- 17h 30m
- 9 assessments
- Certificate
Coming soon Launch price ₹1,999
This course is not open for enrolment yet.
About this course
For C programmers and Pico beginners who want to understand what really happens inside a microcontroller. You follow Kaveri Embedded Labs, a fictional Coimbatore firm building PumpGuard, a pump-shed monitor for farms, on a Raspberry Pi Pico 2 (RP2350) and an ESP32-C3 board. You will read the memory map, drive GPIO through pad, function-select and SIO registers, configure clocks and PLLs, write interrupt handlers and timers, share data safely with ring buffers, build UART, I2C and SPI drivers from a datasheet (a BME280 sensor), move data with DMA, write PIO programs for WS2812 LEDs, set up linker scripts, watchdogs, fault handlers and sleep modes, and debug with SWD/JTAG, OpenOCD and GDB. Current to Pico SDK 2.3.x and ESP-IDF v6.1 at the time of writing. Every lesson has a lab on a real board with wiring, expected serial output and a PASS line; all board code is compile-checked. Prerequisite: C & C++ Programming Fundamentals or the Pico 2 beginner course. Included: 30 text lessons with slides and quick checks, 28 auto-checked C exercises that model the logic on your PC, 7 chapter projects, chapter quizzes, a rubric-graded capstone driver library, a 20-question final exam and a certificate of completion. Lessons are text and slides; trainer videos are coming later. Not affiliated with or endorsed by Raspberry Pi Ltd, Espressif, STMicroelectronics or Arm. What you will be able to do: - You will be able to read an MCU memory map and control peripherals through registers with safe bit operations - You will be able to build, flash and debug firmware with the Pico SDK, ESP-IDF, OpenOCD and GDB - You will be able to configure GPIO pads, clocks and PLLs and read inputs reliably with debouncing - You will be able to write interrupt handlers and timers and share data with ISRs without races - You will be able to write UART, I2C and SPI drivers from a datasheet, including a BME280 sensor driver - You will be able to move data with DMA and write PIO state-machine programs on the RP2350 - You will be able to explain linker scripts and startup code and add watchdogs, fault capture and sleep modes - You will be able to ship a portable, host-tested sensor driver library that runs on two architectures
What you'll learn
- Read an MCU memory map and control peripherals through registers with safe bit operations
- Build, flash and debug firmware with the Pico SDK, ESP-IDF, OpenOCD and GDB
- Configure GPIO pads, clocks and PLLs and read inputs reliably with debouncing
- Write interrupt handlers and timers and share data with ISRs without races
- Write UART, I2C and SPI drivers from a datasheet, including a BME280 sensor driver
- Move data with DMA and write PIO state-machine programs on the RP2350
- Explain linker scripts and startup code and add watchdogs, fault capture and sleep modes
- Ship a portable, host-tested sensor driver library that runs on two architectures
Course content
Chapter 1 · Module 1: Inside a Microcontroller — Cortex-M33 and RISC-V on the RP2350 and ESP32-C3
- Code lab: What a Microcontroller Really Is: CPU, Buses, Memory and PeripheralsThroughout this course we follow a small product team.15 topics · 32 min
- Code lab: Inside the RP2350: Cortex-M33 and Hazard3 RISC-V Cores, Bus Fabric and Memory MapAfter the bring-up program worked, Senthil handed Divya the RP2350 address map and asked: when PumpGuard stores its sample counter, its calibration table and its code, where exactly does each one…17 topics · 34 min
- Code lab: Inside the ESP32-C3: One RISC-V Core, ROM, Flash Cache and the Peripheral MapKEL's second PumpGuard version runs on an ESP32-C3, because a later product revision will add Wi-Fi and the C3 has the radio on chip.17 topics · 32 min
- Code lab: Embedded C Essentials: Fixed-Width Types, volatile, Bit Manipulation and Register StructsDivya's first code review at KEL came back with six comments, and none of them was about logic.23 topics · 36 min
Chapter 2 · Module 2: Toolchains, Building, Flashing and Debugging
- Code lab: From C Source to Flash Image: Compiler, Linker, ELF, BIN and UF2A PumpGuard prototype in a Pollachi pump shed started rebooting every few minutes, and Senthil asked Divya three questions she could not answer: how big is the image, how much RAM does it use before…16 topics · 34 min
- Code lab: Building with the Pico SDK: CMake, Targets, stdio and picotoolThe first PumpGuard builds compiled on Divya's laptop and nowhere else: an SDK path typed into an IDE dialog, a USB setting changed in a menu nobody wrote down.18 topics · 34 min
- Code lab: Building with ESP-IDF: idf.py, Components, menuconfig and Partition TablesKEL's second PumpGuard variant runs on an ESP32-C3 and is built with ESP-IDF, Espressif's official framework.16 topics · 36 min
- Code lab: Debugging on Real Hardware: SWD, JTAG, OpenOCD and GDBFarhan's bench test of PumpGuard showed a strange fault: after a few minutes the pump LED switched on at the wrong tank level.22 topics · 36 min
Chapter 3 · Module 3: GPIO by Registers, Pads and Clocks
- Code lab: GPIO from the Ground Up on the RP2350: Pads, Function Select and SIO RegistersThe first PumpGuard prototype on Divya's bench blinked its "pump" LED with gpio_put(15, 1), and it worked.15 topics · 34 min
- Code lab: GPIO Registers on the ESP32-C3 and a Portable GPIO Layer in C1 and an ESP32-C3 board that will later get Wi-Fi. Divya's first instinct was to copy the pump-control code and change the pin calls.15 topics · 34 min
- Code lab: Clocks, Resets and PLLs: Where Every Timebase Comes FromFarhan, KEL's test engineer, reported a strange PumpGuard fault: the UART log was perfect on the bench but garbled on one batch of boards.15 topics · 34 min
- Code lab: Reading Inputs Reliably: Pull Resistors, Debouncing and Edge DetectionPumpGuard has to know when the borewell pump is running. On the real product that signal arrives from the pump starter panel through an isolated sensing circuit; in our labs it is a push button.21 topics · 32 min
Chapter 4 · Module 4: Interrupts and Timers
- Code lab: Interrupts on Cortex-M33: The NVIC, Vector Table, Priorities and ISR RulesAt the end of chapter 3, Divya's PumpGuard firmware read the pump-run input by polling: the main loop looked at the pin every millisecond, debounced it and moved on.18 topics · 34 min
- Code lab: Interrupts on the ESP32-C3: The Interrupt Matrix and GPIO ISRs in ESP-IDFKEL's second PumpGuard build runs on an ESP32-C3, because the next product revision will report over Wi-Fi.16 topics · 32 min
- Code lab: Hardware Timers and Alarms: Periodic Ticks, Timeouts and Pulse MeasurementPumpGuard has to do things on time: sample the BME280 every second, blink a heartbeat LED, give up on a sensor that does not answer, and measure the water level in the overhead tank of a pump shed…17 topics · 36 min
- Code lab: Sharing Data Between ISRs and Main Code: Races, Ring Buffers and Critical SectionsFarhan, KEL's test engineer, leaves a PumpGuard prototype running over a weekend on the bench in Coimbatore with a signal generator on the pump-run input.24 topics · 34 min
Chapter 5 · Module 5: Serial Drivers from Datasheets — UART, I2C and SPI
- Code lab: Reading a Datasheet Like a Driver Writer: Register Maps, Timing Diagrams and Electrical LimitsUntil now PumpGuard has only talked to things on its own chip: GPIO pads, timers, the interrupt controller.15 topics · 32 min
- Code lab: UART Drivers: Baud Rates, Framing, Interrupt-Driven Receive and a Line ProtocolEvery PumpGuard node in a pump shed has a service connector: three pins, TX, RX and ground, where Farhan from test (or a field technician from the dealer in Pollachi) plugs in a USB-to-UART adapter…15 topics · 34 min
- Code lab: I2C Drivers: Addressing, Register Reads, Pull-ups and a BME280 Driver1 Divya proved that a BME280 answers on the bus.16 topics · 36 min
- Code lab: SPI Drivers: Clock Modes, Chip Select, Full-Duplex Transfers and the BME280 over SPIThe I2C build of PumpGuard works on the bench.21 topics · 34 min
Chapter 6 · Module 6: DMA and PIO — Moving Data Without the CPU
- Code lab: DMA Fundamentals: Channels, Transfer Sizes, DREQ Pacing and ChainingBy the end of chapter 5, PumpGuard reads a BME280, logs over UART and measures the tank level.17 topics · 34 min
- Code lab: DMA in Practice: ADC Sampling, Ring Buffers and Peripheral TransfersFarhan wants to see what the pump motor does in the first second after it starts.16 topics · 34 min
- Code lab: PIO on the RP2350: State Machines, the PIO Instruction Set and Your First ProgramSome signals are too fast or too strict for software. 25 us slot, and a single late interrupt in the middle of a frame turns green into a random colour.17 topics · 36 min
- Code lab: PIO Drivers: WS2812 RGB LEDs and Measuring Pulses with a State MachineLakshmi in production wants every PumpGuard to show its state on one RGB LED that a farmer can read from the shed door: green for a healthy tank level, amber for low, red for very low, blue for a…22 topics · 36 min
Chapter 7 · Module 7: Robust Firmware — Memory Map, Linker Scripts, Watchdogs and Low Power
- Code lab: Memory, Linker Scripts and Startup Code: What Runs Before mainThree weeks before the first PumpGuard field trial at a coconut farm near Pollachi, Divya hit a bug that made no sense.15 topics · 34 min
- Code lab: Watchdogs, Resets and Fault Handling: Firmware That RecoversPumpGuard nodes live in pump sheds where nobody looks at them for weeks.15 topics · 34 min
- Code lab: Low-Power Design: Sleep Modes, Clock Gating and Measuring CurrentNot every PumpGuard shed has reliable mains.22 topics · 32 min
Chapter 8 · Module 8: Capstone — The Kaveri Sensor Driver Library
- Code lab: Capstone Brief: Requirements, Architecture and Build Plan for kel_sensorsSeven modules ago Divya Natarajan could blink an LED with the Pico SDK and not much more.6 topics · 40 min
- Code lab: Building and Testing kel_sensors: Bus Abstraction, BME280 Driver, Host Tests and Board RunsDivya's first attempt at the shared BME280 driver was a copy of the Pico code with #ifdef ESP_PLATFORM sprinkled through it.18 topics · 50 min
- Code lab: Deliverables, Board Test Report and Grading RubricSenthil reviews every library that goes into a KEL product the same way: he clones the repository on a clean PC, runs the host tests, flashes both boards from the instructions in the README, and…6 topics · 40 min
Assessments and certificate
- Module 1 quiz: Inside a Microcontroller — Cortex-M33 and RISC-V on the RP2350 and ESP32-C38 questions · 15 min · pass mark 70%
- Module 2 quiz: Toolchains, Building, Flashing and Debugging8 questions · 15 min · pass mark 70%
- Module 3 quiz: GPIO by Registers, Pads and Clocks8 questions · 15 min · pass mark 70%
- Module 4 quiz: Interrupts and Timers8 questions · 15 min · pass mark 70%
- Module 5 quiz: Serial Drivers from Datasheets — UART, I2C and SPI8 questions · 15 min · pass mark 70%
- Module 6 quiz: DMA and PIO — Moving Data Without the CPU8 questions · 15 min · pass mark 70%
- Module 7 quiz: Robust Firmware — Memory Map, Linker Scripts, Watchdogs and Low Power8 questions · 15 min · pass mark 70%
- Module 8 quiz: Capstone — The Kaveri Sensor Driver Library7 questions · 15 min · pass mark 70%
- Embedded C on ARM and RISC-V: Registers, Interrupts, DMA and Drivers (RP2350 & ESP32-C3) — final assessment20 questions · 40 min · pass mark 70%