
Explore what a computer program does, why embedded systems favor C, C++, and Rust, and why C remains a leading language for embedded development today.
Explore the history of the C language, from K&R C to ANSI C and the ISO standards C89/C90, C99, and C11, and learn how to set the compiler for gnu11.
Explore STM32CubeIDE’s multi-OS, Eclipse-based platform with built-in cross compilers. See GNU-based ARM compiler, SWV debugging, registers and memory viewing, and STM32CubeMX integration (not used in this course).
Install STM32CubeIDE by downloading the archive, extracting it, and following the on-screen prompts to install into the C drive, including drivers, without unchecking options, then finish.
Install STM32CubeIDE on Ubuntu by granting executable permission to the installer script, running it with sudo, accepting the license, and launching the IDE without opening a workspace.
Install the host gcc to write and compile C programs on Windows, Linux, or Mac using the STM32CubeIDE, which already provides an ARM cross compiler.
Download the MINGW compiler package, extract CTOOLS.zip into the C drive, then add the mingw32/bin path to system PATH and verify gcc, rm, and make are recognized.
Install gcc on linux by updating apt and installing build-essential. If prompted, type y to proceed, then verify the gcc version with gcc --version.
Install the host compiler GCC on Mac by installing Homebrew, running brew.sh, then executing brew install gcc and verifying GCC is detected.
Learn to import course projects into STM32CubeIDE, set up Embedded-C folders, configure gcc paths, and build host and target projects in separate workspaces for cross-compile mastery.
Create a host project in STM32CubeIDE, configure MinGW GCC on Windows, add a main.c, build the project, and run the executable to test the code on the host.
Create a target project by selecting the STM32F4 discovery board in the board selector, using a C executable named TestProject, then build to produce an .elf for loading and debugging.
Explore the embedded target for this course: the stm32f407vgt6 cortex-m4 discovery board with rich io pins, an 8 MHz crystal, and onboard st-link/v2-a programmer, connected via mini usb.
Review basic C syntax and common library functions like printf and scanf using the OnlineGDB web tool for practice. Learn to create, compile, and run projects, with IDE changes ahead.
Write a simple C program that prints Hello World with printf, using main and stdio.h, and run it in an online or offline IDE to see the compilation steps.
Learn how printf handles new lines in C using escape sequences, especially the backslash-n, to move the cursor to the next line and print text.
Explore escape sequences in the C programming language, including newline, tab, null, carriage return, and how to print backslashes and quotes using printf.
Learn to print text with printf in embedded C programming, using escape sequences to include double quotes and newlines, and practice printing exact strings.
Explore how to solve the printf exercise by printing lines, using double quotes, and managing escapes for quotes, newlines, and backslashes.
Master how to document code in C with comments, including single-line // and multi-line /* ... */ styles, which do not affect execution but aid understanding.
Explore C data types and variables that represent real-world data, including strings. Identify integers and floats, understand signed vs unsigned, and note types like char, short, int, long, long long.
Discover C integer data types, their storage sizes, and value ranges across compilers; compare signed and unsigned chars, shorts, ints, longs, and long longs.
Explore the char data type as a 1-byte integer for ASCII characters, with signed and unsigned ranges. Learn variable definition by pairing data type with a name, with temperature examples.
Learn to define unsigned char variables for distances A2B and B2C, initialize them, compute their sum as A2C, and print the result with printf using %d or %u.
Understand how a 1-byte char holds signed and unsigned data, using two's complement, and learn the ranges -128 to 127 for signed and 0 to 255 for unsigned chars.
Explore short int and unsigned short int in embedded C, two bytes. Learn 2's and 1's complement representations and signed and unsigned ranges with 0xFFE7 and 0x0019.
Learn how int stores signed integers and unsigned int stores unsigned integers. Understand how sizes vary by compiler for int, unsigned int, long, and unsigned long in bytes.
Learn how the sizeof operator in the C programming language reveals the size of a variable or data type, with examples for char, short, int, long, and long long.
Learn how variables label memory locations, how the compiler replaces names with addresses, and the difference between variable definitions and declarations, plus rules for legal naming.
Explore the difference between variable declaration and definition in C, using extern, and distinguish local versus global storage while examining undefined reference errors.
Learn about local scope and global scope variables in C, explore function prototypes and variable access, and see how scope rules control visibility and program behavior.
Explore variable scope by comparing a global variable and a local uninitialized variable, learn about the assignment operator, and see how uninitialized my_var leads to unpredictable output and compiler warnings.
Understand that global variables are visible to all functions and accessible from other files, default to zero when uninitialized, and live until the program ends. Recognize that local variables stay inside a function, disappear after it ends, and may contain garbage values.
Learn how to obtain and print variable addresses in embedded C, using the ampersand operator and %p with printf, demonstrating memory locations and 64-bit address sizes.
Learn to store a variable's address with &a1, cast the pointer to a long long to handle 8-byte addresses, and print in hex.
Explore how storage classes in C define the scope, visibility, and lifetime of variables, and see how static and extern create private globals via a practical counting example.
Use static to restrict a global variable's visibility to a single source file, preventing external modification. Enable cross-file access for non-static data through extern declarations.
Learn how the static keyword makes a function private to a file, so only main.c can call change_system_clock and protect the system clock from external calls.
Explore the extern storage class specifier and how it extends visibility of functions and variables across multiple files, enabling access to a global variable defined outside a file.
Explain ASCII codes and how the ASCII table maps characters to numbers, show printing with printf and %c, and introduce arrays for strings.
Learn how to write, declare, and call functions in C, including function prototypes and the main function, to create modular, maintainable code.
Learn how function prototypes declare return types and argument lists. Include standard library headers to declare printf and ensure prototypes exist before calls to avoid implicit declarations.
Return a value from a function to the caller (main) by computing a sum, declaring an int return type, capturing the result in a variable, and printing the returned value.
Create a two-file c project with math.c and math.h implementing add, sub, mul, div, tested from main.c, using include guards and prototypes, with typecasting to long long and float.
Explore typecasting in c, learn implicit versus explicit casting, understand truncation and data loss, and see how to control conversions to prevent warnings and ensure correct results.
Explore typecasting in C by examining hex data; show how 6-byte values become long long int and warn about data loss when assigned to char, with pointers upcoming.
Create a hello world on an stm32 arm cortex m4 board using printf and stdio.h, include a startup file, and view output via swd swo with itm.
Learn to compile for arm cortex m4 with a cross compiler, load the .elf onto the target, and view printf output via swv itm data console over swo.
Resolve an STM32CubeIDE debugging issue with tracing showing unknown characters by removing all collected data and resetting the chip, then use terminate and remove to avoid final launch sequence errors.
Enable printf output on STM32 cortex-M0 via OpenOCD semihosting, configure the project and startup commands, and view prints in the debugger console, ensuring trailing newline.
Use the sizeof operator to determine embedded target data type sizes with a cross compiler. It also shows the IDE-created main function and an infinite loop.
Demonstrates using printf to print sizeof for char, short, int, long, long long, and double in a new microcontroller project; configure syscalls.c and monitor ITM channel 0 during debugging.
Learn how to access and adjust the STM32CubeIDE compiler settings for your project. Choose toolchain versions, nano versus standard C library, and build outputs like elf, binary, or hex.
Explore the build process from preprocessing to linking, generating .i, .s, and .o files, then producing an executable (.elf) with optional post-processing to .bin or .hex.
Explore the anatomy of a microcontroller, including CPU, program and data memory, and bus interfaces. Examine STM32 and other MCUs' peripherals and memory types, and disassemble .elf with GNU tools.
Learn about code memory in microcontrollers, including ROM types like MPROM, EPROM, EEPROM, and OTP, and contrast flash with FRAM in terms of speed and cost.
Compile a simple program into an elf executable and download it into the STM32 flash; inspect memory with the memory browser to view program in flash and data in SRAM.
Analyze how an ELF file stores code in flash and data in the data section, and how startup code copies data from flash to SRAM during reset via Reset_Handler.
Explore the disassembly feature of the IDE that uses objdump to translate the .elf file into ARM Thumb-2 instructions, enabling instruction-level debugging and analysis of control flow.
Enable the instruction stepping mode in the IDE to debug at the instruction level, stepping one instruction at a time, then use step into or step over for C debugging.
==> Microcontroller Embedded C Programming: Foundations for Firmware Engineers <==
This should be your very first course to dive into the exciting world of "Embedded Systems
This is our new course mainly targeted for absolute beginners to learn microcontroller programming using the 'C ' programming language.
Please note that "Embedded C" is NOT a separate programming language. 'Embedded C' is rather embedded target aware programming using traditional 'C' programming language. In this course you work closely with hardware such as registers, peripherals, interrupts, and real time constraints.
Some of the critical microcontroller-related 'C' concepts such as
Importance of bitwise operators
Usage of bit manipulation techniques to program MCU peripheral registers
accessing memory-mapped registers using pointers
pointers and casting
structures, bitfields, unions, and bit extraction techniques
representing hardware registers details and configuring them using 'C' structure definitions
Usage of const and volatile type qualifiers
Interpret complex variable definitions involving the combination of const and volatile
The precise usage of const pointers, const data, volatile const, with pointer and non-pointer variables
The behavior of the code during compiler optimization and solution using volatile
Functions and friends
Data types, variables definitions, storage class specifiers and much more
Loops: while, for, do. while
MCU internal architecture and programming peripherals
Interfacing projects
All these concepts are discussed with clear examples and writing code for the target embedded board.
According to 2017 embedded dot com survey still 'C' is one of the most widely used programming languages for embedded code development
This course gives particular emphasis to learn 'C' programming concepts practically for microcontroller use cases.
Hardware:
1. You need ARM Cortex M4 based STM32F407 DISCOVERY board from ST if you want to try out code on the target.
2. Additional interfacing components may be required for interfacing projects
3. You can also be able to follow this course if you have any other boards from ST such as Nucleo or evaluation.
Software:
1. In this course, Eclipse-based STM32CubeIDE is used as the IDE ( works on Windows/Linux/Mac) (FREE)
Learning order of FastBit Embedded Brain Academy Courses,
If you are a beginner in the field of embedded systems, then you can take our courses in the below-mentioned order.
This is just a recommendation from the instructor for beginners.
1) Microcontroller Embedded C Programming: absolute beginners(Embedded C)
2) Embedded Systems Programming on ARM Cortex-M3/M4 Processor(ARM Cortex M4 Processor specific)
3) Mastering Microcontroller with Embedded Driver Development(MCU1)
4) Mastering Microcontroller: TIMERS, PWM, CAN, RTC,LOW POWER(MCU2)
5) Mastering Microcontroller: STM32-LTDC, LCD-TFT, LVGL(MCU3)
6) Embedded System Design using UML State Machines(State machine)
7) Mastering RTOS: Hands-on FreeRTOS and STM32Fx with Debugging(RTOS)
8) ARM Cortex M Microcontroller DMA Programming Demystified(DMA)
9) STM32Fx Microcontroller Custom Bootloader Development(Bootloader)
10) Embedded Linux Step by Step using Beaglebone Black(Linux)
11) Linux device driver programming using Beaglebone Black(LDD1)
Other programming courses
1) Mastering Embedded Rust: Bare Metal, FFI, Crates, Projects (STM32+Rust)
2) Master The Rust Programming Language : Beginner To Advanced