You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ut...@apache.org on 2018/03/15 12:42:52 UTC

[mynewt-core] 01/03: Move cmsis_nvic.h files frm BSP to MCU

This is an automated email from the ASF dual-hosted git repository.

utzig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit a926c9c1025087967f113235c4fe7cd5ee6a8dc2
Author: Fabio Utzig <ut...@apache.org>
AuthorDate: Fri Mar 9 09:22:01 2018 -0300

    Move cmsis_nvic.h files frm BSP to MCU
    
    This moves cmsis_nvic.h from BSPs to MCUs. Where customizations where
    necessary, new syscfg options were added to the MCU to be overridden by
    the BSP, eg, number of peripheral interrupts.
---
 LICENSE                                            | 25 +++++------
 hw/bsp/ada_feather_nrf52/include/bsp/cmsis_nvic.h  | 29 -------------
 .../arduino_primo_nrf52/include/bsp/cmsis_nvic.h   | 29 -------------
 hw/bsp/bbc_microbit/include/bsp/cmsis_nvic.h       | 30 --------------
 hw/bsp/ble400/include/bsp/cmsis_nvic.h             | 30 --------------
 hw/bsp/bmd200/include/bsp/cmsis_nvic.h             | 30 --------------
 hw/bsp/calliope_mini/include/bsp/cmsis_nvic.h      | 30 --------------
 hw/bsp/dwm1001-dev/include/bsp/cmsis_nvic.h        | 29 -------------
 hw/bsp/frdm-k64f/src/hal_bsp.c                     |  2 +-
 hw/bsp/nina-b1/include/bsp/cmsis_nvic.h            | 29 -------------
 hw/bsp/nrf51-arduino_101/include/bsp/cmsis_nvic.h  | 30 --------------
 hw/bsp/nrf51-arduino_101/src/hal_bsp.c             |  2 +-
 hw/bsp/nrf51-blenano/include/bsp/cmsis_nvic.h      | 30 --------------
 hw/bsp/nrf51dk-16kbram/include/bsp/cmsis_nvic.h    | 30 --------------
 hw/bsp/nrf51dk/include/bsp/cmsis_nvic.h            | 30 --------------
 hw/bsp/nrf52-thingy/include/bsp/cmsis_nvic.h       | 29 -------------
 hw/bsp/nrf52840pdk/include/bsp/cmsis_nvic.h        | 29 -------------
 hw/bsp/nrf52dk/include/bsp/cmsis_nvic.h            | 29 -------------
 hw/bsp/nucleo-f303k8/src/system_stm32f3xx.c        |  2 +-
 hw/bsp/nucleo-f303re/include/bsp/cmsis_nvic.h      | 48 ----------------------
 hw/bsp/nucleo-f303re/src/system_stm32f3xx.c        |  2 +-
 hw/bsp/nucleo-f401re/src/system_stm32f4xx.c        |  2 +-
 hw/bsp/nucleo-f413re/include/bsp/cmsis_nvic.h      | 29 -------------
 hw/bsp/nucleo-f413re/src/system_stm32f4xx.c        |  2 +-
 hw/bsp/nucleo-f413zh/include/bsp/cmsis_nvic.h      | 29 -------------
 hw/bsp/nucleo-f413zh/src/system_stm32f4xx.c        |  2 +-
 hw/bsp/olimex-p103/src/system_stm32f1xx.c          |  2 +-
 .../include/bsp/cmsis_nvic.h                       | 29 -------------
 .../src/system_stm32f4xx.c                         |  2 +-
 hw/bsp/puckjs/include/bsp/cmsis_nvic.h             | 29 -------------
 hw/bsp/rb-blend2/include/bsp/cmsis_nvic.h          | 29 -------------
 hw/bsp/rb-nano2/include/bsp/cmsis_nvic.h           | 29 -------------
 hw/bsp/ruuvi_tag_revb2/include/bsp/cmsis_nvic.h    | 29 -------------
 hw/bsp/sensorhub/include/bsp/cmsis_nvic.h          | 29 -------------
 hw/bsp/sensorhub/src/system_stm32f4xx.c            |  2 +-
 hw/bsp/sensorhub/syscfg.yml                        |  1 +
 hw/bsp/stm32f3discovery/include/bsp/cmsis_nvic.h   | 48 ----------------------
 hw/bsp/stm32f3discovery/src/system_stm32f3xx.c     |  2 +-
 hw/bsp/stm32f429discovery/include/bsp/cmsis_nvic.h | 29 -------------
 hw/bsp/stm32f429discovery/src/hal_bsp.c            |  2 +-
 hw/bsp/stm32f429discovery/src/system_stm32f4xx.c   |  2 +-
 hw/bsp/stm32f429discovery/syscfg.yml               |  1 +
 hw/bsp/stm32f4discovery/include/bsp/cmsis_nvic.h   | 29 -------------
 hw/bsp/stm32f4discovery/src/system_stm32f4xx.c     |  2 +-
 hw/bsp/stm32f767-nucleo/src/system_stm32f7xx.c     |  2 +-
 hw/bsp/stm32f767-nucleo/syscfg.yml                 |  1 +
 hw/bsp/stm32f7discovery/include/bsp/cmsis_nvic.h   | 29 -------------
 hw/bsp/stm32f7discovery/src/system_stm32f7xx.c     |  2 +-
 hw/bsp/stm32l152discovery/src/system_stm32l1xx.c   |  2 +-
 hw/bsp/telee02/include/bsp/cmsis_nvic.h            | 29 -------------
 hw/bsp/vbluno52/include/bsp/cmsis_nvic.h           | 29 -------------
 hw/cmsis-core/src/cmsis_nvic.c                     |  2 +-
 hw/drivers/adc/adc_nrf51/src/adc_nrf51.c           |  2 +-
 hw/drivers/adc/adc_nrf52/src/adc_nrf52.c           |  2 +-
 hw/drivers/adc/adc_stm32f4/src/adc_stm32f4.c       |  2 +-
 hw/drivers/lwip/stm32_eth/src/stm32_eth.c          |  2 +-
 hw/drivers/nimble/nrf51/src/ble_hw.c               |  2 +-
 hw/drivers/nimble/nrf51/src/ble_phy.c              |  2 +-
 hw/drivers/nimble/nrf52/src/ble_hw.c               |  2 +-
 hw/drivers/nimble/nrf52/src/ble_phy.c              |  2 +-
 .../ambiq/apollo2/include/mcu}/cmsis_nvic.h        |  0
 hw/mcu/ambiq/apollo2/src/hal_gpio.c                |  2 +-
 hw/mcu/ambiq/apollo2/src/hal_os_tick.c             |  2 +-
 hw/mcu/ambiq/apollo2/src/hal_spi.c                 |  2 +-
 hw/mcu/ambiq/apollo2/src/hal_timer.c               |  2 +-
 hw/mcu/ambiq/apollo2/src/hal_uart.c                |  2 +-
 .../nordic/nrf51xxx/include/mcu}/cmsis_nvic.h      |  0
 hw/mcu/nordic/nrf51xxx/src/hal_gpio.c              |  2 +-
 hw/mcu/nordic/nrf51xxx/src/hal_os_tick.c           |  2 +-
 hw/mcu/nordic/nrf51xxx/src/hal_spi.c               |  2 +-
 hw/mcu/nordic/nrf51xxx/src/hal_timer.c             |  2 +-
 hw/mcu/nordic/nrf51xxx/src/hal_uart.c              |  2 +-
 hw/mcu/nordic/nrf51xxx/src/hal_watchdog.c          |  2 +-
 hw/mcu/nordic/nrf51xxx/src/system_nrf51.c          |  2 +-
 .../nordic/nrf52xxx/include/mcu}/cmsis_nvic.h      |  3 +-
 hw/mcu/nordic/nrf52xxx/src/hal_gpio.c              |  2 +-
 hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c           |  2 +-
 hw/mcu/nordic/nrf52xxx/src/hal_spi.c               |  2 +-
 hw/mcu/nordic/nrf52xxx/src/hal_timer.c             |  2 +-
 hw/mcu/nordic/nrf52xxx/src/hal_uart.c              |  2 +-
 hw/mcu/nordic/nrf52xxx/src/hal_watchdog.c          |  2 +-
 hw/mcu/nordic/nrf52xxx/src/system_nrf52.c          |  2 +-
 .../nxp/MK64F12/include/mcu}/cmsis_nvic.h          |  0
 hw/mcu/nxp/MK64F12/src/hal_gpio.c                  |  2 +-
 hw/mcu/nxp/MK64F12/src/hal_os_tick.c               |  2 +-
 hw/mcu/nxp/MK64F12/src/hal_uart.c                  |  2 +-
 hw/mcu/nxp/MK64F12/src/hal_watchdog.c              |  2 +-
 .../nxp/mkw41z/include/mcu}/cmsis_nvic.h           |  0
 hw/mcu/nxp/mkw41z/src/hal_gpio.c                   |  2 +-
 hw/mcu/nxp/mkw41z/src/hal_os_tick.c                |  2 +-
 hw/mcu/nxp/mkw41z/src/hal_watchdog.c               |  2 +-
 hw/mcu/nxp/mkw41z/src/system_MKW41Z4.c             |  2 +-
 .../stm/stm32f1xx/include/mcu}/cmsis_nvic.h        |  0
 hw/mcu/stm/stm32f1xx/src/hal_gpio.c                |  2 +-
 hw/mcu/stm/stm32f1xx/src/hal_spi.c                 |  2 +-
 hw/mcu/stm/stm32f1xx/src/hal_timer.c               |  2 +-
 hw/mcu/stm/stm32f1xx/src/hal_uart.c                |  2 +-
 .../stm/stm32f3xx/include/mcu}/cmsis_nvic.h        |  2 +-
 hw/mcu/stm/stm32f3xx/src/hal_gpio.c                |  2 +-
 hw/mcu/stm/stm32f3xx/src/hal_timer.c               |  2 +-
 hw/mcu/stm/stm32f3xx/src/hal_uart.c                |  2 +-
 .../stm/stm32f4xx/include/mcu}/cmsis_nvic.h        |  7 +++-
 hw/mcu/stm/stm32f4xx/src/hal_gpio.c                |  2 +-
 hw/mcu/stm/stm32f4xx/src/hal_spi.c                 |  2 +-
 hw/mcu/stm/stm32f4xx/src/hal_timer.c               |  2 +-
 hw/mcu/stm/stm32f4xx/src/hal_uart.c                |  2 +-
 hw/mcu/stm/stm32f4xx/syscfg.yml                    |  4 ++
 .../stm/stm32f7xx/include/mcu}/cmsis_nvic.h        |  7 +++-
 hw/mcu/stm/stm32f7xx/src/hal_gpio.c                |  2 +-
 hw/mcu/stm/stm32f7xx/src/hal_timer.c               |  2 +-
 hw/mcu/stm/stm32f7xx/src/hal_uart.c                |  2 +-
 hw/mcu/stm/stm32f7xx/syscfg.yml                    |  4 ++
 .../stm/stm32l1xx/include/mcu}/cmsis_nvic.h        |  0
 hw/mcu/stm/stm32l1xx/src/hal_gpio.c                |  2 +-
 hw/mcu/stm/stm32l1xx/src/hal_spi.c                 |  2 +-
 hw/mcu/stm/stm32l1xx/src/hal_timer.c               |  2 +-
 hw/mcu/stm/stm32l1xx/src/hal_uart.c                |  2 +-
 kernel/os/src/arch/cortex_m0/os_arch_arm.c         |  2 +-
 kernel/os/src/arch/cortex_m3/os_arch_arm.c         |  2 +-
 kernel/os/src/arch/cortex_m4/os_arch_arm.c         |  2 +-
 kernel/os/src/arch/cortex_m7/os_arch_arm.c         |  2 +-
 121 files changed, 111 insertions(+), 1010 deletions(-)

diff --git a/LICENSE b/LICENSE
index bc28d9b..8b36d82 100644
--- a/LICENSE
+++ b/LICENSE
@@ -260,21 +260,16 @@ This product bundles additional files from CMSIS-CORE, but these files are
 missing licensing information.  The BSD license was subsequently added to
 these files in later releases.  These files are:
     * hw/cmsis-core/src/cmsis_nvic.c
-    * hw/bsp/ada_feather_nrf52/include/bsp/cmsis_nvic.h
-    * hw/bsp/arduino_primo_nrf52/include/bsp/cmsis_nvic.h
-    * hw/bsp/bbc_microbit/include/bsp/cmsis_nvic.h
-    * hw/bsp/bmd200/include/bsp/cmsis_nvic.h
-    * hw/bsp/bmd300eval/include/bsp/cmsis_nvic.h
-    * hw/bsp/nrf51-arduino_101/include/bsp/cmsis_nvic.h
-    * hw/bsp/nrf51-blenano/include/bsp/cmsis_nvic.h
-    * hw/bsp/nrf51dk/include/bsp/cmsis_nvic.h
-    * hw/bsp/nrf51dk-16kbram/include/bsp/cmsis_nvic.h
-    * hw/bsp/nrf52840pdk/include/bsp/cmsis_nvic.h
-    * hw/bsp/nrf52dk/include/bsp/cmsis_nvic.h
-    * hw/bsp/nucleo-f401re/include/bsp/cmsis_nvic.h
-    * hw/bsp/olimex_stm32-e407_devboard/include/bsp/cmsis_nvic.h
-    * hw/bsp/rb-nano2/include/bsp/cmsis_nvic.h
-    * hw/bsp/stm32f4discovery/include/bsp/cmsis_nvic.h
+    * hw/mcu/ambiq/apollo2/include/mcu/cmsis_nvic.h
+    * hw/mcu/nordic/nrf51xxx/include/mcu/cmsis_nvic.h
+    * hw/mcu/nordic/nrf52xxx/include/mcu/cmsis_nvic.h
+    * hw/mcu/nxp/MK64F12/include/mcu/cmsis_nvic.h
+    * hw/mcu/nxp/mkw41z/include/mcu/cmsis_nvic.h
+    * hw/mcu/stm/stm32f1xx/include/mcu/cmsis_nvic.h
+    * hw/mcu/stm/stm32f3xx/include/mcu/cmsis_nvic.h
+    * hw/mcu/stm/stm32f4xx/include/mcu/cmsis_nvic.h
+    * hw/mcu/stm/stm32f7xx/include/mcu/cmsis_nvic.h
+    * hw/mcu/stm/stm32l1xx/include/mcu/cmsis_nvic.h
 
 This product bundles parts of STM32CubeF4 1.5, which is available under the
 "3-clause BSD" license.  Bundled files are:
diff --git a/hw/bsp/ada_feather_nrf52/include/bsp/cmsis_nvic.h b/hw/bsp/ada_feather_nrf52/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/ada_feather_nrf52/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/arduino_primo_nrf52/include/bsp/cmsis_nvic.h b/hw/bsp/arduino_primo_nrf52/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/arduino_primo_nrf52/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/bbc_microbit/include/bsp/cmsis_nvic.h b/hw/bsp/bbc_microbit/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 5d2ae83..0000000
--- a/hw/bsp/bbc_microbit/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-/* NOTE: the nrf51 SoC has 26 interrupts. */
-#define NVIC_USER_IRQ_OFFSET  16
-#define NVIC_NUM_VECTORS      (NVIC_USER_IRQ_OFFSET + 26)
-
-#include "nrf51.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/ble400/include/bsp/cmsis_nvic.h b/hw/bsp/ble400/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 5d2ae83..0000000
--- a/hw/bsp/ble400/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-/* NOTE: the nrf51 SoC has 26 interrupts. */
-#define NVIC_USER_IRQ_OFFSET  16
-#define NVIC_NUM_VECTORS      (NVIC_USER_IRQ_OFFSET + 26)
-
-#include "nrf51.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/bmd200/include/bsp/cmsis_nvic.h b/hw/bsp/bmd200/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 5d2ae83..0000000
--- a/hw/bsp/bmd200/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-/* NOTE: the nrf51 SoC has 26 interrupts. */
-#define NVIC_USER_IRQ_OFFSET  16
-#define NVIC_NUM_VECTORS      (NVIC_USER_IRQ_OFFSET + 26)
-
-#include "nrf51.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/calliope_mini/include/bsp/cmsis_nvic.h b/hw/bsp/calliope_mini/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 5d2ae83..0000000
--- a/hw/bsp/calliope_mini/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-/* NOTE: the nrf51 SoC has 26 interrupts. */
-#define NVIC_USER_IRQ_OFFSET  16
-#define NVIC_NUM_VECTORS      (NVIC_USER_IRQ_OFFSET + 26)
-
-#include "nrf51.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/dwm1001-dev/include/bsp/cmsis_nvic.h b/hw/bsp/dwm1001-dev/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/dwm1001-dev/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/frdm-k64f/src/hal_bsp.c b/hw/bsp/frdm-k64f/src/hal_bsp.c
index bb4e1e9..8cda57b 100644
--- a/hw/bsp/frdm-k64f/src/hal_bsp.c
+++ b/hw/bsp/frdm-k64f/src/hal_bsp.c
@@ -35,7 +35,7 @@
 #include "uart_hal/uart_hal.h"
 #include "hal/hal_uart.h"
 #endif
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "mcu/frdm-k64f_hal.h"
 #include "fsl_device_registers.h"
 #include "fsl_common.h"
diff --git a/hw/bsp/nina-b1/include/bsp/cmsis_nvic.h b/hw/bsp/nina-b1/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/nina-b1/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/nrf51-arduino_101/include/bsp/cmsis_nvic.h b/hw/bsp/nrf51-arduino_101/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 5d2ae83..0000000
--- a/hw/bsp/nrf51-arduino_101/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-/* NOTE: the nrf51 SoC has 26 interrupts. */
-#define NVIC_USER_IRQ_OFFSET  16
-#define NVIC_NUM_VECTORS      (NVIC_USER_IRQ_OFFSET + 26)
-
-#include "nrf51.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/nrf51-arduino_101/src/hal_bsp.c b/hw/bsp/nrf51-arduino_101/src/hal_bsp.c
index 6d5005a..372988c 100644
--- a/hw/bsp/nrf51-arduino_101/src/hal_bsp.c
+++ b/hw/bsp/nrf51-arduino_101/src/hal_bsp.c
@@ -29,7 +29,7 @@
 #include "syscfg/syscfg.h"
 #include "flash_map/flash_map.h"
 #include "hal/hal_flash.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "nrf51_bitfields.h"
 #include "hal/hal_spi.h"
 #include "os/os_dev.h"
diff --git a/hw/bsp/nrf51-blenano/include/bsp/cmsis_nvic.h b/hw/bsp/nrf51-blenano/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 5d2ae83..0000000
--- a/hw/bsp/nrf51-blenano/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-/* NOTE: the nrf51 SoC has 26 interrupts. */
-#define NVIC_USER_IRQ_OFFSET  16
-#define NVIC_NUM_VECTORS      (NVIC_USER_IRQ_OFFSET + 26)
-
-#include "nrf51.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/nrf51dk-16kbram/include/bsp/cmsis_nvic.h b/hw/bsp/nrf51dk-16kbram/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 5d2ae83..0000000
--- a/hw/bsp/nrf51dk-16kbram/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-/* NOTE: the nrf51 SoC has 26 interrupts. */
-#define NVIC_USER_IRQ_OFFSET  16
-#define NVIC_NUM_VECTORS      (NVIC_USER_IRQ_OFFSET + 26)
-
-#include "nrf51.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/nrf51dk/include/bsp/cmsis_nvic.h b/hw/bsp/nrf51dk/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 5d2ae83..0000000
--- a/hw/bsp/nrf51dk/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-/* NOTE: the nrf51 SoC has 26 interrupts. */
-#define NVIC_USER_IRQ_OFFSET  16
-#define NVIC_NUM_VECTORS      (NVIC_USER_IRQ_OFFSET + 26)
-
-#include "nrf51.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/nrf52-thingy/include/bsp/cmsis_nvic.h b/hw/bsp/nrf52-thingy/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/nrf52-thingy/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/nrf52840pdk/include/bsp/cmsis_nvic.h b/hw/bsp/nrf52840pdk/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 51b6eb6..0000000
--- a/hw/bsp/nrf52840pdk/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 46)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52840.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/nrf52dk/include/bsp/cmsis_nvic.h b/hw/bsp/nrf52dk/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/nrf52dk/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/nucleo-f303k8/src/system_stm32f3xx.c b/hw/bsp/nucleo-f303k8/src/system_stm32f3xx.c
index 1bcab6f..772d1db 100644
--- a/hw/bsp/nucleo-f303k8/src/system_stm32f3xx.c
+++ b/hw/bsp/nucleo-f303k8/src/system_stm32f3xx.c
@@ -84,7 +84,7 @@
   */
 
 #include "stm32f3xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 /**
   * @}
diff --git a/hw/bsp/nucleo-f303re/include/bsp/cmsis_nvic.h b/hw/bsp/nucleo-f303re/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 4d9d49b..0000000
--- a/hw/bsp/nucleo-f303re/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef CMSIS_NVIC_H
-#define CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 81)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "stm32f303xe.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/nucleo-f303re/src/system_stm32f3xx.c b/hw/bsp/nucleo-f303re/src/system_stm32f3xx.c
index 1bcab6f..772d1db 100644
--- a/hw/bsp/nucleo-f303re/src/system_stm32f3xx.c
+++ b/hw/bsp/nucleo-f303re/src/system_stm32f3xx.c
@@ -84,7 +84,7 @@
   */
 
 #include "stm32f3xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 /**
   * @}
diff --git a/hw/bsp/nucleo-f401re/src/system_stm32f4xx.c b/hw/bsp/nucleo-f401re/src/system_stm32f4xx.c
index 6a9dfb3..49d6ef3 100644
--- a/hw/bsp/nucleo-f401re/src/system_stm32f4xx.c
+++ b/hw/bsp/nucleo-f401re/src/system_stm32f4xx.c
@@ -64,7 +64,7 @@
   */
 
 #include "stm32f4xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #if !defined  (HSE_VALUE)
   #define HSE_VALUE    ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz */
diff --git a/hw/bsp/nucleo-f413re/include/bsp/cmsis_nvic.h b/hw/bsp/nucleo-f413re/include/bsp/cmsis_nvic.h
deleted file mode 100644
index d0c8b44..0000000
--- a/hw/bsp/nucleo-f413re/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 81)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "stm32f4xx.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/nucleo-f413re/src/system_stm32f4xx.c b/hw/bsp/nucleo-f413re/src/system_stm32f4xx.c
index ae68f72..a2fa9c5 100644
--- a/hw/bsp/nucleo-f413re/src/system_stm32f4xx.c
+++ b/hw/bsp/nucleo-f413re/src/system_stm32f4xx.c
@@ -64,7 +64,7 @@
   */
 
 #include "stm32f4xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #if !defined  (HSE_VALUE)
   #define HSE_VALUE    ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz */
diff --git a/hw/bsp/nucleo-f413zh/include/bsp/cmsis_nvic.h b/hw/bsp/nucleo-f413zh/include/bsp/cmsis_nvic.h
deleted file mode 100644
index d0c8b44..0000000
--- a/hw/bsp/nucleo-f413zh/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 81)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "stm32f4xx.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/nucleo-f413zh/src/system_stm32f4xx.c b/hw/bsp/nucleo-f413zh/src/system_stm32f4xx.c
index ae68f72..a2fa9c5 100644
--- a/hw/bsp/nucleo-f413zh/src/system_stm32f4xx.c
+++ b/hw/bsp/nucleo-f413zh/src/system_stm32f4xx.c
@@ -64,7 +64,7 @@
   */
 
 #include "stm32f4xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #if !defined  (HSE_VALUE)
   #define HSE_VALUE    ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz */
diff --git a/hw/bsp/olimex-p103/src/system_stm32f1xx.c b/hw/bsp/olimex-p103/src/system_stm32f1xx.c
index de9746b..e8faa13 100644
--- a/hw/bsp/olimex-p103/src/system_stm32f1xx.c
+++ b/hw/bsp/olimex-p103/src/system_stm32f1xx.c
@@ -75,7 +75,7 @@
   */
 
 #include "stm32f1xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 /**
   * @}
diff --git a/hw/bsp/olimex_stm32-e407_devboard/include/bsp/cmsis_nvic.h b/hw/bsp/olimex_stm32-e407_devboard/include/bsp/cmsis_nvic.h
deleted file mode 100644
index d0c8b44..0000000
--- a/hw/bsp/olimex_stm32-e407_devboard/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 81)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "stm32f4xx.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/olimex_stm32-e407_devboard/src/system_stm32f4xx.c b/hw/bsp/olimex_stm32-e407_devboard/src/system_stm32f4xx.c
index 0b7973b..ebee93d 100644
--- a/hw/bsp/olimex_stm32-e407_devboard/src/system_stm32f4xx.c
+++ b/hw/bsp/olimex_stm32-e407_devboard/src/system_stm32f4xx.c
@@ -65,7 +65,7 @@
 
 #include "bsp/stm32f4xx_hal_conf.h"
 #include "stm32f4xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 /**
   * @}
diff --git a/hw/bsp/puckjs/include/bsp/cmsis_nvic.h b/hw/bsp/puckjs/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/puckjs/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/rb-blend2/include/bsp/cmsis_nvic.h b/hw/bsp/rb-blend2/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/rb-blend2/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/rb-nano2/include/bsp/cmsis_nvic.h b/hw/bsp/rb-nano2/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/rb-nano2/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/ruuvi_tag_revb2/include/bsp/cmsis_nvic.h b/hw/bsp/ruuvi_tag_revb2/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/ruuvi_tag_revb2/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/sensorhub/include/bsp/cmsis_nvic.h b/hw/bsp/sensorhub/include/bsp/cmsis_nvic.h
deleted file mode 100644
index f61c10b..0000000
--- a/hw/bsp/sensorhub/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 90)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "stm32f4xx.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/sensorhub/src/system_stm32f4xx.c b/hw/bsp/sensorhub/src/system_stm32f4xx.c
index 8d39d6e..bbe2279 100644
--- a/hw/bsp/sensorhub/src/system_stm32f4xx.c
+++ b/hw/bsp/sensorhub/src/system_stm32f4xx.c
@@ -64,7 +64,7 @@
   */
 
 #include "stm32f4xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #if !defined  (HSE_VALUE) 
   #define HSE_VALUE    ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz */
diff --git a/hw/bsp/sensorhub/syscfg.yml b/hw/bsp/sensorhub/syscfg.yml
index 49da440..75996d2 100644
--- a/hw/bsp/sensorhub/syscfg.yml
+++ b/hw/bsp/sensorhub/syscfg.yml
@@ -31,3 +31,4 @@ syscfg.vals:
     NFFS_FLASH_AREA: FLASH_AREA_NFFS
     COREDUMP_FLASH_AREA: FLASH_AREA_IMAGE_1
     BOOT_SERIAL_DETECT_PIN: 16  # on Sensor Hub board BOOT0 is dedicated!
+    MCU_NVIC_PERIPH_VECTORS: 90
diff --git a/hw/bsp/stm32f3discovery/include/bsp/cmsis_nvic.h b/hw/bsp/stm32f3discovery/include/bsp/cmsis_nvic.h
deleted file mode 100644
index d3880eb..0000000
--- a/hw/bsp/stm32f3discovery/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef CMSIS_NVIC_H
-#define CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 81)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "stm32f303xc.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/stm32f3discovery/src/system_stm32f3xx.c b/hw/bsp/stm32f3discovery/src/system_stm32f3xx.c
index 1bcab6f..772d1db 100644
--- a/hw/bsp/stm32f3discovery/src/system_stm32f3xx.c
+++ b/hw/bsp/stm32f3discovery/src/system_stm32f3xx.c
@@ -84,7 +84,7 @@
   */
 
 #include "stm32f3xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 /**
   * @}
diff --git a/hw/bsp/stm32f429discovery/include/bsp/cmsis_nvic.h b/hw/bsp/stm32f429discovery/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 69f9b63..0000000
--- a/hw/bsp/stm32f429discovery/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 91)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "stm32f429xx.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/stm32f429discovery/src/hal_bsp.c b/hw/bsp/stm32f429discovery/src/hal_bsp.c
index 9c4586c..34bbdda 100644
--- a/hw/bsp/stm32f429discovery/src/hal_bsp.c
+++ b/hw/bsp/stm32f429discovery/src/hal_bsp.c
@@ -20,7 +20,7 @@
 
 #include <syscfg/syscfg.h>
 #include <bsp/bsp.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 #include <flash_map/flash_map.h>
 #include <os/os_dev.h>
 #include <stm32f429xx.h>
diff --git a/hw/bsp/stm32f429discovery/src/system_stm32f4xx.c b/hw/bsp/stm32f429discovery/src/system_stm32f4xx.c
index e8eff1a..afa44c1 100644
--- a/hw/bsp/stm32f429discovery/src/system_stm32f4xx.c
+++ b/hw/bsp/stm32f429discovery/src/system_stm32f4xx.c
@@ -64,7 +64,7 @@
   */
 
 #include "stm32f429xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #if !defined  (HSE_VALUE)
   #define HSE_VALUE    ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz */
diff --git a/hw/bsp/stm32f429discovery/syscfg.yml b/hw/bsp/stm32f429discovery/syscfg.yml
index 4c046e2..67e90d0 100644
--- a/hw/bsp/stm32f429discovery/syscfg.yml
+++ b/hw/bsp/stm32f429discovery/syscfg.yml
@@ -29,6 +29,7 @@ syscfg.defs:
         value: 1
 
 syscfg.vals:
+    MCU_NVIC_PERIPH_VECTORS: 91
     REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG
     CONFIG_FCB_FLASH_AREA: FLASH_AREA_NFFS
     NFFS_FLASH_AREA: FLASH_AREA_NFFS
diff --git a/hw/bsp/stm32f4discovery/include/bsp/cmsis_nvic.h b/hw/bsp/stm32f4discovery/include/bsp/cmsis_nvic.h
deleted file mode 100644
index d0c8b44..0000000
--- a/hw/bsp/stm32f4discovery/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 81)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "stm32f4xx.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/stm32f4discovery/src/system_stm32f4xx.c b/hw/bsp/stm32f4discovery/src/system_stm32f4xx.c
index ae68f72..a2fa9c5 100644
--- a/hw/bsp/stm32f4discovery/src/system_stm32f4xx.c
+++ b/hw/bsp/stm32f4discovery/src/system_stm32f4xx.c
@@ -64,7 +64,7 @@
   */
 
 #include "stm32f4xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #if !defined  (HSE_VALUE)
   #define HSE_VALUE    ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz */
diff --git a/hw/bsp/stm32f767-nucleo/src/system_stm32f7xx.c b/hw/bsp/stm32f767-nucleo/src/system_stm32f7xx.c
index 57bafcd..dbf98d6 100644
--- a/hw/bsp/stm32f767-nucleo/src/system_stm32f7xx.c
+++ b/hw/bsp/stm32f767-nucleo/src/system_stm32f7xx.c
@@ -64,7 +64,7 @@
   */
 
 #include "stm32f7xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #if !defined  (HSE_VALUE) 
   #define HSE_VALUE    ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */
diff --git a/hw/bsp/stm32f767-nucleo/syscfg.yml b/hw/bsp/stm32f767-nucleo/syscfg.yml
index fb083ed..79b6f88 100644
--- a/hw/bsp/stm32f767-nucleo/syscfg.yml
+++ b/hw/bsp/stm32f767-nucleo/syscfg.yml
@@ -36,6 +36,7 @@ syscfg.defs:
         value: 0
 
 syscfg.vals:
+    MCU_NVIC_PERIPH_VECTORS: 109
     REBOOT_LOG_FLASH_AREA: FLASH_AREA_REBOOT_LOG
     CONFIG_FCB_FLASH_AREA: FLASH_AREA_NFFS
     NFFS_FLASH_AREA: FLASH_AREA_NFFS
diff --git a/hw/bsp/stm32f7discovery/include/bsp/cmsis_nvic.h b/hw/bsp/stm32f7discovery/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 67fca59..0000000
--- a/hw/bsp/stm32f7discovery/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 98)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "stm32f7xx.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/stm32f7discovery/src/system_stm32f7xx.c b/hw/bsp/stm32f7discovery/src/system_stm32f7xx.c
index 8b404d1..7600d6c 100644
--- a/hw/bsp/stm32f7discovery/src/system_stm32f7xx.c
+++ b/hw/bsp/stm32f7discovery/src/system_stm32f7xx.c
@@ -69,7 +69,7 @@
 #include "stm32f7xx_hal_rcc.h"
 #include "stm32f7xx_hal_pwr.h"
 #include "stm32f7xx_hal_pwr_ex.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #if !defined  (HSE_VALUE)
   #define HSE_VALUE    ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */
diff --git a/hw/bsp/stm32l152discovery/src/system_stm32l1xx.c b/hw/bsp/stm32l152discovery/src/system_stm32l1xx.c
index 2928afc..a2e769a 100644
--- a/hw/bsp/stm32l152discovery/src/system_stm32l1xx.c
+++ b/hw/bsp/stm32l152discovery/src/system_stm32l1xx.c
@@ -61,7 +61,7 @@
   */
 
 #include "stm32l1xx.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 /**
   * @}
diff --git a/hw/bsp/telee02/include/bsp/cmsis_nvic.h b/hw/bsp/telee02/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/telee02/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/bsp/vbluno52/include/bsp/cmsis_nvic.h b/hw/bsp/vbluno52/include/bsp/cmsis_nvic.h
deleted file mode 100644
index 856f7d0..0000000
--- a/hw/bsp/vbluno52/include/bsp/cmsis_nvic.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* mbed Microcontroller Library - cmsis_nvic
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-
-#ifndef MBED_CMSIS_NVIC_H
-#define MBED_CMSIS_NVIC_H
-
-#include <stdint.h>
-
-#define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
-#define NVIC_USER_IRQ_OFFSET  16
-
-#include "nrf52.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void NVIC_Relocate(void);
-void NVIC_SetVector(IRQn_Type IRQn, uint32_t vector);
-uint32_t NVIC_GetVector(IRQn_Type IRQn);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/hw/cmsis-core/src/cmsis_nvic.c b/hw/cmsis-core/src/cmsis_nvic.c
index a350791..4bf7724 100644
--- a/hw/cmsis-core/src/cmsis_nvic.c
+++ b/hw/cmsis-core/src/cmsis_nvic.c
@@ -3,7 +3,7 @@
  *
  * CMSIS-style functionality to support dynamic vectors
  */
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #ifndef __CORTEX_M
     #error "Macro __CORTEX_M not defined; must define cortex-m type!"
diff --git a/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c b/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c
index 40483f0..222d926 100644
--- a/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c
+++ b/hw/drivers/adc/adc_nrf51/src/adc_nrf51.c
@@ -20,7 +20,7 @@
 #include <adc/adc.h>
 #include <assert.h>
 #include <os/os.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 
 /* Nordic headers */
 #include <nrfx.h>
diff --git a/hw/drivers/adc/adc_nrf52/src/adc_nrf52.c b/hw/drivers/adc/adc_nrf52/src/adc_nrf52.c
index ffefa55..c6f7851 100644
--- a/hw/drivers/adc/adc_nrf52/src/adc_nrf52.c
+++ b/hw/drivers/adc/adc_nrf52/src/adc_nrf52.c
@@ -22,7 +22,7 @@
 #include <adc/adc.h>
 #include <assert.h>
 #include <os/os.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 
 /* Nordic headers */
 #include <nrfx.h>
diff --git a/hw/drivers/adc/adc_stm32f4/src/adc_stm32f4.c b/hw/drivers/adc/adc_stm32f4/src/adc_stm32f4.c
index 5ef60bd..c55e811 100644
--- a/hw/drivers/adc/adc_stm32f4/src/adc_stm32f4.c
+++ b/hw/drivers/adc/adc_stm32f4/src/adc_stm32f4.c
@@ -21,7 +21,7 @@
 #include <hal/hal_bsp.h>
 #include <assert.h>
 #include <os/os.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 #include "stm32f4xx_hal_dma.h"
 #include "stm32f4xx_hal_adc.h"
 #include "stm32f4xx_hal_rcc.h"
diff --git a/hw/drivers/lwip/stm32_eth/src/stm32_eth.c b/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
index f63b220..b295b23 100755
--- a/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
+++ b/hw/drivers/lwip/stm32_eth/src/stm32_eth.c
@@ -21,7 +21,7 @@
 
 #include <hal/hal_gpio.h>
 #include <hal/hal_timer.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 
 #include <os/os_cputime.h>
 
diff --git a/hw/drivers/nimble/nrf51/src/ble_hw.c b/hw/drivers/nimble/nrf51/src/ble_hw.c
index e9b5040..5c30275 100644
--- a/hw/drivers/nimble/nrf51/src/ble_hw.c
+++ b/hw/drivers/nimble/nrf51/src/ble_hw.c
@@ -27,7 +27,7 @@
 #include "nimble/nimble_opt.h"
 #include "nrf51_bitfields.h"
 #include "controller/ble_hw.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 /* Total number of resolving list elements */
 #define BLE_HW_RESOLV_LIST_SIZE     (16)
diff --git a/hw/drivers/nimble/nrf51/src/ble_phy.c b/hw/drivers/nimble/nrf51/src/ble_phy.c
index e22257b..ba51308 100644
--- a/hw/drivers/nimble/nrf51/src/ble_phy.c
+++ b/hw/drivers/nimble/nrf51/src/ble_phy.c
@@ -23,7 +23,7 @@
 #include "syscfg/syscfg.h"
 #include "os/os.h"
 #include "ble/xcvr.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "nimble/ble.h"
 #include "nimble/nimble_opt.h"
 #include "controller/ble_phy.h"
diff --git a/hw/drivers/nimble/nrf52/src/ble_hw.c b/hw/drivers/nimble/nrf52/src/ble_hw.c
index e63ba52..57d1402 100644
--- a/hw/drivers/nimble/nrf52/src/ble_hw.c
+++ b/hw/drivers/nimble/nrf52/src/ble_hw.c
@@ -27,7 +27,7 @@
 #include "nimble/nimble_opt.h"
 #include "nrf52_bitfields.h"
 #include "controller/ble_hw.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "os/os_trace_api.h"
 
 /* Total number of resolving list elements */
diff --git a/hw/drivers/nimble/nrf52/src/ble_phy.c b/hw/drivers/nimble/nrf52/src/ble_phy.c
index 8590929..7f478b6 100644
--- a/hw/drivers/nimble/nrf52/src/ble_phy.c
+++ b/hw/drivers/nimble/nrf52/src/ble_phy.c
@@ -23,7 +23,7 @@
 #include "syscfg/syscfg.h"
 #include "os/os.h"
 #include "ble/xcvr.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "hal/hal_gpio.h"
 #include "nimble/ble.h"
 #include "nimble/nimble_opt.h"
diff --git a/hw/bsp/apollo2_evb/include/bsp/cmsis_nvic.h b/hw/mcu/ambiq/apollo2/include/mcu/cmsis_nvic.h
similarity index 100%
rename from hw/bsp/apollo2_evb/include/bsp/cmsis_nvic.h
rename to hw/mcu/ambiq/apollo2/include/mcu/cmsis_nvic.h
diff --git a/hw/mcu/ambiq/apollo2/src/hal_gpio.c b/hw/mcu/ambiq/apollo2/src/hal_gpio.c
index 8e70bb6..874ab8e 100644
--- a/hw/mcu/ambiq/apollo2/src/hal_gpio.c
+++ b/hw/mcu/ambiq/apollo2/src/hal_gpio.c
@@ -21,7 +21,7 @@
 #include <os/os.h>
 #include "hal/hal_gpio.h"
 #include "mcu/apollo2.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "os/os_trace_api.h"
 #include "defs/error.h"
 #include "am_mcu_apollo.h"
diff --git a/hw/mcu/ambiq/apollo2/src/hal_os_tick.c b/hw/mcu/ambiq/apollo2/src/hal_os_tick.c
index 5d376a8..1e988be 100644
--- a/hw/mcu/ambiq/apollo2/src/hal_os_tick.c
+++ b/hw/mcu/ambiq/apollo2/src/hal_os_tick.c
@@ -30,7 +30,7 @@
 #include <os/os.h>
 #include "mcu/system_apollo2.h"
 #include "hal/hal_os_tick.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #include "am_mcu_apollo.h"
 
diff --git a/hw/mcu/ambiq/apollo2/src/hal_spi.c b/hw/mcu/ambiq/apollo2/src/hal_spi.c
index d2f9bb9..cf4edd7 100644
--- a/hw/mcu/ambiq/apollo2/src/hal_spi.c
+++ b/hw/mcu/ambiq/apollo2/src/hal_spi.c
@@ -23,7 +23,7 @@
 #include "syscfg/syscfg.h"
 #include "hal/hal_spi.h"
 #include "mcu/hal_apollo2.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "defs/error.h"
 
 #include "am_mcu_apollo.h"
diff --git a/hw/mcu/ambiq/apollo2/src/hal_timer.c b/hw/mcu/ambiq/apollo2/src/hal_timer.c
index c0fbe16..c953a50 100644
--- a/hw/mcu/ambiq/apollo2/src/hal_timer.c
+++ b/hw/mcu/ambiq/apollo2/src/hal_timer.c
@@ -23,7 +23,7 @@
 
 #include "syscfg/syscfg.h"
 #include "os/os.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "mcu/hal_apollo2.h"
 #include "hal/hal_timer.h"
 #include "defs/error.h"
diff --git a/hw/mcu/ambiq/apollo2/src/hal_uart.c b/hw/mcu/ambiq/apollo2/src/hal_uart.c
index fe23845..84299ad 100644
--- a/hw/mcu/ambiq/apollo2/src/hal_uart.c
+++ b/hw/mcu/ambiq/apollo2/src/hal_uart.c
@@ -22,7 +22,7 @@
 #include "mcu/hal_apollo2.h"
 #include "defs/error.h"
 #include "hal/hal_uart.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
 #include "os/os_trace_api.h"
 
diff --git a/hw/bsp/vbluno51/include/bsp/cmsis_nvic.h b/hw/mcu/nordic/nrf51xxx/include/mcu/cmsis_nvic.h
similarity index 100%
rename from hw/bsp/vbluno51/include/bsp/cmsis_nvic.h
rename to hw/mcu/nordic/nrf51xxx/include/mcu/cmsis_nvic.h
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_gpio.c b/hw/mcu/nordic/nrf51xxx/src/hal_gpio.c
index 20889c4..fd5b2ed 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_gpio.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_gpio.c
@@ -18,7 +18,7 @@
  */
 
 #include "hal/hal_gpio.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "nrf51.h"
 #include "nrf51_bitfields.h"
 #include <assert.h>
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_os_tick.c b/hw/mcu/nordic/nrf51xxx/src/hal_os_tick.c
index 99fc388..1e07521 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_os_tick.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_os_tick.c
@@ -21,7 +21,7 @@
 #include "syscfg/syscfg.h"
 #include <hal/hal_os_tick.h>
 #include <hal/hal_system.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 #include <nrf51.h>
 #include <nrf51_bitfields.h>
 #include <mcu/nrf51_hal.h>
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_spi.c b/hw/mcu/nordic/nrf51xxx/src/hal_spi.c
index ab88ae3..45d6751 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_spi.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_spi.c
@@ -23,7 +23,7 @@
 #include <errno.h>
 #include <assert.h>
 #include <hal/hal_spi.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 #include "mcu/nrf51_hal.h"
 #include "nrf51_bitfields.h"
 
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_timer.c b/hw/mcu/nordic/nrf51xxx/src/hal_timer.c
index de5a117..d6b7b33 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_timer.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_timer.c
@@ -22,7 +22,7 @@
 #include <assert.h>
 #include <errno.h>
 #include "syscfg/syscfg.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "hal/hal_timer.h"
 #include "nrf51.h"
 #include "nrf51_bitfields.h"
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_uart.c b/hw/mcu/nordic/nrf51xxx/src/hal_uart.c
index 32d3bb6..636d49e 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_uart.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_uart.c
@@ -18,7 +18,7 @@
  */
 
 #include "hal/hal_uart.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
 
 #include "nrf.h"
diff --git a/hw/mcu/nordic/nrf51xxx/src/hal_watchdog.c b/hw/mcu/nordic/nrf51xxx/src/hal_watchdog.c
index 527712f..d677792 100644
--- a/hw/mcu/nordic/nrf51xxx/src/hal_watchdog.c
+++ b/hw/mcu/nordic/nrf51xxx/src/hal_watchdog.c
@@ -19,7 +19,7 @@
 
 #include <assert.h>
 #include "hal/hal_watchdog.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "nrf51.h"
 #include "nrf51_bitfields.h"
 
diff --git a/hw/mcu/nordic/nrf51xxx/src/system_nrf51.c b/hw/mcu/nordic/nrf51xxx/src/system_nrf51.c
index 63f775c..c63165a 100755
--- a/hw/mcu/nordic/nrf51xxx/src/system_nrf51.c
+++ b/hw/mcu/nordic/nrf51xxx/src/system_nrf51.c
@@ -30,7 +30,7 @@
 
 #include <stdint.h>
 #include <stdbool.h>
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "nrf.h"
 #include "system_nrf51.h"
 
diff --git a/hw/bsp/bmd300eval/include/bsp/cmsis_nvic.h b/hw/mcu/nordic/nrf52xxx/include/mcu/cmsis_nvic.h
similarity index 93%
rename from hw/bsp/bmd300eval/include/bsp/cmsis_nvic.h
rename to hw/mcu/nordic/nrf52xxx/include/mcu/cmsis_nvic.h
index 856f7d0..7f0a9f1 100644
--- a/hw/bsp/bmd300eval/include/bsp/cmsis_nvic.h
+++ b/hw/mcu/nordic/nrf52xxx/include/mcu/cmsis_nvic.h
@@ -8,11 +8,12 @@
 #define MBED_CMSIS_NVIC_H
 
 #include <stdint.h>
+#include <bsp/bsp.h>
 
 #define NVIC_NUM_VECTORS      (16 + 38)   // CORE + MCU Peripherals
 #define NVIC_USER_IRQ_OFFSET  16
 
-#include "nrf52.h"
+#include "nrf.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c b/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c
index fa98cdf..329aab6 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_gpio.c
@@ -18,7 +18,7 @@
  */
 
 #include "hal/hal_gpio.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "os/os_trace_api.h"
 #include <stdlib.h>
 #include "nrf.h"
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c b/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c
index 4f0edea..1be21e8 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_os_tick.c
@@ -22,7 +22,7 @@
 #include "syscfg/syscfg.h"
 #include "hal/hal_os_tick.h"
 #include "nrf.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 /* The OS scheduler requires a low-frequency timer. */
 #if MYNEWT_VAL(OS_SCHEDULING)       && \
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_spi.c b/hw/mcu/nordic/nrf52xxx/src/hal_spi.c
index 62cc7da..9e46e1b 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_spi.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_spi.c
@@ -20,7 +20,7 @@
 #include <errno.h>
 #include <assert.h>
 #include <syscfg/syscfg.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 #include <hal/hal_spi.h>
 #include "os/os_trace_api.h"
 #include "mcu/nrf52_hal.h"
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_timer.c b/hw/mcu/nordic/nrf52xxx/src/hal_timer.c
index 8f29197..0fb926d 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_timer.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_timer.c
@@ -22,7 +22,7 @@
 #include <assert.h>
 #include <errno.h>
 #include "syscfg/syscfg.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "hal/hal_timer.h"
 #include "os/os_trace_api.h"
 #include "nrf.h"
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_uart.c b/hw/mcu/nordic/nrf52xxx/src/hal_uart.c
index 478f658..688c171 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_uart.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_uart.c
@@ -18,7 +18,7 @@
  */
 
 #include "hal/hal_uart.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
 
 #include "nrf.h"
diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_watchdog.c b/hw/mcu/nordic/nrf52xxx/src/hal_watchdog.c
index ba06bb6..7dc373a 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_watchdog.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_watchdog.c
@@ -19,7 +19,7 @@
 
 #include <assert.h>
 #include "hal/hal_watchdog.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "os/os_trace_api.h"
 #include "nrf.h"
 
diff --git a/hw/mcu/nordic/nrf52xxx/src/system_nrf52.c b/hw/mcu/nordic/nrf52xxx/src/system_nrf52.c
index 424fc35..a813f3b 100644
--- a/hw/mcu/nordic/nrf52xxx/src/system_nrf52.c
+++ b/hw/mcu/nordic/nrf52xxx/src/system_nrf52.c
@@ -30,7 +30,7 @@
 
 #include <stdint.h>
 #include <stdbool.h>
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "nrf.h"
 
 #ifdef NRF52840_XXAA
diff --git a/hw/bsp/frdm-k64f/include/bsp/cmsis_nvic.h b/hw/mcu/nxp/MK64F12/include/mcu/cmsis_nvic.h
similarity index 100%
rename from hw/bsp/frdm-k64f/include/bsp/cmsis_nvic.h
rename to hw/mcu/nxp/MK64F12/include/mcu/cmsis_nvic.h
diff --git a/hw/mcu/nxp/MK64F12/src/hal_gpio.c b/hw/mcu/nxp/MK64F12/src/hal_gpio.c
index 93229a9..713d2f0 100644
--- a/hw/mcu/nxp/MK64F12/src/hal_gpio.c
+++ b/hw/mcu/nxp/MK64F12/src/hal_gpio.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 #include "hal/hal_gpio.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include <stdlib.h>
 #include <assert.h>
 
diff --git a/hw/mcu/nxp/MK64F12/src/hal_os_tick.c b/hw/mcu/nxp/MK64F12/src/hal_os_tick.c
index 4760d60..93b1ee6 100644
--- a/hw/mcu/nxp/MK64F12/src/hal_os_tick.c
+++ b/hw/mcu/nxp/MK64F12/src/hal_os_tick.c
@@ -22,7 +22,7 @@
 #include <os/os.h>
 #include <hal/hal_os_tick.h>
 
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #include "fsl_pit.h"
 
diff --git a/hw/mcu/nxp/MK64F12/src/hal_uart.c b/hw/mcu/nxp/MK64F12/src/hal_uart.c
index a4dcd14..a64a26c 100644
--- a/hw/mcu/nxp/MK64F12/src/hal_uart.c
+++ b/hw/mcu/nxp/MK64F12/src/hal_uart.c
@@ -21,7 +21,7 @@
 #include "hal/hal_uart.h"
 #include "hal/hal_gpio.h"
 #include "hal/hal_system.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
 #include "os/os.h"
 
diff --git a/hw/mcu/nxp/MK64F12/src/hal_watchdog.c b/hw/mcu/nxp/MK64F12/src/hal_watchdog.c
index ed5196f..37d0afe 100644
--- a/hw/mcu/nxp/MK64F12/src/hal_watchdog.c
+++ b/hw/mcu/nxp/MK64F12/src/hal_watchdog.c
@@ -18,7 +18,7 @@
  */
 
 #include "hal/hal_watchdog.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #include <assert.h>
 
diff --git a/hw/bsp/usbmkw41z/include/bsp/cmsis_nvic.h b/hw/mcu/nxp/mkw41z/include/mcu/cmsis_nvic.h
similarity index 100%
rename from hw/bsp/usbmkw41z/include/bsp/cmsis_nvic.h
rename to hw/mcu/nxp/mkw41z/include/mcu/cmsis_nvic.h
diff --git a/hw/mcu/nxp/mkw41z/src/hal_gpio.c b/hw/mcu/nxp/mkw41z/src/hal_gpio.c
index 290bb49..6bb9d31 100644
--- a/hw/mcu/nxp/mkw41z/src/hal_gpio.c
+++ b/hw/mcu/nxp/mkw41z/src/hal_gpio.c
@@ -19,7 +19,7 @@
 
 #include <assert.h>
 #include "hal/hal_gpio.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 /**
  * gpio init in
diff --git a/hw/mcu/nxp/mkw41z/src/hal_os_tick.c b/hw/mcu/nxp/mkw41z/src/hal_os_tick.c
index 502cbb3..ff368bd 100644
--- a/hw/mcu/nxp/mkw41z/src/hal_os_tick.c
+++ b/hw/mcu/nxp/mkw41z/src/hal_os_tick.c
@@ -20,7 +20,7 @@
 #include <os/os.h>
 #include "syscfg/syscfg.h"
 #include <hal/hal_os_tick.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 //#include <mkw41z4.h>
 #include <mcu/mkw41z_hal.h>
 
diff --git a/hw/mcu/nxp/mkw41z/src/hal_watchdog.c b/hw/mcu/nxp/mkw41z/src/hal_watchdog.c
index c41ab64..afda40e 100644
--- a/hw/mcu/nxp/mkw41z/src/hal_watchdog.c
+++ b/hw/mcu/nxp/mkw41z/src/hal_watchdog.c
@@ -19,7 +19,7 @@
 
 #include <assert.h>
 #include "hal/hal_watchdog.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 int
 hal_watchdog_init(uint32_t expire_msecs)
diff --git a/hw/mcu/nxp/mkw41z/src/system_MKW41Z4.c b/hw/mcu/nxp/mkw41z/src/system_MKW41Z4.c
index 5e7b243..77d87b9 100644
--- a/hw/mcu/nxp/mkw41z/src/system_MKW41Z4.c
+++ b/hw/mcu/nxp/mkw41z/src/system_MKW41Z4.c
@@ -67,7 +67,7 @@
 
 #include <stdint.h>
 #include "mcu/fsl_device_registers.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 /* ----------------------------------------------------------------------------
    -- Core clock
