1 /*
2 Copyright (c) 2010 - 2025, Nordic Semiconductor ASA All rights reserved.
3 
4 SPDX-License-Identifier: BSD-3-Clause
5 
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8 
9 1. Redistributions of source code must retain the above copyright notice, this
10    list of conditions and the following disclaimer.
11 
12 2. Redistributions in binary form must reproduce the above copyright
13    notice, this list of conditions and the following disclaimer in the
14    documentation and/or other materials provided with the distribution.
15 
16 3. Neither the name of Nordic Semiconductor ASA nor the names of its
17    contributors may be used to endorse or promote products derived from this
18    software without specific prior written permission.
19 
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE
23 ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
24 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef NRF_MEM_H_
34 #define NRF_MEM_H_
35 
36 #if defined(NRF51422_XXAA)
37     #include "nrf51422_xxaa_memory.h"
38 #elif defined(NRF51422_XXAB)
39     #include "nrf51422_xxab_memory.h"
40 #elif defined(NRF51422_XXAC)
41     #include "nrf51422_xxac_memory.h"
42 #elif defined(NRF51801_XXAB)
43     #include "nrf51801_xxab_memory.h"
44 #elif defined(NRF51802_XXAA)
45     #include "nrf51802_xxaa_memory.h"
46 #elif defined(NRF51822_XXAA)
47     #include "nrf51822_xxaa_memory.h"
48 #elif defined(NRF51822_XXAB)
49     #include "nrf51822_xxab_memory.h"
50 #elif defined(NRF51822_XXAC)
51     #include "nrf51822_xxac_memory.h"
52 #elif defined(NRF51824_XXAA)
53     #include "nrf51824_xxaa_memory.h"
54 #elif defined(NRF52805_XXAA)
55     #include "nrf52805_xxaa_memory.h"
56 #elif defined(NRF52810_XXAA)
57     #include "nrf52810_xxaa_memory.h"
58 #elif defined(NRF52811_XXAA)
59     #include "nrf52811_xxaa_memory.h"
60 #elif defined(NRF52820_XXAA)
61     #include "nrf52820_xxaa_memory.h"
62 #elif defined(NRF52832_XXAA)
63     #include "nrf52832_xxaa_memory.h"
64 #elif defined(NRF52832_XXAB)
65     #include "nrf52832_xxab_memory.h"
66 #elif defined(NRF52833_XXAA)
67     #include "nrf52833_xxaa_memory.h"
68 #elif defined(NRF52840_XXAA)
69     #include "nrf52840_xxaa_memory.h"
70 #elif defined(NRF5340_XXAA)
71     #if defined(NRF_APPLICATION)
72         #include "nrf5340_xxaa_application_memory.h"
73     #endif
74     #if defined(NRF_NETWORK)
75         #include "nrf5340_xxaa_network_memory.h"
76     #endif
77 #elif defined(NRF54L09_ENGA_XXAA)
78     #if defined(NRF_APPLICATION)
79         #include "nrf54l09_enga_xxaa_application_memory.h"
80     #endif
81     #if defined(NRF_FLPR)
82         #include "nrf54l09_enga_xxaa_flpr_memory.h"
83     #endif
84 #elif defined(NRF54L05_XXAA)
85     #if defined(NRF_APPLICATION)
86         #include "nrf54l05_xxaa_application_memory.h"
87     #endif
88     #if defined(NRF_FLPR)
89         #include "nrf54l05_xxaa_flpr_memory.h"
90     #endif
91 #elif defined(NRF54L10_XXAA)
92     #if defined(NRF_APPLICATION)
93         #include "nrf54l10_xxaa_application_memory.h"
94     #endif
95     #if defined(NRF_FLPR)
96         #include "nrf54l10_xxaa_flpr_memory.h"
97     #endif
98 #elif defined(NRF54L15_XXAA)
99     #if defined(NRF_APPLICATION)
100         #include "nrf54l15_xxaa_application_memory.h"
101     #endif
102     #if defined(NRF_FLPR)
103         #include "nrf54l15_xxaa_flpr_memory.h"
104     #endif
105 #elif defined(NRF54L20_ENGA_XXAA)
106     #if defined(NRF_APPLICATION)
107         #include "nrf54l20_enga_xxaa_application_memory.h"
108     #endif
109     #if defined(NRF_FLPR)
110         #include "nrf54l20_enga_xxaa_flpr_memory.h"
111     #endif
112 #elif defined(NRF54H20_XXAA)
113     #if defined(NRF_APPLICATION)
114         #include "nrf54h20_xxaa_application_memory.h"
115     #endif
116     #if defined(NRF_RADIOCORE)
117         #include "nrf54h20_xxaa_radiocore_memory.h"
118     #endif
119     #if defined(NRF_PPR)
120         #include "nrf54h20_xxaa_ppr_memory.h"
121     #endif
122     #if defined(NRF_FLPR)
123         #include "nrf54h20_xxaa_flpr_memory.h"
124     #endif
125 #elif defined(NRF7120_ENGA_XXAA)
126     #if defined(NRF_APPLICATION)
127         #include "nrf7120_enga_xxaa_application_memory.h"
128     #endif
129     #if defined(NRF_FLPR)
130         #include "nrf7120_enga_xxaa_flpr_memory.h"
131     #endif
132     #if defined(NRF_UMAC)
133         #include "nrf7120_enga_xxaa_umac_memory.h"
134     #endif
135     #if defined(NRF_LMAC)
136         #include "nrf7120_enga_xxaa_lmac_memory.h"
137     #endif
138 #elif defined(NRF9120_XXAA)
139     #include "nrf9120_xxaa_memory.h"
140 #elif defined(NRF9160_XXAA)
141     #include "nrf9160_xxaa_memory.h"
142 #elif defined(NRF9230_ENGB_XXAA)
143     #if defined(NRF_APPLICATION)
144         #include "nrf9230_engb_xxaa_application_memory.h"
145     #endif
146     #if defined(NRF_RADIOCORE)
147         #include "nrf9230_engb_xxaa_radiocore_memory.h"
148     #endif
149     #if defined(NRF_PPR)
150         #include "nrf9230_engb_xxaa_ppr_memory.h"
151     #endif
152     #if defined(NRF_FLPR)
153         #include "nrf9230_engb_xxaa_flpr_memory.h"
154     #endif
155 #else
156     #error "Device must be defined. See nrf_mem.h."
157 #endif
158 
159 
160 #ifdef  __STARTUP_CONFIG
161     #include "startup_config.h"
162     #ifndef __STARTUP_CONFIG_STACK_ALIGNEMENT
163         #define __STARTUP_CONFIG_STACK_ALIGNEMENT 3
164     #endif
165 #endif
166 
167 #ifndef __STACK_SIZE
168     #if defined(__STARTUP_CONFIG_STACK_SIZE)
169         #define __STACK_SIZE __STARTUP_CONFIG_STACK_SIZE
170     #else
171         #define __STACK_SIZE __DEFAULT_STACK_SIZE
172     #endif
173 #endif
174 
175 #ifndef __STACK_ALIGNMENT
176     #if defined(__STARTUP_CONFIG_STACK_ALIGNEMENT)
177         #define __STACK_ALIGNMENT __STARTUP_CONFIG_STACK_ALIGNEMENT
178     #else
179         #define __STACK_ALIGNMENT 3
180     #endif
181 #endif
182 
183 #ifndef __HEAP_SIZE
184     #if defined(__STARTUP_CONFIG_HEAP_SIZE)
185         #define __HEAP_SIZE __STARTUP_CONFIG_HEAP_SIZE
186     #else
187         #define __HEAP_SIZE __DEFAULT_HEAP_SIZE
188     #endif
189 #endif
190 
191 #ifndef __HEAP_ALIGNMENT
192     #define __HEAP_ALIGNMENT __STACK_ALIGNMENT
193 #endif
194 
195 #endif
196