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

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

commit 6b33f4deba061e0ad81ed7c3fa50d6affc6533ba
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Wed Mar 26 12:04:43 2025 +0100

    mcu/nrf5340: Add option to use common cortex startup
    
    NRF53 based devices now can use common cortex startup code
    and and auto generated linker script.
    
    Older way is still working. Local linker scripts can be
    removed from repository later.
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 hw/mcu/nordic/nrf5340/include/mcu/mcu_vectors.h    |  20 ++
 .../nrf5340/include/mcu/vectors/nrf5340_vectors.h  | 275 +++++++++++++++++++++
 hw/mcu/nordic/nrf5340/link/include/mcu_config.ld.h |  22 ++
 .../nrf5340/link/include/memory_regions.ld.h       |  22 ++
 .../nordic/nrf5340/link/include/user_sections.ld.h |  26 ++
 hw/mcu/nordic/nrf5340/pkg.yml                      |   3 +
 hw/mcu/nordic/nrf5340/syscfg.yml                   |  16 ++
 .../nordic/nrf5340_net/include/mcu/mcu_vectors.h   |  20 ++
 .../include/mcu/vectors/nrf5340_netcore_vectors.h  |  65 +++++
 .../nrf5340_net/link/include/memory_regions.ld.h   |  20 ++
 .../nrf5340_net/link/include/user_sections.ld.h    |  24 ++
 hw/mcu/nordic/nrf5340_net/pkg.yml                  |   2 +
 hw/mcu/nordic/nrf5340_net/syscfg.yml               |  16 ++
 13 files changed, 531 insertions(+)

diff --git a/hw/mcu/nordic/nrf5340/include/mcu/mcu_vectors.h 
b/hw/mcu/nordic/nrf5340/include/mcu/mcu_vectors.h
new file mode 100644
index 000000000..7832101f5
--- /dev/null
+++ b/hw/mcu/nordic/nrf5340/include/mcu/mcu_vectors.h
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+#include <mcu/vectors/nrf5340_vectors.h>
diff --git a/hw/mcu/nordic/nrf5340/include/mcu/vectors/nrf5340_vectors.h 
b/hw/mcu/nordic/nrf5340/include/mcu/vectors/nrf5340_vectors.h
new file mode 100644
index 000000000..85f588f07
--- /dev/null
+++ b/hw/mcu/nordic/nrf5340/include/mcu/vectors/nrf5340_vectors.h
@@ -0,0 +1,275 @@
+/*
+ * 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.
+ */
+
+INT_VECTOR_STACK_TOP(__StackTop)
+INT_VECTOR_RESET_HANDLER(Reset_Handler)
+INT_VECTOR_NMI_HANDLER(NMI_Handler)
+INT_VECTOR_HARDFAULT_HANDLER(HardFault_Handler)
+INT_VECTOR_MEMMANAGE_HANDLER(MemoryManagement_Handler)
+INT_VECTOR_BUSFAULT_HANDLER(BusFault_Handler)
+INT_VECTOR_USAGEFAULT_HANDLER(UsageFault_Handler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_SVC_HANDLER(SVC_Handler)
+INT_VECTOR_DEBUGMON_HANDLER(DebugMon_Handler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_PENDSV_HANDLER(PendSV_Handler)
+INT_VECTOR_SYSTICK_HANDLER(SysTick_Handler)
+INT_VECTOR(FPU_IRQHandler)
+INT_VECTOR(CACHE_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(SPU_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(CLOCK_POWER_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(SPIM0_SPIS0_TWIM0_TWIS0_UARTE0_IRQHandler)
+INT_VECTOR(SPIM1_SPIS1_TWIM1_TWIS1_UARTE1_IRQHandler)
+INT_VECTOR(SPIM4_IRQHandler)
+INT_VECTOR(SPIM2_SPIS2_TWIM2_TWIS2_UARTE2_IRQHandler)
+INT_VECTOR(SPIM3_SPIS3_TWIM3_TWIS3_UARTE3_IRQHandler)
+INT_VECTOR(GPIOTE0_IRQHandler)
+INT_VECTOR(SAADC_IRQHandler)
+INT_VECTOR(TIMER0_IRQHandler)
+INT_VECTOR(TIMER1_IRQHandler)
+INT_VECTOR(TIMER2_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(RTC0_IRQHandler)
+INT_VECTOR(RTC1_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(WDT0_IRQHandler)
+INT_VECTOR(WDT1_IRQHandler)
+INT_VECTOR(COMP_LPCOMP_IRQHandler)
+INT_VECTOR(EGU0_IRQHandler)
+INT_VECTOR(EGU1_IRQHandler)
+INT_VECTOR(EGU2_IRQHandler)
+INT_VECTOR(EGU3_IRQHandler)
+INT_VECTOR(EGU4_IRQHandler)
+INT_VECTOR(EGU5_IRQHandler)
+INT_VECTOR(PWM0_IRQHandler)
+INT_VECTOR(PWM1_IRQHandler)
+INT_VECTOR(PWM2_IRQHandler)
+INT_VECTOR(PWM3_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(PDM0_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(I2S0_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(IPC_IRQHandler)
+INT_VECTOR(QSPI_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(NFCT_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(GPIOTE1_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(QDEC0_IRQHandler)
+INT_VECTOR(QDEC1_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(USBD_IRQHandler)
+INT_VECTOR(USBREGULATOR_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(KMU_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(CRYPTOCELL_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
diff --git a/hw/mcu/nordic/nrf5340/link/include/mcu_config.ld.h 
b/hw/mcu/nordic/nrf5340/link/include/mcu_config.ld.h
new file mode 100644
index 000000000..4bc7b7656
--- /dev/null
+++ b/hw/mcu/nordic/nrf5340/link/include/mcu_config.ld.h
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+#ifndef MYNEWT_VAL_BOOT_LOADER
+#define VECTOR_RELOCATION_RAM VECTOR_RELOCATION_REGION
+#endif
diff --git a/hw/mcu/nordic/nrf5340/link/include/memory_regions.ld.h 
b/hw/mcu/nordic/nrf5340/link/include/memory_regions.ld.h
new file mode 100644
index 000000000..57fa14379
--- /dev/null
+++ b/hw/mcu/nordic/nrf5340/link/include/memory_regions.ld.h
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+#ifndef MYNEWT_VAL_BOOT_LOADER
+    VECTOR_RELOCATION_REGION (rw) : ORIGIN = 0x20000000, LENGTH = 0x400
+#endif
diff --git a/hw/mcu/nordic/nrf5340/link/include/user_sections.ld.h 
b/hw/mcu/nordic/nrf5340/link/include/user_sections.ld.h
new file mode 100644
index 000000000..066d4efcb
--- /dev/null
+++ b/hw/mcu/nordic/nrf5340/link/include/user_sections.ld.h
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+#ifndef MYNEWT_VAL_BOOT_LOADER
+    /* Section for app-net cores IPC */
+    .ipc 0x20000400 (NOLOAD):
+    {
+       *(.ipc)
+    } > RAM
+#endif
diff --git a/hw/mcu/nordic/nrf5340/pkg.yml b/hw/mcu/nordic/nrf5340/pkg.yml
index ddc93e25a..a123fbdc9 100644
--- a/hw/mcu/nordic/nrf5340/pkg.yml
+++ b/hw/mcu/nordic/nrf5340/pkg.yml
@@ -113,5 +113,8 @@ pkg.cflags.MCU_NRF5340_EN_APPROTECT_USERHANDLING:
 pkg.deps.MCU_DEFAULT_STARTUP:
     - "@apache-mynewt-core/hw/mcu/nordic/nrf5340/startup"
 
+pkg.deps.CORTEX_DEFAULT_STARTUP:
+    - "@apache-mynewt-core/boot/startup"
+
 pkg.deps.MCU_MPU_ENABLE:
     - "@apache-mynewt-core/hw/mcu/nordic/nrf5340/mpu"
diff --git a/hw/mcu/nordic/nrf5340/syscfg.yml b/hw/mcu/nordic/nrf5340/syscfg.yml
index cfa8e4374..e2ce0ef1f 100644
--- a/hw/mcu/nordic/nrf5340/syscfg.yml
+++ b/hw/mcu/nordic/nrf5340/syscfg.yml
@@ -140,6 +140,18 @@ syscfg.defs:
             Include default startup code.
             Set to 0 if BSP provides customized startup code.
         value: 1
+        restrictions:
+            - '!CORTEX_DEFAULT_STARTUP if 1'
+
+    CORTEX_DEFAULT_STARTUP:
+        description: >
+            Include mynewt default startup code for Cortex.
+        value: 0
+        restrictions:
+            - '!MCU_DEFAULT_STARTUP if 1'
+
+    MCU_PATH:
+        value: '"repos/apache-mynewt-core/hw/mcu/nordic/nrf5340"'
 
 # MCU peripherals definitions
     ADC_0:
@@ -582,6 +594,10 @@ syscfg.defs:
 syscfg.vals:
     OS_TICKS_PER_SEC: 128
 
+syscfg.vals.CORTEX_DEFAULT_STARTUP:
+    MCU_RAM_START: 0x20000000
+    MCU_RAM_SIZE: 0x80000
+
 syscfg.restrictions:
     - "!UART_0 || (UART_0_PIN_TX != -1 && UART_0_PIN_RX != -1)"
     - "!UART_1 || (UART_1_PIN_TX != -1 && UART_1_PIN_RX != -1)"
diff --git a/hw/mcu/nordic/nrf5340_net/include/mcu/mcu_vectors.h 
b/hw/mcu/nordic/nrf5340_net/include/mcu/mcu_vectors.h
new file mode 100644
index 000000000..cb5e3878c
--- /dev/null
+++ b/hw/mcu/nordic/nrf5340_net/include/mcu/mcu_vectors.h
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+#include <mcu/vectors/nrf5340_netcore_vectors.h>
diff --git 
a/hw/mcu/nordic/nrf5340_net/include/mcu/vectors/nrf5340_netcore_vectors.h 
b/hw/mcu/nordic/nrf5340_net/include/mcu/vectors/nrf5340_netcore_vectors.h
new file mode 100644
index 000000000..c26cc009a
--- /dev/null
+++ b/hw/mcu/nordic/nrf5340_net/include/mcu/vectors/nrf5340_netcore_vectors.h
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+
+INT_VECTOR_STACK_TOP(__StackTop)
+INT_VECTOR_RESET_HANDLER(Reset_Handler)
+INT_VECTOR_NMI_HANDLER(NMI_Handler)
+INT_VECTOR_HARDFAULT_HANDLER(HardFault_Handler)
+INT_VECTOR_MEMMANAGE_HANDLER(MemoryManagement_Handler)
+INT_VECTOR_BUSFAULT_HANDLER(BusFault_Handler)
+INT_VECTOR_USAGEFAULT_HANDLER(UsageFault_Handler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_SVC_HANDLER(SVC_Handler)
+INT_VECTOR_DEBUGMON_HANDLER(DebugMon_Handler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_PENDSV_HANDLER(PendSV_Handler)
+INT_VECTOR_SYSTICK_HANDLER(SysTick_Handler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(CLOCK_POWER_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(RADIO_IRQHandler)
+INT_VECTOR(RNG_IRQHandler)
+INT_VECTOR(GPIOTE_IRQHandler)
+INT_VECTOR(WDT_IRQHandler)
+INT_VECTOR(TIMER0_IRQHandler)
+INT_VECTOR(ECB_IRQHandler)
+INT_VECTOR(AAR_CCM_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(TEMP_IRQHandler)
+INT_VECTOR(RTC0_IRQHandler)
+INT_VECTOR(IPC_IRQHandler)
+INT_VECTOR(SERIAL0_IRQHandler)
+INT_VECTOR(EGU0_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(RTC1_IRQHandler)
+INT_VECTOR_UNUSED(0)
+INT_VECTOR(TIMER1_IRQHandler)
+INT_VECTOR(TIMER2_IRQHandler)
+INT_VECTOR(SWI0_IRQHandler)
+INT_VECTOR(SWI1_IRQHandler)
+INT_VECTOR(SWI2_IRQHandler)
+INT_VECTOR(SWI3_IRQHandler)
diff --git a/hw/mcu/nordic/nrf5340_net/link/include/memory_regions.ld.h 
b/hw/mcu/nordic/nrf5340_net/link/include/memory_regions.ld.h
new file mode 100644
index 000000000..5898bb51f
--- /dev/null
+++ b/hw/mcu/nordic/nrf5340_net/link/include/memory_regions.ld.h
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+    IPC (rw)  : ORIGIN = 0x20000400, LENGTH = 0x400
diff --git a/hw/mcu/nordic/nrf5340_net/link/include/user_sections.ld.h 
b/hw/mcu/nordic/nrf5340_net/link/include/user_sections.ld.h
new file mode 100644
index 000000000..2a00ecd5f
--- /dev/null
+++ b/hw/mcu/nordic/nrf5340_net/link/include/user_sections.ld.h
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+    /* Section for app-net cores IPC */
+    .ipc (NOLOAD):
+    {
+       *(.ipc)
+    } > IPC
diff --git a/hw/mcu/nordic/nrf5340_net/pkg.yml 
b/hw/mcu/nordic/nrf5340_net/pkg.yml
index 83146c656..989c9ae9b 100644
--- a/hw/mcu/nordic/nrf5340_net/pkg.yml
+++ b/hw/mcu/nordic/nrf5340_net/pkg.yml
@@ -55,3 +55,5 @@ pkg.deps.BLE_CONTROLLER:
 pkg.deps.MCU_DEFAULT_STARTUP:
     - "@apache-mynewt-core/hw/mcu/nordic/nrf5340_net/startup"
 
+pkg.deps.CORTEX_DEFAULT_STARTUP:
+    - "@apache-mynewt-core/boot/startup"
diff --git a/hw/mcu/nordic/nrf5340_net/syscfg.yml 
b/hw/mcu/nordic/nrf5340_net/syscfg.yml
index f7278d759..239c7e65e 100644
--- a/hw/mcu/nordic/nrf5340_net/syscfg.yml
+++ b/hw/mcu/nordic/nrf5340_net/syscfg.yml
@@ -74,6 +74,18 @@ syscfg.defs:
             Include default startup code.
             Set to 0 if BSP provides customized startup code.
         value: 1
+        restrictions:
+            - '!CORTEX_DEFAULT_STARTUP if 1'
+
+    CORTEX_DEFAULT_STARTUP:
+        description: >
+            Include mynewt default startup code for Cortex.
+        value: 0
+        restrictions:
+            - '!MCU_DEFAULT_STARTUP if 1'
+
+    MCU_PATH:
+        value: '"repos/apache-mynewt-core/hw/mcu/nordic/nrf5340_net"'
 
 # MCU peripherals definitions
     TRNG:
@@ -158,5 +170,9 @@ syscfg.defs:
 syscfg.vals:
     OS_TICKS_PER_SEC: 128
 
+syscfg.vals.CORTEX_DEFAULT_STARTUP:
+    MCU_RAM_START: 0x21000000
+    MCU_RAM_SIZE: 0x10000
+
 syscfg.restrictions:
     - "!UART_0 || (UART_0_PIN_TX && UART_0_PIN_RX)"

Reply via email to