Embedded Systems Programming on ARM Cortex-M3/M4 Processor

With hands on Coding using C Programming and assembly on ARM Cortex M Processor based Microcontroller
4.5 (227 ratings)
Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
2,441 students enrolled Bestselling in Embedded Systems
Instructed by Kiran Nayak IT & Software / Hardware
Take This Course
  • Lectures 53
  • Length 4 hours
  • Skill Level All Levels
  • Languages English, captions
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works


Find online courses made by experts from around the world.


Take your courses with you and learn anywhere, anytime.


Learn and practice real-world skills and achieve your goals.

About This Course

Published 1/2016 English Closed captions available

Course Description

Course UP TO DATE as of  October 2016! 

Latest Change  : English subtitles are added for all the videos . 

More than 1900+ students have already taken this course with  More than 150+ happy reviews .

Have you ever tried to learn about ARM Cortex M3/M4 Processor by reading a book or technical manuals and found stuck ? . Have you  ended up seeing bits and pieces all over the map but could not able tie it all together to have a big picture ? 

This course is for Embedded Engineers/Students like you who want to learn and Program ARM Cortex M3/M4  based controllers by digging deep into its internals and programming aspects.

Don't worry if you are new to ARM based controller. In this course, you'll see everything you needed to quickly get started with Programming Cortex M3/M4 based controller. The lab session covers various programming assignments which helps you to remember the concepts better. 

Listen !! Its not Mandatory to have a Hardware !

Many people ask me which hardware to buy, i would like to mention that
if you buy new hardware for every new course then the problem never ends. The biggest objective of this course to understand the core internal details with register level programming and to share generic ideas to handle interrupts and peripherals so that you  can confident enough to handle any development board based on any microcontroller. 

 You will get a full coverage of ARM Cortex M3/M4 processor with full hands on lab sessions. Once you complete the course, I assure you that you will be confident to handle any microcontroller in terms of writing firmware, Memory maps, handling interrupts,Nested Vector interrupt controller(NVIC) , Writing IRQ handlers, handling system exceptions and many more. I even walk you through reference manuals and datasheets to understand things better. 

For the lab STM32F4xx based Discovery board is used. But the Course is designed such a way  that it can be applied to any Microcontroller based on ARM Cortex M3/M4.  So, need not to buy any special hardware for this course. if you already have some other development board i would suggest you keep using that. You can download the source code and play with your own hardware.

Save time and have fun !

Watching lectures, Programming assignments and lots of animations will save hours off your self-study time, and will give you the confidence to look at embedded processors  from a different perspective. So, learn something new this year and boost your momentum at  work .

My promise !
I am confident that this course will save you many, many hours of studying/experimenting/googling  time to learn about this processor. I will personally answer your questions about this material, either privately or in a group discussion.  If you are in any way not satisfied, for any reason, you can get a full refund from Udemy within 30 days. No questions asked. But I am confident you won't need to. I stand behind this course 100% and am committed to helping you . 

ARM Cortex M3, ARM Cortex M4, Embedded Programming, ARM, RTOS,FREERTOS

What are the requirements?

  • Basic knowledge of C and Micro controller could be added advantage but not mandatory

What am I going to get from this course?

  • Programming Micro-controllers using ‘C'
  • Learn about embedded software development and debugging using Keil-MDK-5
  • Learn about debugging using USB logic Aanalysers
  • Learn about Mixed ‘C’ and Assembly Coding
  • Demystifying Memory, Bus interfaces, NVIC, Exception handling with lots of animation
  • Low level register Programming for interrupts, System Exceptions, Setting Priorities,Preemption,etc.
  • Learn writing IRQ handlers , IRQ numbers, NVIC and many more
  • Learn about OS related features like SVC,SysTick,PendSv and many more

Who is the target audience?

  • Professionals interested in exploring Embedded systems
  • Hobbyists and students who want to start their career in Embedded world
  • If you think about 'embedded' then think about taking this course. you will not be disappointed

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.


Section 1: Introduction
Course Overview
Motivation to learn Cortex Family of Processors
Section 2: Inside The Cortex M3/M4 Processor: Architecture Details
  • You will completely understand the different operational modes of the processor
  • Different access levels in which processor operates
  • How to switch between different modes and access levels of the processor
  • These concepts are very essential and if understood properly you can build any type of applications which are easy to more advanced

In this lecture you will understand how to switch between different access level by using the Processor CONTROL register


In this lecture you will understand 

  • Register model of the processor 
  • 2 different stack pointers of ARM cortex processors
  • Behavior of Program Counter, SP, and Link register

In this lecture you will understand 

  1. Special purpose registers like xPSR.
  2. Global interrupt handling registers like PRIMASK,BASEPRI,FAULTMASK
  1. In this lecture you will understand importance of CMSIS Core APIs
  2. Advantage of using CMSIS core APIs in your software development 

