cancel
Showing results for 
Search instead for 
Did you mean: 

Compile error: no member named 'SHPR' in 'SCB_Type'

regjoe
Senior

Hello,

I'm new to Keil and want to port an existing project from STM/FreeRTOS/GNU to Keil toolchain. 

I've created a project for STM32F4 for Keil MDK using CubeMx V6.15.0.

For RTOS, I use RTX5 / CMSIS-RTOS2 API.

I get the following compile error

C:/Users/t3.loc.StJo/AppData/Local/Arm/Packs/ARM/CMSIS/6.2.0/CMSIS/RTOS2/Source/os_systick.c(70): error: no member named 'SHPR' in 'SCB_Type'; did you mean 'SHP'?
  SCB->SHPR[11]  = SYSTICK_IRQ_PRIORITY;
       ^~~~
       SHP
../Drivers/CMSIS/Include\core_cm4.h(453): note: 'SHP' declared here
  __IOM uint8_t  SHP[12U];               /*!< Offset: 0x018 (R/W)  System Handlers Priority Registers (4-7, 8-11, 12-15) */

According to this info Breaking changes in CMSIS-Core 6, there is a version mismatch between the CMSIS-RTOS and the STM HAL version. First is installed via Keil IDE, second by CubeMx.

As a quick test I renamed SHP to SHPR in core_cm4.h but I'm quite sure that this is not the way to go.

Here is my setup:

regjoe_0-1758644368765.png

regjoe_2-1758644433537.png

Any suggestions are very appreciated.

2 REPLIES 2
Zack
Associate II

A year ago I reported a related issue(175309), which has not yet been updated and fixed. The temporary solution is to overwrite the old .h file with the latest version of the .h file.

According to cmsis_version.h file in CMSIS directory created by CubeMx the CMSIS version is 5.3.

The CMSIS version installed by Keil IDE is 6.1 and is here located in the global Keil packs directory.

I did diff between the 5.3 and 6.1 directories and I got the impression it is better to use all files of the entire 6.1 directory instead of only replacing core_cmX.h.

I now face 3 possible solutions:

- patch SCB_Type structure in core_cmX.h

- overwrite the 5.3 CubeMx project directory by 6.1 files from Keil packs directory (or somewhere from internet?)

- adapted the CMSIS include path in the project settings to Keil CMSIS directory

I now setup the last option without any problem.

I guess if using the Keil RTX is used as preferred RTOS, which is here installed in pack directory, solution 3 is best regarding future RTOS updates. What do you think?