Skip to content

arch: arm: Cortex CM0+ with CMSIS_6 fails to build #93689

@sgfeniex

Description

@sgfeniex

Describe the bug

Failure to build because CMSIS5 and CMSIS6 name these registers differently for CM0+. The PR below doesn't account for the CMSIS6 naming.

Regression

[x] This is a regression.

Steps to reproduce

Build an application for CM0+ using CMSIS_6

Relevant log output

/home/runner/work/x/x/zephyr/arch/arm/core/cortex_m/scb.c: In function 'z_arm_save_scb_context':
/home/runner/work/x/x/zephyr/arch/arm/core/cortex_m/scb.c:37:25: error: 'SCB_Type' has no member named 'SHP'; did you mean 'SHPR'?
   37 | #define SHPR_FIELD_NAME SHP
      |                         ^~~
/home/runner/work/x/x/zephyr/arch/arm/core/cortex_m/scb.c:194:62: note: in expansion of macro 'SHPR_FIELD_NAME'
  194 |         volatile uint32_t *shpr = (volatile uint32_t *) SCB->SHPR_FIELD_NAME;
      |                                                              ^~~~~~~~~~~~~~~

Impact

Showstopper – Prevents release or major functionality; system unusable.

Environment

OS : Ubuntu 22.04
Toolchain : zephyr

Extra

@msmttchr ⚠️ CMSIS calls it SHPR on CM0+

https://github.com/ARM-software/CMSIS_6/blob/964440d18a57985e59db64914569ad13dac07c32/CMSIS/Core/Include/core_cm0plus.h#L356-L371

Originally posted by @sgfeniex in a90a47b

Ref #93161

Metadata

Metadata

Assignees

Labels

area: ARMARM (32-bit) Architecture

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions