1 /*
2 Copyright (c) 2010 - 2024, 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(NRF9120_XXAA)
78     #include "nrf9120_xxaa_memory.h"
79 #elif defined(NRF9160_XXAA)
80     #include "nrf9160_xxaa_memory.h"
81 #elif defined(NRF9230_ENGA_XXAA)
82     #if defined(NRF_APPLICATION)
83         #include "nrf9230_enga_xxaa_application_memory.h"
84     #endif
85     #if defined(NRF_RADIOCORE)
86         #include "nrf9230_enga_xxaa_radiocore_memory.h"
87     #endif
88     #if defined(NRF_PPR)
89         #include "nrf9230_enga_xxaa_ppr_memory.h"
90     #endif
91     #if defined(NRF_FLPR)
92         #include "nrf9230_enga_xxaa_flpr_memory.h"
93     #endif
94 #elif defined(NRF54H20_XXAA)
95     #if defined(NRF_APPLICATION)
96         #include "nrf54h20_xxaa_application_memory.h"
97     #endif
98     #if defined(NRF_RADIOCORE)
99         #include "nrf54h20_xxaa_radiocore_memory.h"
100     #endif
101     #if defined(NRF_PPR)
102         #include "nrf54h20_xxaa_ppr_memory.h"
103     #endif
104     #if defined(NRF_FLPR)
105         #include "nrf54h20_xxaa_flpr_memory.h"
106     #endif
107 #elif defined(NRF54H20_ENGA_XXAA)
108     #if defined(NRF_APPLICATION)
109         #include "nrf54h20_enga_xxaa_application_memory.h"
110     #endif
111     #if defined(NRF_RADIOCORE)
112         #include "nrf54h20_enga_xxaa_radiocore_memory.h"
113     #endif
114     #if defined(NRF_PPR)
115         #include "nrf54h20_enga_xxaa_ppr_memory.h"
116     #endif
117     #if defined(NRF_FLPR)
118         #include "nrf54h20_enga_xxaa_flpr_memory.h"
119     #endif
120 #elif defined(NRF54L15_XXAA)
121     #if defined(NRF_APPLICATION)
122         #include "nrf54l15_xxaa_application_memory.h"
123     #endif
124     #if defined(NRF_FLPR)
125         #include "nrf54l15_xxaa_flpr_memory.h"
126     #endif
127 #elif defined(NRF54L15_ENGA_XXAA)
128     #if defined(NRF_APPLICATION)
129         #include "nrf54l15_enga_xxaa_application_memory.h"
130     #endif
131     #if defined(NRF_FLPR)
132         #include "nrf54l15_enga_xxaa_flpr_memory.h"
133     #endif
134 #else
135     #error "Device must be defined. See nrf_mem.h."
136 #endif
137 
138 
139 #ifdef  __STARTUP_CONFIG
140     #include "startup_config.h"
141     #ifndef __STARTUP_CONFIG_STACK_ALIGNEMENT
142         #define __STARTUP_CONFIG_STACK_ALIGNEMENT 3
143     #endif
144 #endif
145 
146 #ifndef __STACK_SIZE
147     #if defined(__STARTUP_CONFIG_STACK_SIZE)
148         #define __STACK_SIZE __STARTUP_CONFIG_STACK_SIZE
149     #else
150         #define __STACK_SIZE __DEFAULT_STACK_SIZE
151     #endif
152 #endif
153 
154 #ifndef __STACK_ALIGNMENT
155     #if defined(__STARTUP_CONFIG_STACK_ALIGNEMENT)
156         #define __STACK_ALIGNMENT __STARTUP_CONFIG_STACK_ALIGNEMENT
157     #else
158         #define __STACK_ALIGNMENT 3
159     #endif
160 #endif
161 
162 #ifndef __HEAP_SIZE
163     #if defined(__STARTUP_CONFIG_HEAP_SIZE)
164         #define __HEAP_SIZE __STARTUP_CONFIG_HEAP_SIZE
165     #else
166         #define __HEAP_SIZE __DEFAULT_HEAP_SIZE
167     #endif
168 #endif
169 
170 #ifndef __HEAP_ALIGNMENT
171     #define __HEAP_ALIGNMENT __STACK_ALIGNMENT
172 #endif
173 
174 #endif
175