2017-02-23 02:18 AM
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 (
), and SOME OF the problems I'm facing (just the few I remember now) are: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...
#cmsis #header-files2018-12-12 11:25 AM
Here's another one, and this one really drives me crazy.
Any header for L0 or L4:
typedef struct
{
__IO uint32_t ISR; /*!< DMA interrupt status register, Address offset: 0x00 */
__IO uint32_t IFCR; /*!< DMA interrupt flag clear register, Address offset: 0x04 */
} DMA_TypeDef;
typedef struct
{
__IO uint32_t CSELR; /*!< DMA channel selection register, Address offset: 0xA8 */
} DMA_Request_TypeDef;
Any header for F0 (which has CSELR, so e.g. F091):
typedef struct
{
__IO uint32_t ISR; /*!< DMA interrupt status register, Address offset: 0x00 */
__IO uint32_t IFCR; /*!< DMA interrupt flag clear register, Address offset: 0x04 */
uint32_t RESERVED0[40];/*!< Reserved as declared by channel typedef 0x08 - 0xA4 */
__IO uint32_t CSELR; /*!< Channel selection register, Address offset: 0xA8 */
} DMA_TypeDef;
Do note that the offsets are identical, so why make the lives of library writers so miserable by introducing such pointless differences?