Skip to content

Commit fdd5b08

Browse files
committed
modules: hal_nordic: fix errors with CMSIS_6
What is the change? Add stubs for cmsis to avoid compile error with hal_nordic when compiling for BSIM/POSIX. Why do we need this change? BSIM ci reported compiler errors when CMSIS_6 module was used for Cortex-M instead of the older cmsis module. The error was because CMSIS_6 couldn't find "arm_acle.h" and that __ARM_ARCH_PROFILE was not defined to an expected value however, this error highlighted that hal_nordic was including cmsis header files even CONFIG_ARCH was "posix" and not "arm". Updating to CMSIS_6 is important for future maintenance and to add new features so we can't include those header files in hal_nordic from CMSIS_6 but, hal_nordic still needs some cmsis alternative header file to compile. Upon inspection it was found that there is a cmsis.h created as an alternative when compiling for POSIX/BSIM in Zephyr so, we use that file and fix the issue. Signed-off-by: Sudan Landge <[email protected]>
1 parent 9eb3ad3 commit fdd5b08

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

boards/native/nrf_bsim/common/cmsis/cmsis_instr.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@
3636
#define __NOP()
3737
#endif
3838

39+
#ifndef __I
40+
#ifdef __cplusplus
41+
#define __I volatile /*!< Defines 'read only' permissions */
42+
#else
43+
#define __I volatile const /*!< Defines 'read only' permissions */
44+
#endif
45+
#endif
46+
47+
#ifndef __O
48+
#define __O volatile /*!< Defines 'write only' permissions */
49+
#endif /* !__O */
50+
51+
#ifndef __IO
52+
#define __IO volatile /*!< Defines 'read / write' permissions */
53+
#endif /* !__IO */
54+
3955
void __WFE(void);
4056
void __WFI(void);
4157
void __SEV(void);
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright 2025 Arm Limited and/or its affiliates <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef CORE_CM0_H
8+
#define CORE_CM0_H
9+
10+
#include "cmsis.h"
11+
12+
#endif /* CORE_CM0_H */
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright 2025 Arm Limited and/or its affiliates <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#ifndef CORE_CM4_H
7+
#define CORE_CM4_H
8+
9+
#include "cmsis.h"
10+
11+
#endif /* CORE_CM4_H */
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright 2025 Arm Limited and/or its affiliates <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#ifndef CORE_CM33_H
7+
#define CORE_CM33_H
8+
9+
#include "cmsis.h"
10+
11+
#endif /* CORE_CM33_H */

0 commit comments

Comments
 (0)