In this lecture i will walk you through steps, which happens once you reset the processor. 

Understanding processor reset sequence is very important to handle Embedded processors more efficiently if you are involved in a project like developing boot loaders or RTOS

1 question

So, you know that Processor registers and Special Purpose registers are not memory mapped. How do you access these registers in a C program when they are not memory mapped ??

Quiz-1 Answer
Section 3: Talk is Cheap, Show me the Code: LAB SESSION-I

In this lecture i will  you will learn how to install newer KEIL-MDK-5 software for your embedded software development 


After downloading the KEIL-MDK-5 software , its very important to install the software pack corresponding to your board. In this lecture you will learn how to locate your board through pack installer and install the software pack related to your board !


In this lecture I will walk you through step by step procedure to 

  1. Create a new micro vision project for your board
  2. Selecting and configuring the target 
  3. Configuring board options like xtal, debugger, download options
  4. Rebuilding, flashing the code and more

In this lecture I will introduce various debugging features available in the KEIL Micro Vision software

  1. Inserting/Removing breakpoints
  2. Single Stepping 
  3. Watch window/ Memory Window exploration 
  4. Exploring Disassembly window , etc 


In this lecture lets explore the different components of the STM32F4 discovery board which we will be using in our lab sessions 


In this lecture I will take you through the Reference manual of the MCU to understand 

1) HSE(High Speed External Clock)

2) HSI ( High Speed Internal Clock)

3) PLL (Phase Locked Loop) ( used to boost the clock in the MCU )


So, you got the new board ?

I will show you , how to quicky test your board with out coding anything 


In this Lab session We will code to understand 

  1. How to use the CMSIS core APIs
  2. Explore CMSIS headerfile 
  3. Change the contents of some of the Processor specific registers using CMSIS APIs 
  4. Analyze the System registers in debugging mode 

In this Lab session video , lets explore 

  1. How to change the access level of the processor to un-privileged level by configuring the CONTROL           register
  2. Procedure to moving back to privileged access level from Un-Privileged level via the exception handler 
Section 4: Memory System Architecture

In this lecture , I will explain 

  • Memory map of the processor 
  • Different memory regions like CODE,SRAM,Perpheral , its attributes and its memory ranges 

In this lecture lets dive in to MCU data sheet to explore 

  1. Different Bus interfaces on the MCU like AHB lite, APB,I-Code, D-Code
  2. Relation between APB and AHB
  3. Big picture of MCU peripherals connecting to different bus peripherals 

In this lecture I will explain 

  1. What is aligned storage of data and un-aligned storage of data in the memory 
  2. How does it affect the performance of the processor 
  3. How un-aligned data storage occurs and more 
Quiz-2 Answer
Section 5: Talk is Cheap, Show Me the Code : LAB SESSION-II

In this lab session video , we will code and understand how to access the individual bits of the memory address using bit addressable capability of the processor 

Section 6: Stacks

In this Lecture I will Discuss about the STACK and why it is used 


In this lecture I will discuss about the 

1) Stack model of the processor (Full Descending )

2) How to initialize the MSP to valid stack base address  via vector table 

3) Initial stack init 


In this lecture I will talk about the rules of the ARM-THUMB Procedure call standard 


In this lecture, you will learn 

1) Stacking and Un-stacking sequences in the processor when the exception occurs 

2) Stack frame and many more

3) Interactive animation 

Section 7: Talk is Cheap, Show Me the Code : LAB SESSION-III

In this lab session video, we will learn how to use MSP and PSP for stacking and unstacking operation 

  1. How to switch between different stack pointers using CONTROL register 
  2. also we will write a pure assembly code do stack operations and call that function from a C code 
  3. Helps you to understand mixed C and Assembly coding 

Section 8: System Exceptions and Interrupts-I

In this lecture you will learn, 

1) What are exceptions, different types of system exception and interrupts 

2) Intro to priority and many more 


In this lecture you will learn about 

1) Nested Vector Interrupt controller and its uses

2) How system exceptions and interrupts are connected to processor via NVIC

3) What is the meaning of IRQ number and how it is related to interrupts

4) Various key points related to NVIC, interrupts and IRQs


I will demystify the interrupt priority in this lecture  by taking you through couple of case studies 

1) With various interactive animations and pictures it will be clearer and easier to understand how interrupt works with the priority 

2) You will also learn interrupt grouping, pre-empt priority and sub priority with case studies 


In this lecture you will learn about 

1) How to activate and de-active interrupts and system exceptions globally in the processor 

2) you will come to know how to handle registers like PRIMASK,FAULTMASK,BASEPRI to mange the interrupts and system exceptions globally 

3) Respective CMSIS related APIs and many more


There are lots of registers NVIC provides to manage and handle the interrupts and system exceptions 

Those registers are discussed one by one in this lecture. 

