
Discover the fundamentals of embedded systems, their structure, and how C programming with STM32 cube IDE enables practical development for MCU and MPU architectures.
Explore the fundamentals of embedded systems, including hardware, software, and real-time operating systems, and see how single-function, tightly confined, reactive designs power devices like fire alarms and microcontrollers.
Explore the architecture of an embedded system, from user input through software, hardware, and the OS, highlighting how physical devices produce output.
Compare microcontrollers and microprocessors, highlighting MCU architecture, integrated single-chip design, CPU cores, and memory layouts, with emphasis on memory types and bit-width options in embedded systems.
Master the environment setup for embedded systems by installing stm32 cube ide, downloading across Linux, Mac, and Windows, and configuring J-Link driver and stealing driver with a workspace.
Explore how embedded C uses single-line and multi-line comments, processor directives, and port configurations, then cover variables, main function, and flow control.
This lecture introduces variables in C, covers data types like integers, floats, and characters, and explains declaring, defining, naming, and initializing variables.
Explore how C operators perform operations on operands to enable data manipulation, covering assignment, arithmetic, relational, logical, bitwise, size of operator, conditional, and comma operators.
Explore arithmetic operators for addition, subtraction, multiplication, division, and modulus on two numbers, and demonstrate assignment operators like plus-equal updating the left-hand side.
Master relational and logical operators, using and, or, and not gates to combine conditions with n1, n2, and n3; understand how true or false outcomes arise and preview bitwise operators.
Explore how bitwise operators perform bit-level manipulation in C, including size of operator, and see six operators with patterns like 5 and 9, contrasting them with logical operators.
Explore how bitwise operators in C manipulate binary values, including and, or, xor, and not, along with left and right shift, through practical examples and output predictions.
Master bitwise operators in C, including and, or, xor, not, left and right shifts, and use the size of operator to identify size for types like float, int, and char.
Explore conditional operators and comma operators in embedded C, using the ternary operator as a simple substitute for if-else to determine pass/fail based on a marks threshold.
Learn how the comma operator in C evaluates expressions left to right, discards the left results, and returns the rightmost value, illustrated with a, a+6 and printf.
Explore C storage classes auto, register, static, and external, their memory locations, lifetimes, and scopes, with examples illustrating local and global access and initial values.
Explore how flow controls in C manage execution order, enabling decisions and loops through constructs like for, while, do while, if else, switch, break, and continue.
Explore how if condition and flow control statements direct execution, covering simple if, if else, nested if, multiple ifs, and switch with a 75 score certificate example.
Explore nested if conditions in C for embedded systems, using score-based branching to assign expert, intermediate, or basic certifications, and distinguish outer and inner if statements.
Learn to categorize exam scores using multiple if-else statements, assigning expert, intermediate, or beginner certified levels based on score ranges, with validation for 0–100 and invalid inputs.
Explore for loop, while loop, and do while loop, and differentiate pre-tested loops (entry point) from post-tested loops (exit point), noting do while runs at least once.
Explore how a for loop initializes a counter, tests a condition, and updates to repeat tasks, using a simple print example and a semicolon pitfall that alters the output.
Master the while loop: initialization outside, condition checks, and optional updation, while avoiding infinite loops. Compare for and while by start and end points, and note do while next.
Explore control transfer statements in embedded C, focusing on break and continue, their effects on loops and switches, and how goto and return alter program flow.
Explore how the goto statement jumps to labeled code blocks and how return marks function termination, with examples using a for loop, even numbers, and unreachable code.
Explore functions in C programming as reusable blocks of statements that perform a task, enabling reuse and modularity through declaration, definition, and call, with or without parameters and return types.
Explore basic functions in C by declaring, defining, and calling the add numbers function with and without parameters, and pass 10 and 20 to see 30 and 60.
Explore arrays in C as fixed-size, contiguous memory structures that store similar elements. Learn 1d, 2d, and 3d arrays and how they relate to pointers, structures, and primitive types.
Declare and initialize a five-element array, using the subscript operator to access values and print them, then iterate with a for loop to show memory layout.
Explore how a three dimensional array builds on two dimensional matrices by stacking 2D arrays and indexing elements within a 2x2 grid.
Show how to access a three dimensional array with nested for loops over array, row, and column, printing with indices to illustrate its structure.
Learn how to work with arrays and functions, pass an array and its size to a function, and print marks using a for loop and scanf.
In this course, learn how pointers in C store the memory address of another variable and enable access and modification of data, powering low level access and dynamic memory allocation.
Explore pointer to a pointer in C, showing how a pointer stores the address of another pointer with two stars. Print addresses and values by dereferencing single and double pointers.
Master string handling in C by declaring strings with and without size and terminating with the null character. Use printf and functions like strlen, strcmp, and strcat, plus case conversion.
Explore how pointers manage strings in C, storing character arrays and addresses, printing with printf and %s, and navigating two-dimensional arrays of strings for embedded system applications.
Master storing and printing multiple strings in a two-dimensional character array, using pointers, indices, and for loops with printf to output each string.
Build the project, generate the hex file, and prepare it for deployment to a ROM chip. Use Proteus Design to configure the 8051 microcontroller and LED outputs.
Explore memory management and input/output programming for embedded systems using C with STM32 Cube IDE, covering data types and variables, storage classes, functions, typecasting, and debugging fundamentals.
Download the eclipse-based STM32 cube IDE by STMicroelectronics, the integrated development environment for developing, compiling, linking, and debugging embedded projects, with latest Windows, Linux, or macOS options.
Import STM32 Cube IDE projects by organizing host and target folders within a dedicated workspace. Import, copy, and build with GCC, and configure the C/C++ build environment paths as needed.
Create a host project in the IDE on Windows with the min gw GKE toolchain, then build and run a main.c to verify output before targeting the STM32 discovery board.
Create a target stm32 project in the ide, choose c language, set executable binary, and build for discovery hardware, while consulting datasheets and manuals.
Explore the onlinegdb web tool to write and run basic C programs and view outputs. Use the installed IDE for programming the target board, since online tools can't handle it.
Explore escape sequences in C, including printing quotes and backslashes, null characters, and control codes such as \a, \b, \f, \n, \r, \t, and \v.
The lecture walks through printf exercise 3 solution, showing escape sequences, printing backslashes with double backslashes, and using \n for newlines while debugging errors.
Learn how comments document code, explain behavior and logic, and stay ignored by the compiler. Compare single-line and multi-line C comments, including // and /* */ syntax.
Explore how C uses data types and variables to represent real-world data, including integers, floats, characters, strings, and unsigned or signed variants with examples like temperature and gender.
Define and print a range of variables, including char data type, using printf with format specifiers, illustrating signed and unsigned integers, long variants, and floating point types.
Create two variables for A to B and B to C, compute their sum as A to C, and print the result in the given format using printf.
Explore the difference between declaring and defining a variable in C, including extern usage and how local versus global scope affects storage and undefined references.
Storage classes in C determine the scope, visibility, and lifetime of variables and functions, highlighting static and external specifiers. A static local variable preserves its value across function calls.
Learn how static storage class specifiers control variable visibility across multiple files, and how extern enables sharing a global variable with file one, file two, main, and function prototypes.
Explore how the static keyword makes a function private to a single file, with file1.c and main.c sharing a prototype, and preventing external calls through proper scope.
Use the extern keyword, the external storage class specifier, to extend the visibility of variables and functions across multiple files, enabling access to globals from other files, unlike single-file projects.
Learn to implement and call a three-parameter C function with a prototype and definition, and print the result in embedded systems using a main without parameters.
Learn to return a value from a function to the calling program using a float return type and a return statement, store it in main variable, and avoid uninitialized results.
Explore implementing C functions for add, subtract, multiply, and divide, using headers and prototypes, and display results with printf in decimal and hex formats for integers and floats.
Explore ascii codes and the ascii table, encode characters using 7-bit values, and print strings by their ascii values with printf using %c and %d, including practical hello example.
Create an STM32 F4 project and write a hello world program in C using printf, exploring the inc, source, and startup structure and handling a compiler warning.
Discover how the STM32F4 discovery board, with an ARM Cortex-M4 and on-board ST-LINK, enables SWD or SWO tracing for printf-style debugging.
Learn how to build and cross-compile for an arm target using the IDE, understand elf versus bin and hex formats, and connect an stm32 board for debugging.
Identify common debugging issues in the STM32 IDE, learn to terminate and relaunch debug sessions, and troubleshoot console termination errors to keep debugging running smoothly.
Learn how to view and adjust stm32 cube ide compiler settings, including toolchain version, mcu settings, runtime library, post-build outputs, debugging options, while keeping defaults.
Explore how the cross compiler handles pre-processing, parsing, assembling, and linking to produce a dot elf file and generate artifacts like list files, linker maps, and makefiles for post processing.
Explore the size of operator on an embedded STM32 target, using a cross compiler and printf to print storage sizes of standard C data types within the IDE environment.
Explore how a microcontroller combines a cpu, non-volatile program memory, volatile data memory, address and data buses, and clocking to execute instructions and host peripherals.
Learn to access flash and sram memory on stm32 f4 using a memory browser, view program machine codes, and explore base addresses and memory maps.
Use the disassemble feature with objdump -D on the elf to view stm32 assembly, including the main function and code sections. Set breakpoints and step through to inspect instruction-level execution.
Learn instruction level debugging in the STM32 IDE using the disassembly window and instruction stepping mode; enable step into and step over to inspect instructions without breakpoints.
Master embedded systems with C on STM32 by mastering data types, including floating point, and pointers. Explore input with scanf, bitwise operations, and leds control through memory mapped registers.
Explore how decimals and real numbers are stored in memory using the IEEE 754 floating point representation, and compare floating point types float and double for large or fractional values.
Explore scanf, the standard library input reader for embedded C, and learn using format specifiers like %d and the address operator to store integers and characters.
Read four numbers with scanf, compute their average as a float, and print the result with printf, using fflush(stdout) to flush the output buffer.
Explore scanf exercise implementation part 2 for embedded systems with C and ARM Cortex, building area calculations for square, rectangle, triangle, trapezoid, and circle with input validation for negative values.
Create a C++ project named scanf_exercise_two, add main.c, and write a program that reads six characters using getchar or scanf, then prints their ASCII codes in numeric form.
Learn to read six characters with scanf and %c, print each ASCII code with %d or %u, and reuse code blocks while exploring input buffering.
Master pointers in C for embedded systems, learn how pointers address memory locations, read and write data to peripherals, and perform pointer arithmetic across 32 bit and 64 bit architectures.
Learn how to read data from a pointer by dereferencing it, understand the address operator, and print pointer addresses and values with printf to illustrate memory access in C.
Create two pointer exercises that print and modify variable addresses and values using ampersand and asterisk operators, with int, float, and char variables.
Practice implementing pointer variables in C by declaring int, float, and char values, assigning their addresses to int*, float*, and char*, and printing values and addresses with printf.
Explore pointers in C by printing addresses and values with ampersand and asterisk operators, and use printf to handle int, float, and char variables on STM32 embedded systems.
Explain how stdint.h provides fixed-width aliases like int8_t and uint16_t to prevent portability bugs when compilers choose different int sizes, ensuring reliable embedded C across ARM Cortex targets.
Learn about operators in C, including unary, binary, and ternary operators, and explore arithmetic, relational, logical, bitwise, and assignment operators, plus operator precedence with practical examples.
Explore unary operators in C, including post and pre increment and decrement, through concrete examples that show how operand order affects assignments and printed results.
Learn how unary operators apply to pointer variables in C, including that a uint32_t pointer increments by four versus the arithmetic increment, and how pointer type governs behavior.
Explore relational operators in C, which compare two operands and yield 1 or 0; learn left-to-right evaluation and the operators ==, !=, >, <, >=, <=.
Explore decision making in C with if statements, illustrated by a water level control example and single versus multiple statements using relational operators.
Write a C program using if statements to read a user’s age and print whether they are eligible to vote, with clear messaging for 18 and older.
Explore the if else statement in C, including single and multiple statements, true and false branches, and practical examples like voting eligibility and finding the greatest of two numbers.
Implement an if-else exercise in C by reading two integers, comparing them for equality or which is bigger, and robustly handling invalid input with scanf return checks and integer conversion.
Demonstrate the if else if ladder in C, using multiple conditions and execution order. Apply a practical income tax calculation exercise using four different conditions to determine tax payable.
Implement a tiered tax calculator using an if-else-if ladder in C. Validate income input and handle negatives while applying 0%, 12%, 22%, and 32% rates with a 1000 adjustment.
learners explore the C conditional operator, a ternary expression using ?: with three operands. The first operand's nonzero value selects the second expression; otherwise the third is used.
Pilot a switch-case exercise to compute areas of circle, triangle, trapezoid, square, and rectangle in a c plus plus project, with input validation to reject negative base, height, and radius.
Implement a switch-case area calculator in C for embedded systems, using stdio and stdint, to compute circle, triangle, and trapezoid areas from user input.
Explore bitwise operators in C for embedded systems, including and, or, not, xor, and left/right shifts; learn to test, set, clear, and toggle bits in memory and peripheral registers.
Build a C project to compute bitwise and, bitwise or, xor, and not on two input numbers using int32_t with printf and scanf.
Learn to determine even or odd numbers by masking with one using bitwise and in C. Explore setting the fourth and seventh bit positions.
Clear the fourth, fifth, and sixth bits with the bitwise and. Compare the masking approach to negating the mask and applying and, shown by 0x8F.
Explore how the xor bitwise operator toggles bits using masks to flip an led state on a microcontroller. Learn the two-operand truth table and apply xor to simplify toggling code.
Explore how to connect and identify LEDs on an stm32 f407g board by reading schematics, locating the leds on pd12 and pd15, and understanding gpio ports for microcontroller pin control.
Control port d pins via software by configuring gpio registers, setting pin modes, transmitting data, and reading values; access registers through memory-mapped i/o.
Explore how the 32-bit address bus and system bus target code memory and peripherals, and how the ARM Cortex memory map allocates four gigabytes of address space.
Explore the stm32 memory map and learn to locate peripheral base addresses using the f407 reference manual, including gpio, adc, uart, and ethernet registers.
Understand how the 32-bit address and 32-bit data system bus, under the AHB spec, map memory and peripherals in ARM Cortex-M microcontrollers, enabling pointer-based access to GPIO and ADC registers.
Identify the gpio port and pin 12 connected to the led. Enable the clock, set the pin to output, and drive it high or low.
Calculate gpio peripheral addresses by base address plus offsets, enable the clock via hb1enr, set pin 12 to output in moder, and drive odr bit 12 to turn on led.
Enable the GPIO peripheral clock by reading the register, OR-ing with the 0x08 mask to set the third bit, then writing back to preserve other bits.
Replace lines with a single C shorthand line, enable gpu clock on ahb1, configure gpio as output with two-bit fields, and set pin 12 high.
Demonstrate bitwise operations in C by inputting two numbers and calculating bitwise and, or, xor, and not, with console output and example results.
Explore how bitwise shift operators enable efficient bit masking in embedded systems. Learn to set or clear bits using left shifts for 8-bit, 32-bit, and 64-bit data, avoiding manual masks.
Modify led control by applying bitwise shift operators to set and clear gpio bits, using (1 << 3), ~(3 << 24), and (1 << 24) on stm32.
Extract bit 9 to 14 from a 16-bit data using a right shift and mask, storing the six-bit result into an 8-bit output variable.
master the while loop by building a C program that asks for a number and prints its multiplication table up to 12, using printf and scanf.
Engage in while loop exercise two by writing a C program that prompts for integers until zero. It then prints the sum of all positive numbers entered.
Explore the do while loop in C by prompting users to enter numbers until a negative input. Compute and print sum of all entered numbers using the do while loop.
Demonstrate a for loop that initializes, tests, and updates a counter to print a multiplication table from 1 to 9, extendable to 12, using %d and tabs for aligned rows.
Develop a c++ for loop exercise that reads a row count from the user and uses nested loops to print a right-angled asterisk triangle, with a newline after each row.
Modify the led on program into a led toggle by adding a software delay between led on and off, using a busy-wait loop to create a human observable delay.
Celebrate mastering data types, conditionals, pointers, memory management, and hardware peripheral control through embedded C programming on STM32, and commit to ongoing practice and exploration in embedded programming.
Explore the const type qualifier and volatile, showing how const enforces read-only variables and how volatile supports robust embedded C code for bug-free programs.
The lecture explains the const type qualifier, presents two definitions using const and uint8_t, and shows how a value cannot be modified by name but can be changed via pointer.
Explain memory placement of const variables: local const in RAM, global const in flash on STM32, and that modifying them via pointers is blocked and flagged by the compiler.
Understand how compiler optimization affects code, memory access, and power, and how the volatile type qualifier interacts with O0 to O3 levels.
Discover how the volatile qualifier prevents optimization of variable reads and writes in embedded C, with STM32 examples and disassembler insights.
Discover when to use the volatile qualifier to handle unexpected changes in memory mapped peripheral registers, shared global data, and multi-tasking scenarios, and how it influences compiler optimization.
Explore how structures in C define user defined data types by grouping different types, define a car model with members, and estimate memory for structure variables.
Demonstrates accessing structure members and initializing with C89 and C99 designated initializers via dot operators, using a car structure with multiple data types printed by printf.
Explore how alignment and padding affect a structure's memory usage by using the size of operator to print the Car model structure sizes in a starter embedded C project.
Master typedef with structs to create alias types like car_model_t, instantiate car_ford and car_honda, and explore nested or self-referencing structures for parameters and linked data.
Explore structures and pointers by creating structure pointers and reading and writing member data via base addresses. Learn memory basics, structure variables vs memory, and pointer type casting with uint8_t.
Modify structure elements using pointers by assigning values through a structure pointer. Access members with the arrow operator, pass the structure address to functions, and print results with printf.
Explore how to pass a structure to a function in C, comparing pass by value and pass by reference, and using dot and arrow operators to access fields.
Explore how unions share memory for multiple members, print short and long addresses, and observe memory overwrite when assigning values, using printf to verify results.
Explore how unions enable bit extraction and memory-efficient storage in embedded code, using a packet structure to illustrate bit fields and union and structure combinations.
Demonstrate mapping a 32-bit packet to fields with a union and a bit-field structure, replacing manual bitwise extraction in embedded C for STM32.
Learn to nest a structure inside a union, access members with dot notation, and save code by combining union and structure to map bit fields into memory efficiently.
Explore how structures and bit fields enable abstraction in embedded systems, refining the led toggle example and mapping peripheral register bits for driver interfaces.
Define typedef bit-field structures to encode peripheral registers, naming RCC_AHB1ER_t and GPIO registers, and build a STM32 led toggle bit-field project with GPIO mode and odr.
Create a bit-field structure for the ahb1enr register, marking multiple reserved fields, and define typedefs for gpio mode and gpio output data registers to enable seamless peripheral setup.
Modify the LED toggle exercise using typedef structures and bitfields to configure the Gpio mode register via a pointer, type-cast the address to RCC_AB1EN_t, and enable the Gpio clock.
Modify the led toggle exercise on STM32 using volatile constant GPIO pointers. Enable clock, configure the mode and output registers, and toggle pin 12 with a delay.
Learn how arrays in C store 100 values in one variable, enabling you to compute averages without 100 separate variables while highlighting base addresses and contiguous memory.
Initialize an array of ten values, read and write elements, and print results with a for loop and printf. Use zero-based indexing, update index 2 to 0x33, and reprint.
Learn how to pass an array to a function in C, using pointers, a display function, and optional length parameters or size calculations to print array elements.
Strings in C are arrays of characters terminated by a null character, marking the end of the string. Initialize and manipulate these strings using character arrays and functions like strlen.
Introduction: Dive into the powerful world of embedded systems where software meets hardware. This comprehensive course walks you through the fundamentals of embedded systems using the C programming language, and gradually transitions into advanced programming with ARM Cortex-based STM32 microcontrollers. Whether you are a beginner or a budding engineer, this course will bridge the gap between theory and hands-on embedded application development.
Section 1: C Programming for Embedded Systems This section sets the stage by providing a deep introduction to embedded systems, including their architecture, components, and differences between MCUs and MPUs. It then builds a solid foundation in the C programming language — starting from variables and operators to loops, flow control, functions, arrays, pointers, and strings. It wraps up with a complete embedded project cycle from coding to deployment, enabling learners to understand how C works in embedded environments.
Section 2: Embedded C Programming Essentials Learn how to get your hands dirty with real embedded development. This section focuses on installing and using STM32CubeIDE, creating host and target projects, compiler setups, and key debugging practices. You'll also refine your knowledge of C syntax, data types, functions, scope, and memory addressing through embedded-specific demos and tool-based exercises.
Section 3: ARM Cortex (STM32) Fundamentals – Building Embedded Systems Step into the ARM Cortex (STM32) domain where you apply C knowledge to manipulate I/O, control memory-mapped registers, and implement decision-making with real hardware. Learn core embedded programming concepts like bitwise operations, LED control, software delays, peripheral register access, and instruction-level debugging, leading to practical embedded system builds.
Section 4: ARM Cortex (STM32) Deep Dive – Mastering Embedded Systems Take your embedded skills to an expert level. This advanced section introduces compiler optimizations, const and volatile usage, memory placements, and extensive structure and union handling. It culminates in advanced applications like GPIO register manipulation via structures and hands-on system design with bit-fields, arrays, and strings.
Conclusion: By the end of this course, you'll confidently code embedded applications, manipulate hardware registers, and build real-time projects using C and STM32. You'll bridge the gap from basic C concepts to complex embedded projects that prepare you for industry-level challenges.