Nihal

ARM M Class CPU

Most of the embedded products use ARM CPUs. There are mainly 3 types of CPUs by ARM - M, R and A. M stands for microcontroller, R for real-time and A for application. Understanding M class cpu internals is a good foundation for working with microcontroller based products.

I suggest this playlist (1 hour duration) by piyush (embedded software engineer @Google). Where he starts by explaining ARM as a company and the 3 classes of CPUs.

2nd video about architecture as high level description of how the cpu should behave and microarchitecture being the low level implementation of that description.

3rd video about how cpu interacts with memory via the RISC load-store design. 4th video about how to think about cpu in terms of various mental models - programmer's, exception, memory, and debug models.

In the 5th video he dives into the programmer's model - the 16 registers (R0-R15) and status/control registers.

6th video talks about modes and privileges - I recommend watching this lecture twice as MSP (main stack pointer) and PSP (process stack pointer) will come again when we work with RTOS stuff.

7th video talks about vector table and boot process, followed by a QEMU emulation in video 8, where he uses GDB to inspect registers to show/validate the concepts we talked about so far.

Final video recaps and invites us to his second course where we write a scheduler in assembly for ARM Cortex-M. This is the playlist on YouTube but around 8 videos are hidden as these require lot of effort and time to create.

He hosts a platform called pyjamacafe where he give this course and related contents on firmware, systems programming. The platform will introduce a discount1 around October. So I recommend waiting till.

  1. for more information check out this post↩

#hardware