Moving stm32 f2/f4 flash code into the common area.
Change flash_erase_sector (f2/f4) to take numerical sector argument.

As opposed to using one of the defines in the header, this is more convenient when programatically deciding which sectors to erase.
Add higher level flash_program function for f2/f4 to write a buffer into flash.
Write 0 to clear flags in the timer SR, no need to read from it.
Adding basic support for v7m sync primatives and mutex convenience functions.
Merge branch 'cm3_sync'
Merge branch 'flash_cleanup'