AnsweredAssumed Answered

Any chance for CMSIS headers to be consistent across families?

Question asked by Freddie Chopin on Feb 23, 2017

The consistency of CMSIS headers for different STM32 families is really terrible, which makes writing a multiplatform project a misery. The project I'm talking about is obviously my C++ RTOS ( distortos - object-oriented C++ RTOS for microcontrollers  ), and SOME OF the problems I'm facing (just the few I remember now) are:

  1. FLASH_SR_RDERR is defined only for STM32F72 and STM32F73, so the define is not available when you use any other STM32F7, F0, F1 or F4 chip.
  2. Any defines for FLASH->KEY are not available for STM32F7 and F4, while available for F0 and F1.
  3. Headers for F0 and F7 define just GPIO_OTYPER_OT_x, headers for F4 have GPIO_OTYPER_OTx, GPIO_OTYPER_OT_x and the "new" "..._Pos" and "..._Msk" defines. The same is true for IDR, ODR, BSRR, but not true for others (like OSPEEDR, PUPDR, ...).
  4. All headers I've checked have FLASH_SR_SOP, while the manuals always lists that this should be "..._OPERR" (which is not defined in any header).
  5. ...


I'm talking about the most recent versions of these packages (unless you uploaded new versions within last 2 weeks). You're generating all of that with a script, so why not just try to make ALL of the families consistent?


I've only checked F0, F1, F4 and F7, but I'm pretty sure that when I check other families, the situation will be much worse...