Mastering Embedded C Programming on STM32 Platform
Level-1: Duration – 60 Hrs
Level-2: Duration – 60 Hrs
Program Objective:
To equip learners with industry-relevant technical skills and enhance their job readiness through project-based learning, hands-on tool exposure, and real-world application deployment, thereby preparing them for successful employment in core domain areas
- Level 1 – Embedded Hardware and C Programming – 60 Hrs:
- Embedded hardware and Microcontroller Fundamentals (30 hours)
- Mastering C and Embedded C (30 hours)
- Level 2 – Firmware development Programming – 60 Hrs:
- STM32 MCU Bare-Metal Programming (15 hours)
- HAL and Driver Development (15 hours)
- Embedded Protocols (15 hours)
- FreeRTOS Programming (15 hours)
- Project Development and Integration
- Embedded Project Work on Multi-Peripheral Integration and Real-Time Data Acquisition (AGILE+SCRUM+GIT+GITHUB)
Program Outcomes
- Build strong logical, structured, and systems programming skills
- Build a strong foundation in embedded programming, microcontroller interfacing, and real-time system design.
- Empower students to design intelligent embedded systems and gain expertise ii communication protocols
- To equip engineering students with industry-relevant software and hardware skills, enhancing their employability in the embedded systems and AI domains
- Integration of hardware and software skills, enabling participants to contribute effectively to cross-functional teams
Tools / Platform:
- Ubuntu (Linux OS, with gcc compiler)
- WSL (Windows Subsystem for Linux)
- Code::Blocks, VSC, Dev-C++
- STM32F446RE NUCLEO BOARD
- STMCubeIDE, STMCubeMX
- FreeRTOS
- Keil uVision IDE, Flash Magic
LEVEL 1: Embedded Hardware and C Programming (60 Hours)
Module 1 : Embedded Hardware and Microcontroller Fundamentals | ||
---|---|---|
Signal Conditioning Circuits: Operational Amplifiers (Op-Amps): Amplifiers, Buffers/Voltage Followers, Comparators, Filters (Active), Current-to-Voltage Converters, Voltage Dividers. Analog-to-Digital Converters (ADCs): Purpose, Types, Key Specs. Digital-to-Analog Converters (DACs) Oscillator Circuits: Crystal Oscillator, RC Oscillator. |
Power Management Circuits: Voltage Regulators, Power-on Reset (POR)/Brown-out Reset (BOR) Circuits, Current Limiting Circuits, MOSFETs/BJTs (as switches), Motor Driver ICs (e.g., H-bridges). Digital Logic: Logic gates (AND, OR, NOT, XOR, NAND, NOR, XNOR) and truth tables. |
Basic Combinational Logic: Adders, MUX, DEMUX, Encoder, Decoder. Basic Sequential Logic: Flip-Flops, Shift Registers, Counters. Microcontroller Architecture & Fundamentals: CPU Core, Clocking System, Power Management, Reset System. |
Reading and Interpreting Hardware Documentation: Datasheets, Reference Manuals, Schematics. |
Basic Debugging & Measurement Tools: Multimeter, Oscilloscope, Logic Analyzer, JTAG/SWD Debugger. |
CRANES VARSITY (A Division of CSIL) St. Marks Road, Bangalore Ph: 080-6764 4800/4848 (www.cranesvarsity.com) |
Module 2 : Mastering C and Embedded-C | ||
---|---|---|
Literals, Data types, qualifiers, variables, operators: Unary, Binary and Ternary, Presidency and associativity of operators evaluation. | Control flow statements: if-else, switch, while, do-while, for loop, use of break and continue in loops. | Modular Programming using functions: Declaration, definition, function call, parameter passing (call by value, call by address). |
Numeric Arrays: 1D and 2D arrays, declaration, initialization, input, processing and output. | Character Arrays, String functions, Storing string in R/W memory, RO memory. | Bitwise Operations: AND, OR, XOR, NOT, left/right shift (Crucial for register manipulation). |
Storage Classes: auto, static, extern register. Pointers: Declaration, initialization, pointer arithmetic, void pointer, NULL pointer. | Pointers: Advanced usage, pointers to functions, and their role in ISRs and callbacks. | Memory Management: malloc(), free(), stack vs heap memory. |
Data Structures: Structures, unions, enums, alignment in memory. | volatile and const keywords: Importance in embedded programming. | Macros and Preprocessor Directives: Conditional compilation (#ifdef, #ifndef), #define. |
Compiler and Linker Concepts: Cross-compilation, startup code, linker script, and memory sections (.text, .data, .bss). | Good Coding Practices: MISRA C, Static analysis, Code quality tools. | Version control with Git and GitHub. |
LEVEL 2: Firmware Development Programming (60 Hours)
Module 1 : STM32 MCU Bare Metal Programming | ||
---|---|---|
STM32F4XX MCU Architecture and Features: Cortex-M4 CPU with FPU & DSP Instructions, On-chip RAM/ROM, Peripherals. NUCLEO Board Features: Integrated Debugger/Programmer, Arduino Uno V3 Connectivity, ST Morpho Headers, Power Supply (3.3V/5V/7-12V). Software Tools: STM32CubeIDE and STM32CubeMX. | GPIO Programming: GPIO Input/Output/Alternate function modes, Register-level programming (MODER, OTYPER, OSPEEDR, PUPDR, IDR, ODR). Configuring pins for digital I/O, LED blinking, button interface. | Interrupts and NVIC: Polling vs interrupts, ISRs, NVIC architecture and registers, enabling and configuring interrupts for GPIO pins. |
Timers and PWM: Timer modes (up/down counting, PWM, input capture), configuring timer registers, generating PWM signals for motor control or LED dimming. | ADC: Resolution, sampling rate, conversion time, single/continuous conversion, DMA mode, reading analog sensor data. | CRANES VARSITY St. Marks Road, Bangalore Ph: 080-6764 4800/4848 (www.cranesvarsity.com) |
Module 2 : HAL and Driver Development | ||
---|---|---|
Introduction to HAL and CubeMX: Project configuration and code generation. | HAL APIs: GPIO, Timers, ADC – using generated code in STM32CubeIDE. | LED and push button interfacing using STM32CubeMX and HAL APIs. |
Generating square wave using HAL. | Controlling LED brightness with PWM via HAL. | Driver Architecture: Layered approach, writing custom drivers, API design, integration. |
Module 3 : Embedded Protocols | ||
---|---|---|
UART/USART: Baud rate, data bits, stop bits, parity, communication using HAL and bare-metal (polling, interrupt, DMA). | I2C: Master/slave mode, start/stop, ACK/NACK, interfacing EEPROM and temperature sensors. | SPI: Master/slave, MOSI, MISO, SCLK, NSS, interfacing SD card, external flash, display. |
Module 4 : FreeRTOS Programming | ||
---|---|---|
Introduction to RTOS and FreeRTOS: Tasks, threads, concurrency, task states (running, ready, blocked, suspended), scheduling (pre-emptive vs co-operative). Creating FreeRTOS projects in STM32CubeIDE and running multiple tasks. | Inter-Task Communication: Queues for message passing, semaphores (binary, counting, mutex), protecting shared resources, event groups, and software timers. | Embedded Project Work: Designing a multi-threaded FreeRTOS system that: 1. Reads sensor data via I2C/SPI. 2. Displays data on UART. 3. Controls actuator (fan using PWM). 4. Manages real-time tasks using RTOS, AGILE + SCRUM + GIT + GitHub. |