2025-12-22 10:32 PM
I am reporting a compilation error that occurs when using the STM32F1xx Standard Peripheral Library (SPL) in Keil MDK v6 (specifically using the RTE pack downloaded via Arm Keil Studio for VS Code). This issue is caused by a naming mismatch in the NVIC structure between the legacy SPL and the latest CMSIS core headers.
In the latest CMSIS core headers, the Interrupt Priority Register in the NVIC structure is defined as IPR. However, the misc.c file in the Standard Peripheral Library still refers to it as IP.
Error Message: ~/.cache/arm/packs/Keil/STM32F1xx_DFP/2.4.1/Device/StdPeriph_Driver/src/misc.c:131:11: error: no member named 'IP' in 'NVIC_Type'
Technical Details & Suggested Fix: The bug is located in the STM32F1xx_DFP/2.4.1/Device/StdPeriph_Driver/src/misc.c file, specifically around line 131 within the NVIC_Init function.
To ensure out-of-the-box compatibility for MDK v6 users, I propose updating the current code:
NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority;to use the IPR member instead:
NVIC->IPR[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority;
Environment:
IDE: Keil MDK v6 (VS Code extension)
Device: STM32F103C8 series
Library: STM32F10x_StdPeriph_Driver (v3.6.0)
RTE Pack: Keil::STM32F1xx_DFP (v2.4.1)
2025-12-23 1:10 AM
@F4Corsair wrote:caused by a naming mismatch in the NVIC structure between the legacy SPL and the latest CMSIS core headers.)
As you say, SPL is (and has been for a long time) a legacy product - so it's not surprising that it doesn't match up with the latest CMSIS.
@F4Corsair wrote:To ensure out-of-the-box compatibility for MDK v6 users
If you want out-of-the-box compatibility, then you need to use compatible versions - not legacy versions.