diff --git a/hw/bsp/olimex-p103/include/bsp/cmsis_nvic.h b/hw/mcu/stm/stm32f1xx/include/mcu/cmsis_nvic.h
similarity index 100%
rename from hw/bsp/olimex-p103/include/bsp/cmsis_nvic.h
rename to hw/mcu/stm/stm32f1xx/include/mcu/cmsis_nvic.h
diff --git a/hw/mcu/stm/stm32f1xx/src/hal_gpio.c b/hw/mcu/stm/stm32f1xx/src/hal_gpio.c
index 446d04c..b0be4d5 100644
--- a/hw/mcu/stm/stm32f1xx/src/hal_gpio.c
+++ b/hw/mcu/stm/stm32f1xx/src/hal_gpio.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "hal/hal_gpio.h"
 #include "stm32f1xx.h"
 #include "stm32f1xx_hal_gpio.h"
diff --git a/hw/mcu/stm/stm32f1xx/src/hal_spi.c b/hw/mcu/stm/stm32f1xx/src/hal_spi.c
index f6e3364..4410060 100644
--- a/hw/mcu/stm/stm32f1xx/src/hal_spi.c
+++ b/hw/mcu/stm/stm32f1xx/src/hal_spi.c
@@ -36,7 +36,7 @@
 #include "stm32l1xx_hal_rcc.h"
 #include "mcu/stm32l1xx_mynewt_hal.h"
 #include "mcu/stm32l1_bsp.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #define STM32L1_HAL_SPI_TIMEOUT (1000)
 
diff --git a/hw/mcu/stm/stm32f1xx/src/hal_timer.c b/hw/mcu/stm/stm32f1xx/src/hal_timer.c
index e0e1a54..1e79d0a 100644
--- a/hw/mcu/stm/stm32f1xx/src/hal_timer.c
+++ b/hw/mcu/stm/stm32f1xx/src/hal_timer.c
@@ -23,7 +23,7 @@
 
 #include <syscfg/syscfg.h>
 
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 #include <os/queue.h>
 #include <hal/hal_timer.h>
 
diff --git a/hw/mcu/stm/stm32f1xx/src/hal_uart.c b/hw/mcu/stm/stm32f1xx/src/hal_uart.c
index 8c6b522..b0abfb5 100644
--- a/hw/mcu/stm/stm32f1xx/src/hal_uart.c
+++ b/hw/mcu/stm/stm32f1xx/src/hal_uart.c
@@ -19,7 +19,7 @@
 
 #include "hal/hal_uart.h"
 #include "hal/hal_gpio.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
 #include "stm32f1xx.h"
 #include "stm32f1xx_hal_dma.h"
diff --git a/hw/bsp/nucleo-f303k8/include/bsp/cmsis_nvic.h b/hw/mcu/stm/stm32f3xx/include/mcu/cmsis_nvic.h
similarity index 98%
rename from hw/bsp/nucleo-f303k8/include/bsp/cmsis_nvic.h
rename to hw/mcu/stm/stm32f3xx/include/mcu/cmsis_nvic.h
index de6c1f6..df47262 100644
--- a/hw/bsp/nucleo-f303k8/include/bsp/cmsis_nvic.h
+++ b/hw/mcu/stm/stm32f3xx/include/mcu/cmsis_nvic.h
@@ -31,7 +31,7 @@
 #define NVIC_NUM_VECTORS      (16 + 81)   // CORE + MCU Peripherals
 #define NVIC_USER_IRQ_OFFSET  16
 
-#include "stm32f303x8.h"
+#include "stm32f3xx.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/hw/mcu/stm/stm32f3xx/src/hal_gpio.c b/hw/mcu/stm/stm32f3xx/src/hal_gpio.c
index 020e769..d63d29a 100644
--- a/hw/mcu/stm/stm32f3xx/src/hal_gpio.c
+++ b/hw/mcu/stm/stm32f3xx/src/hal_gpio.c
@@ -25,7 +25,7 @@
 
 #include "hal_gpio_stm32.h"
 #include "hal/hal_gpio.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "stm32f3xx.h"
 #include "stm32f3xx_hal_cortex.h"
 #include "stm32f3xx_hal_gpio.h"
diff --git a/hw/mcu/stm/stm32f3xx/src/hal_timer.c b/hw/mcu/stm/stm32f3xx/src/hal_timer.c
index 7485784..a1afa98 100644
--- a/hw/mcu/stm/stm32f3xx/src/hal_timer.c
+++ b/hw/mcu/stm/stm32f3xx/src/hal_timer.c
@@ -23,7 +23,7 @@
 
 #include <syscfg/syscfg.h>
 
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 #include <os/queue.h>
 #include <hal/hal_timer.h>
 
diff --git a/hw/mcu/stm/stm32f3xx/src/hal_uart.c b/hw/mcu/stm/stm32f3xx/src/hal_uart.c
index 4ba9278..ebd89f0 100644
--- a/hw/mcu/stm/stm32f3xx/src/hal_uart.c
+++ b/hw/mcu/stm/stm32f3xx/src/hal_uart.c
@@ -19,7 +19,7 @@
 
 #include "hal/hal_uart.h"
 #include "hal/hal_gpio.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
 #include "stm32f3xx.h"
 #include "stm32f3xx_hal_dma.h"
diff --git a/hw/bsp/nucleo-f401re/include/bsp/cmsis_nvic.h b/hw/mcu/stm/stm32f4xx/include/mcu/cmsis_nvic.h
similarity index 70%
rename from hw/bsp/nucleo-f401re/include/bsp/cmsis_nvic.h
rename to hw/mcu/stm/stm32f4xx/include/mcu/cmsis_nvic.h
index d0c8b44..ffe200f 100644
--- a/hw/bsp/nucleo-f401re/include/bsp/cmsis_nvic.h
+++ b/hw/mcu/stm/stm32f4xx/include/mcu/cmsis_nvic.h
@@ -8,9 +8,14 @@
 #define MBED_CMSIS_NVIC_H
 
 #include <stdint.h>
+#include <syscfg/syscfg.h>
+
+#if MYNEWT_VAL(MCU_NVIC_PERIPH_VECTORS) < 16
+#error "Too few peripheral IRQ vectors, incorrect config?"
+#endif
 
-#define NVIC_NUM_VECTORS      (16 + 81)   // CORE + MCU Peripherals
 #define NVIC_USER_IRQ_OFFSET  16
+#define NVIC_NUM_VECTORS      (16 + MYNEWT_VAL(MCU_NVIC_PERIPH_VECTORS))
 
 #include "stm32f4xx.h"
 
diff --git a/hw/mcu/stm/stm32f4xx/src/hal_gpio.c b/hw/mcu/stm/stm32f4xx/src/hal_gpio.c
index 5aac030..4926683 100644
--- a/hw/mcu/stm/stm32f4xx/src/hal_gpio.c
+++ b/hw/mcu/stm/stm32f4xx/src/hal_gpio.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "hal/hal_gpio.h"
 #include "stm32f4xx.h"
 #include "stm32f4xx_hal_gpio.h"
diff --git a/hw/mcu/stm/stm32f4xx/src/hal_spi.c b/hw/mcu/stm/stm32f4xx/src/hal_spi.c
index d5a1e40..5413c08 100644
--- a/hw/mcu/stm/stm32f4xx/src/hal_spi.c
+++ b/hw/mcu/stm/stm32f4xx/src/hal_spi.c
@@ -34,7 +34,7 @@
 #include "stm32f4xx_hal_rcc.h"
 #include "mcu/stm32f4xx_mynewt_hal.h"
 #include "mcu/stm32f4_bsp.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #define SPI_0_ENABLED (MYNEWT_VAL(SPI_0_MASTER) || MYNEWT_VAL(SPI_0_SLAVE))
 #define SPI_1_ENABLED (MYNEWT_VAL(SPI_1_MASTER) || MYNEWT_VAL(SPI_1_SLAVE))
diff --git a/hw/mcu/stm/stm32f4xx/src/hal_timer.c b/hw/mcu/stm/stm32f4xx/src/hal_timer.c
index 5f9fcac..3fe70cb 100644
--- a/hw/mcu/stm/stm32f4xx/src/hal_timer.c
+++ b/hw/mcu/stm/stm32f4xx/src/hal_timer.c
@@ -23,7 +23,7 @@
 
 #include <syscfg/syscfg.h>
 
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 #include <os/queue.h>
 #include <hal/hal_timer.h>
 
diff --git a/hw/mcu/stm/stm32f4xx/src/hal_uart.c b/hw/mcu/stm/stm32f4xx/src/hal_uart.c
index ccc95df..1c684ef 100644
--- a/hw/mcu/stm/stm32f4xx/src/hal_uart.c
+++ b/hw/mcu/stm/stm32f4xx/src/hal_uart.c
@@ -19,7 +19,7 @@
 
 #include "hal/hal_uart.h"
 #include "hal/hal_gpio.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
 #include "stm32f4xx.h"
 #include "stm32f4xx_hal_dma.h"
diff --git a/hw/mcu/stm/stm32f4xx/syscfg.yml b/hw/mcu/stm/stm32f4xx/syscfg.yml
index db33de7..d2a0c74 100644
--- a/hw/mcu/stm/stm32f4xx/syscfg.yml
+++ b/hw/mcu/stm/stm32f4xx/syscfg.yml
@@ -33,6 +33,10 @@ syscfg.defs:
         description: MCUs are of STM32F4xx family
         value: 1
 