Quiz-3 Answer
Quiz-4 Answer
Section 9: Talk is Cheap, Show Me the Code : LAB SESSION-IV

By doing this lab experiment you will understand 

1) How to Enable/Disable the global interrupts using global interrupt management registers 

2) plying with BASEPRI,PRIMASK registers to enable/disable as per the priority level of the interrupt 

3) You will also come to know , how to setup the priority level for an interrupt 


Do you know that to debug embedded firmware, signals, protocols you dont need a bulky and expensive CROs or logic analyzer machines

What you just need is a USB logic analyzer which i explained in this lecture. 

By using this hardware, you can quickly able to debug most of the problems which occur in the embedded firmware development 

So, lets debug the code in smart way, instead of just staring at the code 

I will show you how to use USB logic analyzer tool by using dedicated software 


This is a interesting experiment where we will test the interrupt nesting and pre-emption 

We will configure 2 different exceptions 1) systick timer exception and 2) button interrupt 

Configuring different priorities to different exceptions and observe the effect of them in LOGIC analyzer software while they occur

Inverting the priorities and observing the effect 

Practically testing the pre-emption between exceptions on the LOGIC analyzer software

and believe me you will learn lots of other key points . 

Section 10: System Exceptions and Interrupts-II

In this lecture you will learn about various activities which take place once the peripheral issues the interrupt 

I will also discuss various registers which are going to get affected once there is an interrupt assertion 

Also we will discuss the case of single pended and double pended interrupt  


In this lecture I will walk you through exception vector table and its importance during interrupt 

you will also come to how to relocate the vector table using VTOR register of the NVIC 

We will also discuss the case study fro relocating the vector table 

Exception Entry and Exit Sequence
Section 11: Talk is Cheap, Show Me the Code : LAB SESSION-V

In this lab session,

1) will discuss generic steps to configure gpio for LED functionality. That is configuring its mode, speed, output type, enabling port clock etc 

2) You will come to how you can calculate memory address of any peripheral register and configure the peripheral by directly accessing its memory address 

3) You will learn to  code by scratch by using register level programming to Turn ON, Turn Off and Toggle the LEDs

4) We will dive into memory map of the MCU to calculate the addresses of different peripheral register


In this lab session

1) We will discuss generic steps required to configure GPIO for interrupt functionality. These steps discussed you can apply to any MCU you have at your hand 

2) You will come to know, how in general the external interrupts are delivered to the processor via NVIC 

3) You will come to know, how vendor can do variation while delivering interrupts to the NVIC of the Processor 

4) We will discuss the case study of button interrupt the processor and how it is delivered to the NVIC by hte STM Vendor 

5) you will come to know, how to find out the IRQ number of any interrupt by looking into the reference manual of the MCU 

6) Your will come to know, External Interrupt Controller block of the STM32F4 MCU and how it delivers interrupt to the NVIC 


This the continued part of the Lecture 44, 

After gathering sufficient knowledge about the interrupts , IRQs, and EXTI

1)  you will learn how to configure GPIO for interrupt capability 

2) you will learn how to configure the interrupts using exti registers 

3) Enable IRQs in NVIC and many more  

4) Build the code and test it on the hardware and much more

Section 12: Cortex M3/M4 OS Features

In this Lecture you will come to know How shadowed stack pointer of the Cortex Processor helps OS design


This lecture explains with animation 

1) SVC system exception 

2) How to trigger the SVC exception 

3) Advantages and use cases of SVC

4) How to extract the SVC service number in the SVC exception handler  and more 


This lecture explains , 

1) PendSV exception and its advantages in Efficient OS design 

2) PendSV in OS Context switching Scenario 

3) What is context switching and how OS carries out Context switching in Pendsv handler 


In this lecture I will walk you through animation how PendSV can be used in OS context switching Scenario 

Also through animation I will explain how Interrupt bottom half processing can be done using PendSV exception handler 

Section 13: Talk is Cheap, Show Me the Code : LAB SESSION-VI
Lab assignment 10 :SVC Exception and Handler implementation

In this lab session, I will code and demonstrate ,  how Interrupt bottom half processing can be done using PendSV exception handler 

Pending the pendSV handler using NVIC register to trigger the PendSV exception 

Section 14: Thank you
Last few words and References
Bonus Lecture

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Kiran Nayak, Firmware Engineer, FastBit Embedded Brain Academy

Kiran Nayak holds the Designation of Embedded Software Developer and has over 7 years of experience in domain Embedded Software Development, Firmware Engineering, Real time systems, etc. He worked with some of the leading chip manufacturing companies in the domain of firmware engineering, BLE SDK development, Low power wireless protocol stack development, etc. 

He is a frequent presenter in Conferences and seminars. He obtained his bachelor’s Degree in Electronics and Communication engineering and Co-authored and presented Many IEEE papers in different International conferences. 

Ready to start learning?
Take This Course