Lesson finished
Lesson finished
Lesson finished
Lesson finished
Up next: Sensors, Actuators and Signal Conditioning in Automotive Embedded Systems
Unlock all 12 lessons of Fundamentals of Embedded SystemsFull course ₹40,000 · paid
ARM Cortex Families, Cortex-M4 Components and the CMSIS Software Package
A free lesson from Skill-Lync's Fundamentals of Embedded Systems course, on Grow by Skill-Lync · Last updated 16 Nov 2026 · Session: “2.0 ARM (MCU) Architecture”
What will you learn in this free Fundamentals of Embedded Systems lesson?
The instructor explains that ARM is a processor architecture rather than a chip, then compares the Cortex-A, Cortex-R and Cortex-M series. The lesson walks through Cortex-M4 blocks including the interrupt controller, memory protection unit, floating point unit and CoreSight debug, and describes CMSIS core, driver and RTOS layers.
- Differences between Cortex-A, Cortex-R and Cortex-M series
- Main blocks of a Cortex-M4 microcontroller
- What the memory protection unit and CoreSight debug do
- How the CMSIS core, driver and RTOS layers keep code portable
What comes after lesson 2?
The next free lesson is lesson 3, “Sensors, Actuators and Signal Conditioning in Automotive Embedded Systems” (68 min). Later in Skill-Lync's Fundamentals of Embedded Systems course (paid): lesson 4, 0 Embedded Systems Development (Bare-Metal/RTOS/Linux); lesson 5, 0 Software Development Life Cycle; lesson 6, 0 Introduction to Safety Standards. The full course has 12 lessons (13 h 7 min of video); see the course overview or its price and syllabus.
Lesson transcript
Machine transcript of the lesson audio (lightly cleaned). Technical terms may contain errors; the video is the reference.
Part 1
Welcome to the new session of Fundamentals of Embedded System course. In this session, we are discussing about ARM architecture. Let's see the table of contents. ARM processor basic features. And in this, we are basically discussing about the product details and the product roadmap of ARM microcontroller architecture based microcontrollers and ARM Cortex processor internets. Then we will be discussing about Cortex microcontroller software interface standard, CMSIS. And then ARM Cortex M4 programming model. So basically, this session, we are divided into three category. In the first part, we will be discussing about the ARM microcontroller architecture and different categories and different architecture and models.
And the second part is CMSIS. Basically, that is a package or a software package that will help software programmers to write the software in ARM microcontrollers. And specifically, we are discussing about ARM Cortex M4 microcontroller and its programming model in the third part. So these are the table of contents in this session. We will be discussing these points in the further slides. And let's see the learning objective of this course. After learning this course, the participants would be able to understand ARM ARM processor design background and internal architecture of ARM Cortex microcontrollers and theoretical background of the MCCC software package provided by the ARM organization.
And the understanding of the understanding of the understanding of the understanding of a major concept before starting programming of Cortex family microcontroller, especially Cortex M4 family microcontroller. So these are the learning objectives we are expecting from the participants after completing this course. Let's start with the first part ARM processor basic features. What are the basic features of ARM microcontroller architecture? So ARM microcontroller is a microcontroller architecture. It is developed by ARM organization and it is a microcontroller architecture. It is not a microcontroller chip. So here we are basically discussing about the ARM microcontroller architecture.
Not a specific chip or not a specific microcontroller chip provided from a silicon vendor. We are only discussing about the architecture of a processor or basically the ARM Cortex architecture. So behind this ARM microcontroller architecture, we can discuss in two different aspects. One is design philosophy and the main features of ARM microcontroller. So when we are discussing about ARM features before ARM comes into the market, there are a lot of other microcontroller architectures also available like 8051 power PC architecture and so many architectures are available.
But once the ARM comes into the ARM microcontroller architecture comes into the place, all the disadvantages and demerits of all other microcontroller architecture is covered with or it is solved with this ARM microcontroller architecture. And they are providing a vast variety of microcontroller and they are providing a vast variety of microcontroller series where you can select your microcontroller as per your requirement and as per your design requirements. So this is one of the main features of ARM microcontroller architecture. So behind this ARM design philosophy, so many factors are basically they have considered for the design of ARM architecture.
Basically, basically the low power and the high core density and reduced die area, adoption of standard bus architecture and hardware debug technology. So these methods or these philosophy points comes in the design of ARM architecture that will help to come up with so many varieties of ARM architecture and that will be fulfilling all the embedded architecture or embedded system designs requirements. And based on this design philosophy, they have come up with so many microcontroller architecture and main features of this architectures are multiprocessing system and memory management, technology, one cycle execution time, more pipeline and a large number of registers.
So these are the main features of the ARM architecture. And when you come to the microcontroller part, you can classify the microcontroller based on many features. In the case of microcontroller, you can classify the microcontroller based on their data size like 8-bit, 16-bit or 32-bit microcontroller or their bus architecture like 1U1 or Havard architecture or their memory size. And so those so many parameters we can take into consideration for classifying the microcontroller. So based on the classification, you will come up with so many varieties of microcontroller design.
So this ARM microcontroller architecture, it will be consolidating all these aspects and all this design philosophy and all categories under one umbrella. So the designers and developers of embedded systems, they got a better opportunity and they got a better variety of classification of microcontroller architecture for their design. So they can select a particular microcontroller architecture for a particular usage that will help to reduce the usage of other hardware and extra hardware and peripherals and other extra memory. So under this ARM microcontroller architecture, we have got a lot many varieties of microcontroller chips.
So when you come to the ARM processor family, basically the ARM processor family, we are divided or we are classified into three categories of Cortex A series and R series and M series. So A, these are the three categories of ARM processors. So what are the basis or what is the speciality of each series that we can see in the below picture. So in the right side picture, we have divided the categories or classification of ARM into two parts. One is classic ARM processors. One is classic ARM processors.
The classic ARM processors are not part of Cortex series that will be having the classic ARM architecture. But we are here discussing more about the Cortex series. So in the Cortex series, we have three series A and R and M series. So what are the features or what are the specialities of each series? So basically A series is meant for application processor. So that is with the memory management unit and the supporting Linux and other OISs. So in embedded system, if you see, nowadays the embedded system applications are varying from a small thermometer to a highly complex mobile devices or a tablet or computer system.
So the embedded device classification is embedded device. The band is expanded in such a way that from a small microcontroller, 8 bit microcontroller to a highly complex microprocessor, which is based on OISs and other normal general purpose computer systems. So this band is huge. So to design and develop an embedded system, the developers and designers will have vast varieties of microcontrollers. microcontrollers series available in the ARM controller. So this A series are basically meant for the application based processes. And that will be used for basically highly complex and highly sophisticated design and development.
And when it comes to the real time processor or we call it as R series, it is meant for the embedded system, which is needed real time operating or real time applications. And the M series are nothing but more or less it is meant for the microcontroller based applications. The left side table, we have the comparison table between A series and R series and M series. So we have taken three aspects for the comparison design and the system features and the targeted market. So in the case of our design, normally A series will have a high frequency block frequency and pipeline is longer, performance is higher and there is a multimedia support in the A series.
And the R series will be frequencies high and pipeline is also medium compared to the A series and interrupt latency is very low. So that will help to accomplish the real time application. And when it comes to the M series, a short pipeline and ultra low power operation and interrupt latency is low. It is meant for the microcontroller based application. So when it comes to the system features, we have different features in the A series, R series and M series. So memory management unit, cache memory, arm, trust zone, security extension, all these are.
It basically comes under A series and that will not be available in the R series and also in the R series they will have memory protection unit and a cache memory, tightly coupled memory. These features are available. That will help to accomplish the real-time operation. And in the M series, basically in the system features is basically nested vector interrupt controller and wake-up timer and memory protection unit. All these helpful to develop the microcontroller-based applications. Targeted market A series is for smartphone, energy-efficient servers and high-end MCUs. So A series basically meant for the application-based system, mobile unit, BDO and tablet and other small-scale laptop.
All this comes under this Cortex-A series controller. And when it comes to the R series, we used to use industrial automotive, hard disk controller, baseband modem, all this time-critical applications we use the Cortex-R series. And Cortex-M series will be using for normal embedded devices like IoT-related and other industrial controller. All those comes into Cortex-M series. Here at the conclusion of this slide basically, we have three series of processor architecture. Cortex-A, Cortex-R and Cortex-M. And A is for application processor and R is for real-time operation. And M series is for microcontroller architecture.
So in each series, they will have a number of sub-series or sub-categories of microcontrollers are available. That will help you to select a particular microcontroller for your exact design and development. So in M series itself, it is starting from M0 and it went up to Cortex-M7. So there are so many varieties of M0 and up to M7 in between. So many varieties of features available in each number of microcontroller series. So we will come to Cortex-M series processor. So we are interested here only Cortex-M series processor. And we are not discussing more about Cortex-A and Cortex-R series.
Basically, Cortex-M series is for microcontroller based product. So there are so many families of Cortex-M series are available. M0, M0, M0+, M1, M3, M4, M7. These are the major microcontroller families comes under M series. So each family has its own speciality and its own feature. Based on that, it is classified into this. For example, M0 small processor for low cost and ultra low power microcontroller and core embedded application it is using. And in the case of M0+, the most energy efficient processor for a small embedded system and the programmers models and the size of the M0+, is similar to the M0 processor, but the single cycle IO interface and vector table relocation are added features.
So it depends on the features added in the different M series. There are so many families are already there in the Cortex-M processor family. So it is starting from M0+, ending up to here Cortex-M7. So as per the table, you can see different features and added features from M0 to M7 that will be helping to select the proper architecture for your application. This is a table of comparison of M series processor. There are different features we are comparing. So we are not going to describe each and every features of M processor. It is only one or two we will be seeing.
So in the case of hardware divide or we can see it is available only in Cortex-M23 and it is not available in the below series. And in the case of Bugs protocol, HB light is used in M4 and HB used in the M33 and M35 all the series. So the floating point is available only from the M4 unit. So based on the comparison table, different features are available. You can compare the availability of features in each family or each M0 series. So this is a comparison for understanding. We will get a vast variety of Cortex-Family architecture in the ARM microcontroller architecture.
Part 2
Cortex-M processor product development. So as we discussed earlier slides, we had seen so many varieties of microcontroller and its families and the series under that family. So in Cortex-M family, there are a number of series are available and the features from M0 to M7, you will get a vast variety of different type of microcontrollers and that will help you to get a better and optimized design for your microcontroller application. So what makes this Cortex-M processor is very easy for product development and what are the features or what are the factors it is affecting the product development of microcontroller based system.
So first one is easy to use. So when you are developing a microcontroller system to make a software development easier to enable better software reusability and portability, the ARM developed CM-Sys core or CM-Sys microcontroller architecture based software interface standard that will help the system developers or software developers to build the software in very easy manner. So that is one of the factors which will help Cortex-M series to develop the Cortex-based applications in very easy manner. And in the Cortex-CM-Sys core provide a standardized hardware abstraction layer for various features in the processes such as interrupt management control using a set of APIs.
The CM-Sys core is integrated into the device driver libraries from the various microcontroller vendors and is supported by various compilation suite. So CM-Sys is one of the major role in the software development of Cortex-M series. So CM-Sys package will help the software developers to develop the higher software layers in a very easy manner. So easy to use one of the major factor in the Cortex-Series processor product development. And the processor selection in the product development. So normally the criteria for selecting a microcontroller device are heavily depends on the cost and peripheral availables in the microcontroller chip.
So as you know the M0 and to the M7 you will have many number of microcontrollers that will have different configurations and different features. That will give you a very cheap solution to the most highly featured solution depends on your application. So the selection is one of the major criteria in the product development. And the performance, silicon size, power, cost, all these factors are also comes into picture when you are developing a microcontroller based system. So all these factors are available or all these factors based on these factors, the microcontrollers families or the series of microcontrollers are available in the Cortex-M series.
So if you are looking for a small silicon size or higher power or lower cost or higher cost, all the varieties of controllers are available in this architecture series. So that is the main importance of processor selection in the product development and this will reduce the cost of the development. There is always a trade-off between performance and the features versus silicon size and power. So this will indicate that the selection of microcontrollers is very easy in the TEC-M series. So because you will have N number of series and N number of families that will be addressing all these factors.
As a result, ARM developed various Cortex-M processors for different level of instruction set features and performance and system debug features. All this help you to select a processor for your design and ecosystem for your product development. The advantages of using Cortex-M series are the wide support of devices and tools and their middleware softwares like CMC and all. So these are the major advantage and currently there are more than 15 microcontroller vendors shipping the microcontroller product based on ARM Cortex-M series. So many varieties and many microcontroller chip developers or vendors, they are producing the microcontroller chip based on Cortex-M processors.
And more than 10 development suits supporting Cortex-M processors. More than 40 OS vendors support OS for Cortex-M series. This gives one plenty of choice and allows them to get the best combination of devices, tools and middleware for your targeted application. So these are the main three points in the product development of Cortex-M 0 or Cortex-M series. Basically, the easy to use and the processor selection of Cortex-M series is very easy. You will get a lot of selection and a lot of varieties and the ecosystem. The ecosystem of Cortex-M series are very strong and it will help the developers and designers to decide a proper product and proper design for your expected requirement.
Part 3
So we are going to discuss about Cortex-M4 core peripherals. So till now we had seen what are the different families and the different series of Cortex-M microcontroller and for learning purpose we are taking Cortex-M4 specific microcontroller architecture and we are explaining basic peripherals and what are the components in the microcontroller architecture of Cortex-M4. So it's a basic 32-bit ARM Cortex-M4 processor and this first core of Cortex-M line up to features dedicated to digital signal processing blocks. So basically it has a digital signal processing blocks apart from the microcontroller features and including an optional floating point units also FPU also available in this Cortex-M4 peripheral.
So we are mainly we will be discussing the core features of core peripherals in the microcontroller. So let's see what are the components in M4 series. First will be the definitely the ARM core and then nested vector interrupt controller and system block then system timers and the optimal optional memory protection unit, floating point, floating point unit and the core side debug and trace unit. So these are the basic peripherals in the Cortex-M4 series microcontrollers. Let's see one by one peripherals. So nested vector interrupt controller you know that what is an interrupt and how does the interrupt work. So when the controller is processing the instructions it is keep on fetching the instructions and executing the instructions.
And during this instruction execution time is there any interrupt trigger from the hardware or software point then it will stop the execution and it will save all the data and all the status of current execution to the stack and it will go for interrupt service execution. And it will serve the execution and it will come back then it will take the earlier status of execution then continue the actual flow of execution. So this is a normal interrupt execution in the microcontroller in the normal flow will be interrupted by interrupt service and the interrupt service will execute fully then come back to the normal flow execution.
But in the case of nested vector control what is a speciality let's say about different priority level of interrupt let's say one low priority interrupt is triggered and low priority interrupt signal routine ISR is executing during this time if any higher priority interrupt is triggering then normally the microcontroller they will be executing executing the lower priority ISR completely then it will serve the higher priority ISR but in the case of nested vector interrupt it will make sure that it will stop the lower priority interrupt service routine and it will switch to higher priority ISR and it will finish the higher priority ISR then will come back to lower priority ISR and finish it all the ISR.
So this will make sure that after interrupt processing is complete the CPU restore its previous state and resume where it is stopped. So this is a normal flow of nested vector interrupt controller. So you can see there are so many features available in the NVIC that is you can prioritize the interrupts and it is support up to 240 interrupts each with up to 256 level of priority. And improve the MCUs performance and improve the MCUs performance and reduce the interrupt latency. So the nested vector interrupt controller will be managing the interrupt sources in a proper way and it is reduce the interrupt latency and dynamic interrupt priority.
So during the program running we can change the priority of the interrupt that is dynamic interrupt priority. And next is it will keep track of stacked or nested interrupt to enable a tail chailing of interrupt. So as I explained earlier this will make sure that the higher priority interrupt will be executed in the first step. So if any lower priority ISR is running then it will switch to higher priority ISR if it is triggered. Then it will keep on stacked and nested the interrupt which is triggering and it will serve according to the priority.
Then this NYIC block will ensure that the higher priority interrupts are served before the lower priority interrupts even if the lower priority interrupt is triggered first. So this is what the nested vector interrupt controller and next unit is SysTick block. SysTick is nothing but a system timer. In the processor there is a 24 bit system tick timer that will come down from the reload value to zero. So then reload that is wrapped to the value in the SysTick register on the next clock edge then counts down on the upcoming clock.
So the SysTick is just a 24 bit timer and it will be always reloaded by a reload value and it will count down from that reload value to zero based on the clock edge. And the SysTick time will generate an interrupt request regularly. So this allow the OS to carry out a contact switching to support multiple tasks. So the use of this SysTick timer is nothing but this will always trigger the interrupt once it reaches to zero and this will keep the track of system time.
And this SysTick will be helpful to enable the OS functionality. For application that runs without an OS the SysTick time can be used for the time measurement or the interrupt source for task. So these are the major advantages of SysTick timer. So this is a dedicated hardware timer that will be helpful to get a system time or a tick interrupt which will be useful for the OS implementation as well. So normally the operation of SysTick timer is something like this in the below step it is mentioned.
First we are setting the reload value and we are enabling the enabled bit. Then we will be selecting the CPU clock source where it is getting the source command clock for the countdown and the interrupt enable. Once it is enabled it will give an interrupt so that will help to measure the timer in the timer value from the SysTick timer. Next is system control block. The system control block is a control software. It is a control software reset power management and the fault status information in the system basically.
So system management basically the exception handling, fault handling and the coprocessor access management and custom instruction features. All this power control of the microcontroller. These things will be handled by the system control block. So system control block will have a number of registers and based on configuring these registers we will be able to achieve all these functionalities like fault handling and you can configure the exception handling with that configuring the particular registers. And the power control is basically it is controlled by the system control block.
Normally in arm controller there are four power modes. Basically the sleep mode, deep sleep mode and power down, deep power down mode. These are the four major sleep modes available in the microcontroller arm cortex M series microcontroller. So here it depends on different power modes. The usage of cortex peripherals are different and the usage of power is different. So these power modes also can be configured with the system control block. So basically these are the different registers available with the system control block. In this system control block as per the register configuration you can configure and you can control all the features related to the system control block.
Like power management and other fault handling exception handling all those features. Next is memory protection unit. Memory protection unit basically which will be managing the memory and their memory region of a cortex M series. Normally it will restrict the user application from corrupting the data used by the critical task. And define the SRAM memory region as a non executable to avoid code injection attacks. Then 0 to 15 regions are there in the memory area. We have a 0 to 4 gigabytes of memory region. And in this region we are dividing all the regions into 0 to 15 regions.
And there is a difference here. Vault region which is with the number minus 1 and other 0 to 15 memory regions are there. So each region has its own priority and its own characteristics. So basically these regions will help the program and code part and the data part of your software that will be protecting from the other attacks and unintended fighting and reading of data. So the memory protection unit will be handling all the memory related handling in the ARM Cortex M4 series. The MPU makes an embedded system more robust and more secure because the regions can be nested and overlapped.
The 15th region has the highest priority and the 0th region has the lowest priority. The priorities are fixed. So these kind of features will give you the flexibility on the security of the code and the data structure in the software. So MPU split the memory map into region. Each region has one memory type and memory attribute and the memory type and attribute decide the behavior and access to the region. These will help you to get a better memory management from the software side. So this will be basically completely controlled by the memory protection unit.
Then CoreSight debug unit. This CoreSight debug unit is especially for debugging purpose of the microcontroller. So during the development stage, we can debug the execution of a microcontroller program. So normally in debugging stages, you can stop the execution up to a break point and you can fetch the data of registers and memory areas in the microcontroller to the target PC. So normally in computer-based or target PC-based debugging, we have a PC. Inside the PC, you will have a debugger software. That debugger software will be communicating to a debugger unit based on a microcontroller system.
And that debugger unit will be communicating to the target microcontroller via SWD or JTAG protocol. So this SWD and JTAG protocol will be connected to the CoreSight debug unit inside the target microcontroller. So in the target microcontroller, all the processor core has CoreSight debug unit that will help to stop the execution and put the break points and fetch all the datas from the processor. And that will transfer to the microcontroller and that will pass the data to the software running in the PC. So this is the functionality of a CoreSight debugger.
So debug functionality will provide the processor halt and single step execution, processor core register access and vector cache, unlimited software break point and full-time memory access. So these functionalities will be provided by the CoreSight debugger unit and the Cortex-MS implemented a framework named CoreSight architecture that will be helpful to develop a debugger unit. So this CoreSight, it is basically divided into two parts. One is debug access part and next is embedded trace microcell. So debug access part is used for debugging initial silicon validation and the system bring up known as the DAP and the ARM able to trace microcell will be allows for traceability and used to stream out data and instruction access while system is running.
So these are the major two parts of CoreSight debugging unit. And it's also again divided into these many factors like provide a standardized interface for debuggers and many standard debugger interfaces are available now. And connecting using 5-pin JTAG or 2-pin serial wire debugger SWD, you can easily connect the debugger port to the target microcontroller. And it will support multi-core debugging, let's say if you have a multi-core or many cores processing units in your microcontroller, it will help to debug all the cores in simultaneous way. And the debug unit can be integrated on a evaluation board.
So the debug unit basically will help to take the data out from the target microcontroller. Next part of this session is discussing about Cortex Microcontroller Software Interface Standard or CMC's. So this is basically Cortex Microcontroller Software Interface Software Package which is given from organization. So what is the basic of Cortex CMC's? So Cortex Microcontroller Software Interface Standard or CMC's, it's a software package that offers a simple configuration interface between the microcontroller core and the peripheral units. CMC's has an independent updatable modular structure and device specific modules are also there.
So for every ARM Cortex Microcontroller family, a collection of CMC's modules is created and the device modules are created, the device family pack. So in short, we can say CMC's is a software package that will be act as a middleware layer of software which is used for the development of microcontroller, Cortex Microcontroller firmware. So this will provide APIs to the hardware abstraction layer of Cortex M-Series and also that will be providing all the APIs to the other peripherals of microcontrollers, other part of the microcontroller peripherals.
CMC's provide there is an OS interface that is a real-time operating system and it's a middleware component for the OS interface. CMC's and CMC's comes with a delivery mechanism for device, boards and software that enables the combination of software components from multiple vendors. So normally CMC's base package is developed and designed by the ARM company and a particular device specific addition and modification for the each driver packages will be added by the chip vendors. So the silicon vendors will also contributing to the CMC's package. So ARM and silicon vendors will collaboratively developing this CMC's package and they will be releasing the CMC's package for the each and every microcontroller units.
So this will help to develop and designing the software for the upper layer and application layer of microcontroller software. So basically what are the components in the CMC's? So by understanding this part you will get a clear idea of what is a CMC's package. So normally the left side of the picture you can see is a normal embedded system architecture software architecture. It's a hardware will be there microcontroller layer and above the hardware there is a board support package with the HL hardware abstraction layer software.
That will be basically interfacing the hardware units of microcontroller and the upper layer. And the next to come with the OS layer that OS layer will use the HL interface to interact with the hard interact with the microcontroller. And the OS also will provide APIs to the application layer. It should be using the OS application, OS APIs for the development. So also file system GUI and the task management that will also comes with the upper layer software. So these are the basic layers in the embedded system software.
So when you compare this exact replica of left side picture with the CMC's you can see in the mu C layer or microcontroller layer there is an arm microcontroller or arm cortex processor. And other peripherals like communication peripherals and debugging and other memory protection unit. All the peripherals will come in the hardware layer. And in the HL layer there is a layer which comes with the CMC's core and CMC's driver and CMC's DSP and peripheral HL, CMC's neural network, CMC's DAP, CMC's zone. All these units will come in the HL layer.
So this CMC's units will be providing the hardware abstraction layer for the microcontroller. So these are the basic HL layer of microcontroller software. So in CMC's it is divided into these many blocks like CMC's core, CMC's driver like that. And when you come to the OS layer CMC's RTOS is there that will provide the interfaces to the RTOS and then the application layer. So this is the right side picture shows the exact replica or exact mapping of left side picture. So we have a microcontroller and hardware layer in the lower layer and the middle layer.
You have all the CMC's components that will act as the middle layer of our middleware framework of the microcontroller. Then you will get OS layer and application layer. So these are the components of CMC's software package. So next we will explain each and every components in the CMC's package. CMC's core. CMC's core specification gives a collection of interface functions and macros to access the key Cortexam processor registers. The core specification defines a function to configure the microcontroller oscillators and clock tree in the startup code. So you can see in the right side picture, the CMC's core software package will give you the interfaces or API to the SysTick module and nested vector interrupt module and CPU of Cortex series and other peripherals.
So CMC's core will give you the middleware, firmware to these many blocks. So these on down side you can see what are the files which is related to the CMC's core block. So there are some files like startup.c and startup.h and user.c. All these files are consists of CMC's core code. So in the CMC's package, CMC's core will provide all the APIs and the middleware software for these many hardware blocks. Like a system tick and nested vector controller and other CPU cores. And also it will use a method for the system utilization and the system initialization to be used by each MCU vendor.
So normally there will be a system init part will come in the software initialization of the bootloader part or in the system initialization init part. So these initialization methods also provided by the CMC's core unit. And these are the functions that relate to the CMC's core system and clock configuration, interrupt and exceptions, peripheral access, device header file, trust on setup, floating point, arithmetic unit, memory protection unit, performance monitoring unit, initialize and start the cystic timer. So these are the functionalities you can basically configure and you can access these functionalities through the CMC's core component in the CMC's package.
Part 4
Now we will discuss about CMC's driver package. So in this package most of the software API that provide peripheral driver interfaces for middleware software stack and user applications. So CMC's driver API groups are defined like CAN, Ethernet, I2C, MCI, NAND, Flash, SAI like this. So basically the CMC's driver package will give you the basic HA layer or middle layer APIs or basic software for the drivers of each hardware peripherals in the Cortex microcontroller. So here we are getting a low-level HA layer APIs that will help you to build the upper layer or application layer software.
So the CMC's driver package basically grouped into like a module is for CAN driver, Ethernet packages for Ethernet driver, I2C packages for I2C driver. So like that they have grouped all the hardware peripheral drivers together and they made this CMC's driver package. So when you have a CMC's driver package, you will be having all this driver APIs and driver HL or middle layer software with you. So with this API's you can easily you can develop the device driver level programs and application level programs in a very easy manner.
So that will reduce the time of development. So as per the picture you can see in the right side of the slide, the software packs, software pack is in the device pack. We have USB driver, Ethernet driver and UART, SPI, all the drivers that will be talking to the middleware software and in the left side of that picture, you can see the device or the hardware part of the microcontroller that will be interacting with this driver. So these software packages are very helpful to develop the driver level or application or middle layer level software development.
So each CMC's driver contains these functions. So each CMC's driver packages or CMC's driver module has a common way of programming and a common way of API usage. So you can see a get version, get capabilities and initialize, a signal event, power control, uninitialize and control. So these are the common driver API names used in the driver packages. So you can, it is a standardized way of using the API in the driver package. So get version means getting the version information of the driver interface and get capabilities to obtain the capabilities of the driver interface.
So initialize means called before powering the peripheral using power control. So this is a initialization part of the driver and the signal event is the callback function, which is triggered from ISR and denote hardware events or completion of the data block transfer operation. So power control, control the power profile of the peripheral and must be called after initialization. So these are the common interfaces, common APIs is used for all the driver package. So if you have I2C driver, I2C power control will be there. I2C signal event API will be there.
I2C get version API will be there. I2C get capabilities API will be there. And in the case of a CAN, you have the same API name with the CAN driver. So get version CAN or get capabilities CAN and initialize CAN like this APIs are there. So they have a standardized way of API and that will help you to understand the drivers and that will help you to develop the middleware or application in a very easy manner. So these are the standard APIs are available with each driver.
So all these APIs are available in each driver modules and some of other examples also given here, uninitialization. So this function or this API will complementary function to initialize. Once you initialize the function or once you initialize the driver, after utilization of the driver, you can uninitialize. And that will close the IO pin resources used by the interface. So control function, many drivers provide a control function to configure communication parameters or execute miscellaneous control function. So there is a control API that will be used for the configuration of the driver and some control function in the driver.
So this is what all about the CMSIS driver and let's go to the next part. This package is nothing but CMSIS RTOS version 2. So we had our CMSIS RTOS version 1, but it is now old one and we had an updated package available in the organization. So this RTOS specification contains standard APIs for an RTOS. This is an in effect a collection of wrapper function that translate the CMSIS RTOS API 2 to the API of the specific RTOS that you are using. So for example, normally when we are using RTOS in your microcontroller project, you will have a hardware layer and you will have a chair layer and that is hardware abstraction layer.
And then you will have a middleware software and OS software and this OS software, OS packages and OS layers software package will give you interfaces or APIs to access the hardware in the microcontroller hardware layer. So this OS layer is acting as a middle software packages and that will give you so many other functionalities like task scheduling and task management, memory management, all those stuff. So here normal microcontroller RTOS project, you will have, as I said, a lower layer software and OS layer and then application layer.
So application layer will be using this OS APIs. So for creating task, they are using OS APIs and memory management, OS task synchronization, everything they are using or application will be using RTOS API. So the problem here is or the disadvantages here is you have developed one application and that application will be completely using all the APIs in the RTOS. So here one disadvantage we can say, suppose the RTOS are mostly paid resources or paid software and some free RTOS are also available. But if you are changing the RTOS in your project in the later stage, your application also has to be changed because all the APIs are used from the RTOS API.
So suppose you are using an X RTOS and the application will be using all the APIs from the X RTOS and then later stage, if you are changing the RTOS to Y, so Y RTOS will have a different API names. So your application also has to change with the change of RTOS. So there is a dependency between RTOS and the application layer. And so here the advantages of CMC's RTOS is the layer of package that will be having a common API name. And you can build the application based on that API name.
So your application and the middleware software will be using the CMC's RTOS API. And the actual RTOS will be comes under this CMC's RTOS. So your actual RTOS and your actual real-time OS API will not be exposed to your application. That will be exposed to your CMC's layer. So the CMC's layer will use the actual RTOS and CMC's will give you a common API to the application. So here the advantage is always you can develop the application with the CMC's RTOS API. That will not change based on the actual RTOS used in the project.
Because actual RTOS will be again one more layer down in the CMC's RTOS layer. So third-party RTOS will be using CMC's RTOS API and the CMC's RTOS API will be provided and that will be used by the application. So if you change the RTOS later stage, that will not affect the application. Because the CMC's application is always using the CMC's RTOS API. So this is a one advantage I would say in the CMC's RTOS layer. So you can develop applications in a very flexible manner and that will be very portable applications you can develop.
So the same application you can flash in or you can use it in another system which is having the CMC's RTOS. So this is a one of the application or this is one of the advantages. of CMSIS-RTOS. Then comes to CMSIS-DSP. So as we know that Cortex-M4 microcontroller has the DSP core. So the DSP core will be used by the DSP library. So CMSIS include a DSP library that provide most of the commonly used DSP mathematical functions. So that the library is divided into several functions each covering a specific category like math function, fast math function, complex math function, filtering function. All these kind of all the DSP related software libraries will be available with the CMSIS-DSP. So when you have a DSP related application no need to develop all this standard library in your project. The CMSIS-DSP library will be already developed all this basic standard mathematical library. So that library is divided into a number of functions each covering a specific category.
So like as I said motor control function, statistical function, support function, interpolation, bias, classifier function, conterranean function. So many other DSP related functions are there. These are included in the DSP library. So the next CMSIS package or CMSIS software package is CMSIS-SVD and DAP. So CMSIS-DSP specification provide a interface protocol for hardware debugging unit and that sit between the host PC and the debug access port of the microcontroller. So helping software toolchain. So helping software toolchain that support CMSIS-DSP to connect into any hardware debug unit with the CMSIS-DSP support. So the CMSIS driver package basically grouped into like a CAN module is for CAN driver, Ethernet packages for Ethernet driver, I2C packages for I2C driver.
So like that they have grouped all the hardware peripheral drivers together and they made this CMSIS-DSP. So when you have a CMSIS driver package, you will be having all this driver APIs and driver HL or mid-layer software with you. So with this APIs, you can easily, you can develop the device driver level programs and application level programs in a very easy manner. So that will reduce the time of development. So as per the picture you can see in the right side of the slide, the software packs. Software pack is in the device pack, we have USB driver, Ethernet driver and UART, SPI, all the drivers that will be talking to the middleware software.
And in the left side of that picture, you can see the device or the hardware part of the microcontroller that will be interacting with this driver. So these software packages are very helpful to develop the driver level or application or middle layer level software development. So each CMSIS driver contains these functions. So each CMSIS driver packages or CMSIS driver module has a common way of programming and a common way of API usage. So you can see a get version, get capabilities and initialize, a signal event, power control, uninitialize and control.
So these are the common driver API names used in the driver packages. So it is a standardized way of using the API in the driver package. So get version means getting the version information of the driver interface and get capabilities to obtain the capability. capabilities of the driver interface. So initialize means called before powering the peripheral using power control. So this is a initialization part of the driver and the signal event is the callback function which is triggered from ISR and denote hardware events or completion of the data block transfer operation.
So power control, control the power profile of the peripheral and must be called after initialization. So these are the common interfaces, common APIs is used for all the driver package. So if you have I2C driver, I2C power control will be there, I2C signal event API will be there, I2C get version API will be there, I2C get capabilities API will be there. And in the case of a CAN, you have the same API name with the CAN driver, so get version CAN or get capabilities CAN and initialize CAN like this APIs are there.
So they have standardized way of API and that will help you to understand the drivers and that will help you to develop the middleware or application in a very easy manner. So these are the standard, standard APIs are available with each driver. So all these APIs are available in each driver modules and some of other examples also are given here, uninitialization. So this API will complementary function to initialize. So once you initialize the function or once you initialize driver, after utilization of the driver, you can uninitialize and that will close the IOPIN resources used by the interface.
So control function, the many drivers provide a control function to configure communication parameters or execute miscellaneous control function. So there is a control API that will be used for the configuration of the driver and some control function in the driver. So this is what all about the CMSIS driver and let's go to the next part. This package is nothing but CMSIS RTOS version 2. So we had CMSIS RTOS version 1, but that is, it was, it is now old one and we had an updated package available in the organization.
So this RTOS specification contains standard APIs for an RTOS. This is an, in effect, a collection of wrapper function that translate the CMSIS RTOS API to the API of the specific RTOS that you are using. So, for example, normally when we are using a RTOS in your microcontroller project, you will have a hardware layer and you will have a HA layer and that is hardware abstraction layer. And then you will have a middleware software and OS software. And this OS software, OS packages and OS layer software package will give you interfaces or APIs to access the hardware in the microcontroller hardware layer.
So this OS layer is acting as a middle software packages and that will give you so many other functionalities like a task scheduling and task management, memory management, all those stuff. So here normal microcontroller, the RTOS project, you will have, as I said, a lower layer software and OS layer and then application layer. So application layer will be using this OS APIs. So for creating tasks, they are using OS APIs and memory management, OS task synchronization, everything they are using or application will be using RTOS API.
So the problem here is or the disadvantages here is you have developed application and that application will be completely using all the APIs in the RTOS provided APIs. So here one disadvantage we can say, suppose the RTOS are mostly paid resources or paid software and some free RTOS are also available. But if you are changing the RTOS in your project in the later stage, your application also has to be changed because all the APIs are used from the RTOS API. So suppose you are using an X RTOS and the application will be using all the APIs from the X RTOS and then later stage, if you are changing the RTOS to Y, so Y RTOS will have a different API names.
So your application also has to change with the change of RTOS. So there is a dependency between RTOS and application layer and so here the advantages of CMSIS RTOS is CMSIS RTOS is a layer of package that will be having a common API name and you can build the application based on that API name. So your application and the middleware software will be using the CMSIS RTOS API and the actual RTOS will be comes under this CMSIS RTOS. So your actual RTOS and your actual the real-time OS API will not be exposed to your application that will be exposed to your CMSIS layer.
So the CMSIS layer will use the actual RTOS and CMSIS will give you a common API to the application. So here the advantage is always you can develop the application with the CMSIS RTOS API that will not change based on the actual RTOS. Was used in the project because actual RTOS will be again one more layer down in the CMC's RTOS layer. So third party RTOS will be using CMC's RTOS API and the CMC's RTOS API will be provided and that will be used by the application.
So if you change the RTOS later stage, that will not affect the application because the CMC's application is always using the CMC's API, RTOS API. So this is a one advantage I would say in the CMC's RTOS layer. So you can develop applications in a very flexible manner and that will be very portable applications you can develop. So the same application you can flash in or you can use it in another system which is having the CMC's RTOS. So this is a one of the application or this is one of the advantages of CMC's RTOS.
Then comes to CMC's DSP. So as we know that Cortex-M4 microcontroller has the DSP core. So the DSP core will be used by the DSP library. So CMC's include a DSP library that provide most of the commonly used DSP mathematical functions. So the library is divided into several functions each covering a specific category like math function, fast math function, complex math function, filtering function. All these kind of all the DSP related software libraries will be available with the CMC's DSP. So when you have a DSP related application, no need to develop all this standard library in your project.
The CMC's DSP library will be already developed all this basic standard mathematical library. So that library is divided into a number of functions each covering a specific category like as I said motor control function, statical, statistical function, support functions, interpolation, bias classifier function, contrarian functions. So many other DSP related functions are there but these are included in the DSP library. So the next CMC's package or CMC's software package is CMC's SVD and DAP. So CMC's is DAP specification provide interface protocol for hardware debugging unit and that sit between the host PC and the debug access port of the microcontroller.
So helping software toolchain that support CMC's DAP to connect it to any hardware debug unit with the CMC's DAP support. So we will summarize the significance of CMC's. It consists of software interfaces, improve the software's portability and reusability and also it is a software compatibility it will provide. So it will reduce the learning curve of the microcontroller development for the developers because the CMC's will be standard across all the microcontroller and the usage of interfaces and APIs will be easy to understand once it is understood by the developers it will be easy for any platform.
So it will improve the time to market for new devices and it interfaces for debug connectivity and debug peripheral views. Since it is compiler independent it allows you to use the compiler for your choice because any compiler which will be supporting the CMC's you can use. And the CMC's is delivered in CMC's pack format which helps with the speedy software delivery, fewer complex updates and provide consistent integration into development tools. So these are the significance of CMC's. By using the CMC's software package in my Cortex microcontroller you will get all these advantages or the facilities.
So that is the significance and that will give you a better software development process with this CMC's package. Now we are going to discuss about ARM Cortex M4 programming model. So what is a programming model? So programming model we are basically discussing about what are the important details and the important aspects of Cortex M4 family microcontrollers that will be required for the programming of or software development of the Cortex family. So in programming model you need to discuss or you need to learn some of the aspects in the Cortex M4.
So we will be going through this aspect one by one. First one is the programmer's model. So what is programmer's model? So the individual core registers descriptions that contains information about the processor modes and the privilege level of software execution and task. So the programmer's model talks about the individual core registers description and that contains information about the processor modes and privilege levels. So you need to understand the programmer's model before going to start the programming of Cortex M4 and the memory model. So memory model this section shows the processor memory map, the behavior of the memory access and the big band features all those things.
So memory model will describe you the memory model of the microcontroller and exception types. Exception types describe the exception model and the fault handling and power management. So these points are covered in the exception mode types of the programming model and the Cortex M4 processes sleep modes reduce power consumption. So these sleep modes are comes in this power modes and the sleep mode stop the processor clock. All other system and the peripheral clocks may still be running and deep sleep mode stop most of the system peripheral clocks.
So this corresponds to either stop or standby mode. So we will be discussing about all the programming model one by one. So in the programming model I have already told the first one is programmer's model. So programmer's model these are the points or these are the features we are going to look into the details. So in the programmer's model processor mode and the privilege level of software execution. For example, the thread mode and the handler mode and the privileges level for software execution like unprivileged and privileged.
These kind of information that comes in the programmer's model and also the stack. So the processor has a main stack and a processor stack. So each with the independent copies of the stack pointer. So the control register control whether the processor use the main stack or the processor stack in the thread mode. And the core registers. Core registers are general purpose registers, link registers, program counters and other registers like interrupt program to status registers. All the register related information comes in the core registers. And the exceptions and interrupts that is also comes in the programmer's model.
So the details explanation will be given in this table. Add the data types. What are the data types that supported in this microcontroller and CMS layer information. All those comes in the programmer's model. And the memory model. Memory model as I said it is talks about the memory. So what are the points or what are the features it is talking about. One is memory region and types and attributes. So in the normal the processor can reorder transaction for efficiency or perform speculation reads device the processor.
It preserve the transaction order related to other transaction in the device or strongly ordered memory. So memory system ordering of memory access. Behavior of memory access. So normally executable region for the program code. One can also put data there and the region include a bit band. That external device memory region include the non-nested vector interrupt controller, system timer and the system control block. All those points comes in the behavior of memory access. And also the software ordering of memory access. So order of instruction in the program flow does not always guarantee the order of the corresponding memory transaction.
These all points comes under the memory model of Cortex-M4. So when you start programming or whenever you are dealing with the memory handling of Cortex-M4 microcontroller. These points or these memory model you need to refer and you will get the complete information about the memory related topics. And the memory endiness. So as you know, we have a big Indian and little Indian order. So what is the memory endiness? All those all comes into this programming model. And the exception model. Exception model, as you know, there are different type of exception.
Exception state, exception types, exception handlers, vector tables, exception priorities, exception entry and return. So these many concept or these many points we are describing in this example. For example, exception state, what are the states of exception, inactive, pending, active, active and pending, all those, what are the peculiarities of these states, these will be covering in the exception model. And the exception types, as I said earlier, like Reset, Non-Maskable Interrupt, Hardware Fault, Memory Management Fault, Bus Fault, Usage Fault, other SV Call, Pinned, SV, Systeak, Interrupt, Interrupt Request Queue, all this comes under this exception type.
And the exception handless is nothing but ISR and the fault handless and other comes under this exception handless. And the exception priorities and the priorities of different priority level of the exceptions and the non-maskable interrupts and the higher priority, what is the lower priority, all the configuration comes under this priorities, all those comes under this exception priority topics. And the vector table and you know that each vector will have a specific address, I mean each interrupt will have a specific address that will call as interrupt vector.
And if we have a vector table and if we have a vector table that will be placed in the memory that will be referring to addresses of each interrupt. So information regarding the vector table, all this comes under this exception model. So these are the topics or these are the subject which will come under the exception model of Cortex-M4 processor. And the fault handling. So there are different type of fault and that will be like a bus error or vector or fault escalated to the hard fault, imbue or default memory map mismatch, all those comes under this fault type.
And fault escalation and hard fault like all fault exceptions except for the hard fault have configured rubble exception priority as described in the system handler priority register. So software can disable execution of the handlers for this fault as described in the system handler control and state register. So these minute information are regarding the fault handling of Cortex-M4 processor. So whenever you are come across the programming part of fault and handling of fault and how to handle the error situation, all those time you have to refer this fault handling mechanism of Cortex-M4 programming model.
Like that the fault status registers and the information about the fault address registers, all those comes under this one. And then finally the power management. The power management will be having mostly it will be describing about the entering sleep mode and wake up from the sleep mode and external event input extended interrupt and event input. So these topics comes under the power management. So entering in the sleep mode like the system can generate spurious wake up events for example a debug operation that wake ups a processor.
So therefore the software must be able to put the processor back to the sleep mode after such an event. So program might be having an ideal loop to put the processor back to sleep mode. So these entering how to enter into the sleep mode, wake up from the sleep mode, what are the conditions for the process to wake up and depends on the mechanism that goes to enter into sleep mode. So wake up from wake up source or sleep on exit, wake up from future interrupt and wake up from the forward enable.
All these are the sources of waking up the sleep mode and next external event input and extend and interrupt event input. All these are describing about the power management and the interrupt related functionality. So the detailed description and the detailed minute information you will get it from the programmers model of Cortex series from the ARM website itself. So this will give you an overview and this will give you a basic understanding of what is the exact idea behind this programming model. So we are concluding the session here.
So here we are summarizing the entire topic into ARM Cortex architecture basics are essential requirement of embedded software portionals. And this session presents a basic understanding of the ARM Cortex series and its internal module and its functionality in brief. So this will help you to start a software development on ARM Cortex based microcontroller system. So definitely this will help you to understand the Cortex M4 related programming and that will help you to start the programming and start the software development in the Cortex M0 or Cortex M4 microcontroller based system.
So we had already discussed about the internals and the core peripherals and their functionalities in this presentation. I hope all the participants will understand this Cortex M7 series microcontroller basics and let's wind up this session here and thank you.