Understanding the convoluted world of ARM cortex-M documentation.


ARM processors are usually powerful and most likely you are reading this on a device with an ARM cortex application processor(Your phone).

Usually when one starts out programming ARM micro controllers , it gets very intimidating to start programming so I will give a few hints to the rules of thumb I use to wade through the multitude of documentation available. This applies to almost all Cortex M micro controllers across various vendors.

  1. Look through ARM micro controller vendor’s portfolio of chips such as those from NXP, STM32 etc . Base your decision on the peripherals the micro-controller offers versus its price.Peripherals include HDMI controllers, USB controllers, Infared controllers(IRDA) depending on the application.
  2. Look though the micro controller data sheet second. It is a relatively short manual usually of about 100-200 pages that talks of the physical properties of the chip including the peripherals. This should be enough to make you decide what chip you want.
  3. Next document to look at from the micro controller vendor is the errata which lists uncorrected errors in the data sheet revisions and also in the technical reference manual(TRM) below. It may also list changes on the micro controller itself including peripheral limitations. Reading this is a must for mass product development.
  4. Look for drivers, (they may be in C) that expose a common API by which to communicate with and control the hardware using the firmware you will write. Examples are the current STM32cube and the older standard peripheral library(spl) by ST Micro(Works only on STM devices) or the open source libopencm3 (Works across numerous ARM vendors)
  5. Setup tool chain, IDE and link with the drivers.
  6. Set up debug interface via GDB and openocd.
  7. After your mind is made up and you have set up a tool chain on your computer that can program the chosen chip, the next reference should be the technical reference manual that describes the register layout of each peripheral and the different modes allowed(~1000pages). Use this only for reference to check peripheral descriptions, operating modes or if you need a way to access a register using assembly if a C function isn’t available or it isn’t prudent to use C.
  8. Use the driver library documentation and reference if the documentation is in line with the technical reference manual.
  9. Program away!

Here is example documentation for the stm32f446RE:

Just  remember the tool chain and IDE may be the most painful to setup but you only have to do it once!



Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s