+    MCU_NVIC_PERIPH_VECTORS:
+        description: Number of peripheral IRQ vectors in the model
+        value: 81
+
     SPI_0_MASTER:
         description: 'SPI 0 master'
         value:  0
diff --git a/hw/bsp/stm32f767-nucleo/include/bsp/cmsis_nvic.h b/hw/mcu/stm/stm32f7xx/include/mcu/cmsis_nvic.h
similarity index 70%
rename from hw/bsp/stm32f767-nucleo/include/bsp/cmsis_nvic.h
rename to hw/mcu/stm/stm32f7xx/include/mcu/cmsis_nvic.h
index 5558988..7d7d69a 100644
--- a/hw/bsp/stm32f767-nucleo/include/bsp/cmsis_nvic.h
+++ b/hw/mcu/stm/stm32f7xx/include/mcu/cmsis_nvic.h
@@ -8,9 +8,14 @@
 #define MBED_CMSIS_NVIC_H
 
 #include <stdint.h>
+#include <syscfg/syscfg.h>
+
+#if MYNEWT_VAL(MCU_NVIC_PERIPH_VECTORS) < 16
+#error "Too few peripheral IRQ vectors, incorrect config?"
+#endif
 
-#define NVIC_NUM_VECTORS      (16 + 109)   // CORE + MCU Peripherals
 #define NVIC_USER_IRQ_OFFSET  16
+#define NVIC_NUM_VECTORS      (16 + MYNEWT_VAL(MCU_NVIC_PERIPH_VECTORS))
 
 #include "stm32f7xx.h"
 
diff --git a/hw/mcu/stm/stm32f7xx/src/hal_gpio.c b/hw/mcu/stm/stm32f7xx/src/hal_gpio.c
index ee36467..5d58137 100644
--- a/hw/mcu/stm/stm32f7xx/src/hal_gpio.c
+++ b/hw/mcu/stm/stm32f7xx/src/hal_gpio.c
@@ -18,7 +18,7 @@
  */
 
 #include "hal/hal_gpio.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "stm32f7xx.h"
 #include "stm32f7xx_hal_gpio.h"
 #include "stm32f7xx_hal_rcc.h"
diff --git a/hw/mcu/stm/stm32f7xx/src/hal_timer.c b/hw/mcu/stm/stm32f7xx/src/hal_timer.c
index 7888864..a47390c 100644
--- a/hw/mcu/stm/stm32f7xx/src/hal_timer.c
+++ b/hw/mcu/stm/stm32f7xx/src/hal_timer.c
@@ -23,7 +23,7 @@
 
 #include <syscfg/syscfg.h>
 
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 #include <os/queue.h>
 #include <hal/hal_timer.h>
 
diff --git a/hw/mcu/stm/stm32f7xx/src/hal_uart.c b/hw/mcu/stm/stm32f7xx/src/hal_uart.c
index fbbab6f..ab87309 100644
--- a/hw/mcu/stm/stm32f7xx/src/hal_uart.c
+++ b/hw/mcu/stm/stm32f7xx/src/hal_uart.c
@@ -19,7 +19,7 @@
 
 #include "hal/hal_uart.h"
 #include "hal/hal_gpio.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
 #include "stm32f7xx.h"
 #include "stm32f7xx_hal_dma.h"
diff --git a/hw/mcu/stm/stm32f7xx/syscfg.yml b/hw/mcu/stm/stm32f7xx/syscfg.yml
index cf82e27..3f1a73f 100644
--- a/hw/mcu/stm/stm32f7xx/syscfg.yml
+++ b/hw/mcu/stm/stm32f7xx/syscfg.yml
@@ -26,3 +26,7 @@ syscfg.defs:
     MCU_STM32F7:
         description: MCUs are of STM32F7xx family
         value: 1
+
+    MCU_NVIC_PERIPH_VECTORS:
+        description: Number of peripheral IRQ vectors in the model
+        value: 98
diff --git a/hw/bsp/stm32l152discovery/include/bsp/cmsis_nvic.h b/hw/mcu/stm/stm32l1xx/include/mcu/cmsis_nvic.h
similarity index 100%
rename from hw/bsp/stm32l152discovery/include/bsp/cmsis_nvic.h
rename to hw/mcu/stm/stm32l1xx/include/mcu/cmsis_nvic.h
diff --git a/hw/mcu/stm/stm32l1xx/src/hal_gpio.c b/hw/mcu/stm/stm32l1xx/src/hal_gpio.c
index 37fee2b..6b667c1 100644
--- a/hw/mcu/stm/stm32l1xx/src/hal_gpio.c
+++ b/hw/mcu/stm/stm32l1xx/src/hal_gpio.c
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "hal/hal_gpio.h"
 #include "stm32l1xx.h"
 #include "stm32l1xx_hal_gpio.h"
diff --git a/hw/mcu/stm/stm32l1xx/src/hal_spi.c b/hw/mcu/stm/stm32l1xx/src/hal_spi.c
index 58cc9d5..f7a894e 100644
--- a/hw/mcu/stm/stm32l1xx/src/hal_spi.c
+++ b/hw/mcu/stm/stm32l1xx/src/hal_spi.c
@@ -34,7 +34,7 @@
 #include "stm32l1xx_hal_rcc.h"
 #include "mcu/stm32l1xx_mynewt_hal.h"
 #include "mcu/stm32l1_bsp.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 
 #define STM32L1_HAL_SPI_TIMEOUT (1000)
 
diff --git a/hw/mcu/stm/stm32l1xx/src/hal_timer.c b/hw/mcu/stm/stm32l1xx/src/hal_timer.c
index 7636b9e..54930c0 100644
--- a/hw/mcu/stm/stm32l1xx/src/hal_timer.c
+++ b/hw/mcu/stm/stm32l1xx/src/hal_timer.c
@@ -23,7 +23,7 @@
 
 #include <syscfg/syscfg.h>
 
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 #include <os/queue.h>
 #include <hal/hal_timer.h>
 
diff --git a/hw/mcu/stm/stm32l1xx/src/hal_uart.c b/hw/mcu/stm/stm32l1xx/src/hal_uart.c
index c94187c..09eaad5 100644
--- a/hw/mcu/stm/stm32l1xx/src/hal_uart.c
+++ b/hw/mcu/stm/stm32l1xx/src/hal_uart.c
@@ -19,7 +19,7 @@
 
 #include "hal/hal_uart.h"
 #include "hal/hal_gpio.h"
-#include "bsp/cmsis_nvic.h"
+#include "mcu/cmsis_nvic.h"
 #include "bsp/bsp.h"
 #include "stm32l1xx.h"
 #include "stm32l1xx_hal_dma.h"
diff --git a/kernel/os/src/arch/cortex_m0/os_arch_arm.c b/kernel/os/src/arch/cortex_m0/os_arch_arm.c
index 1c6400b..29c2315 100755
--- a/kernel/os/src/arch/cortex_m0/os_arch_arm.c
+++ b/kernel/os/src/arch/cortex_m0/os_arch_arm.c
@@ -21,7 +21,7 @@
 #include "os/os_arch.h"
 #include <hal/hal_bsp.h>
 #include <hal/hal_os_tick.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 
 #include "os_priv.h"
 
diff --git a/kernel/os/src/arch/cortex_m3/os_arch_arm.c b/kernel/os/src/arch/cortex_m3/os_arch_arm.c
index 7bb44a6..088e57f 100755
--- a/kernel/os/src/arch/cortex_m3/os_arch_arm.c
+++ b/kernel/os/src/arch/cortex_m3/os_arch_arm.c
@@ -22,7 +22,7 @@
 #include "os/os_arch.h"
 #include <hal/hal_bsp.h>
 #include <hal/hal_os_tick.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 
 #include "mcu/mcu.h"
 
diff --git a/kernel/os/src/arch/cortex_m4/os_arch_arm.c b/kernel/os/src/arch/cortex_m4/os_arch_arm.c
index c914cae..1ccb3a6 100755
--- a/kernel/os/src/arch/cortex_m4/os_arch_arm.c
+++ b/kernel/os/src/arch/cortex_m4/os_arch_arm.c
@@ -22,7 +22,7 @@
 #include "os/os_arch.h"
 #include <hal/hal_bsp.h>
 #include <hal/hal_os_tick.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 
 #include "os_priv.h"
 
diff --git a/kernel/os/src/arch/cortex_m7/os_arch_arm.c b/kernel/os/src/arch/cortex_m7/os_arch_arm.c
index c914cae..1ccb3a6 100755
--- a/kernel/os/src/arch/cortex_m7/os_arch_arm.c
+++ b/kernel/os/src/arch/cortex_m7/os_arch_arm.c
@@ -22,7 +22,7 @@
 #include "os/os_arch.h"
 #include <hal/hal_bsp.h>
 #include <hal/hal_os_tick.h>
-#include <bsp/cmsis_nvic.h>
+#include <mcu/cmsis_nvic.h>
 
 #include "os_priv.h"
 

-- 
To stop receiving notification emails like this one, please contact
utzig@apache.org.