Skip to content

Commit 0a2383f

Browse files
committed
targets: add target for auracast_usb app
Adds build target for auracast_usb application.
1 parent 3c99e4f commit 0a2383f

File tree

5 files changed

+322
-0
lines changed

5 files changed

+322
-0
lines changed
Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
/* Linker script for Nordic Semiconductor nRF5 devices
2+
*
3+
* Version: Sourcery G++ 4.5-1
4+
* Support: https://support.codesourcery.com/GNUToolchain/
5+
*
6+
* Copyright (c) 2007, 2008, 2009, 2010 CodeSourcery, Inc.
7+
*
8+
* The authors hereby grant permission to use, copy, modify, distribute,
9+
* and license this software and its documentation for any purpose, provided
10+
* that existing copyright notices are retained in all copies and that this
11+
* notice is included verbatim in any distributions. No written agreement,
12+
* license, or royalty fee is required for any of the authorized uses.
13+
* Modifications to this software may be copyrighted by their authors
14+
* and need not follow the licensing terms described here, provided that
15+
* the new terms are clearly indicated on the first page of each file where
16+
* they apply.
17+
*/
18+
OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
19+
20+
/* Linker script to place sections and symbol values. Should be used together
21+
* with other linker script that defines memory regions FLASH and RAM.
22+
* It references following symbols, which must be defined in code:
23+
* Reset_Handler : Entry of reset handler
24+
*
25+
* It defines following symbols, which code can use without definition:
26+
* __exidx_start
27+
* __exidx_end
28+
* __etext
29+
* __data_start__
30+
* __preinit_array_start
31+
* __preinit_array_end
32+
* __init_array_start
33+
* __init_array_end
34+
* __fini_array_start
35+
* __fini_array_end
36+
* __data_end__
37+
* __bss_start__
38+
* __bss_end__
39+
* __HeapBase
40+
* __HeapLimit
41+
* __StackLimit
42+
* __StackTop
43+
* __stack
44+
* __bssnz_start__
45+
* __bssnz_end__
46+
*/
47+
ENTRY(Reset_Handler)
48+
49+
SECTIONS
50+
{
51+
.imghdr (NOLOAD):
52+
{
53+
. = . + _imghdr_size;
54+
} > FLASH
55+
56+
__text = .;
57+
58+
.text :
59+
{
60+
__isr_vector_start = .;
61+
KEEP(*(.isr_vector))
62+
__isr_vector_end = .;
63+
EXCLUDE_FILE(*liblc3.a: *libm.a: *libsamplerate.a: *audio_usb.o) *(.text*)
64+
65+
KEEP(*(.init))
66+
KEEP(*(.fini))
67+
68+
. = ALIGN(4);
69+
/* preinit data */
70+
PROVIDE_HIDDEN (__preinit_array_start = .);
71+
KEEP(*(.preinit_array))
72+
PROVIDE_HIDDEN (__preinit_array_end = .);
73+
74+
. = ALIGN(4);
75+
/* init data */
76+
PROVIDE_HIDDEN (__init_array_start = .);
77+
KEEP(*(SORT(.init_array.*)))
78+
KEEP(*(.init_array))
79+
PROVIDE_HIDDEN (__init_array_end = .);
80+
81+
. = ALIGN(4);
82+
/* finit data */
83+
PROVIDE_HIDDEN (__fini_array_start = .);
84+
KEEP(*(SORT(.fini_array.*)))
85+
KEEP(*(.fini_array))
86+
PROVIDE_HIDDEN (__fini_array_end = .);
87+
88+
/* .ctors */
89+
*crtbegin.o(.ctors)
90+
*crtbegin?.o(.ctors)
91+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
92+
*(SORT(.ctors.*))
93+
*(.ctors)
94+
95+
/* .dtors */
96+
*crtbegin.o(.dtors)
97+
*crtbegin?.o(.dtors)
98+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
99+
*(SORT(.dtors.*))
100+
*(.dtors)
101+
102+
EXCLUDE_FILE(*liblc3.a: *libsamplerate.a:) *(.rodata*)
103+
104+
*(.eh_frame*)
105+
PROVIDE(mynewt_main = main);
106+
. = ALIGN(4);
107+
} > FLASH
108+
109+
110+
.net_core_img :
111+
{
112+
PROVIDE(net_core_img_start = .);
113+
KEEP(*(.net_core_img));
114+
PROVIDE(net_core_img_end = .);
115+
} > FLASH
116+
117+
.ARM.extab :
118+
{
119+
*(.ARM.extab* .gnu.linkonce.armextab.*)
120+
. = ALIGN(4);
121+
} > FLASH
122+
123+
__exidx_start = .;
124+
.ARM.exidx :
125+
{
126+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
127+
. = ALIGN(4);
128+
} > FLASH
129+
__exidx_end = .;
130+
131+
__etext = .;
132+
133+
.vector_relocation :
134+
{
135+
. = ALIGN(4);
136+
__vector_tbl_reloc__ = .;
137+
. = . + (__isr_vector_end - __isr_vector_start);
138+
. = ALIGN(4);
139+
} > RAM
140+
141+
/* Section for app-net cores IPC */
142+
.ipc 0x20000400 (NOLOAD):
143+
{
144+
. = ALIGN(4);
145+
*(.ipc)
146+
. = ALIGN(4);
147+
} > RAM
148+
149+
/* This section will be zeroed by RTT package init */
150+
.rtt (NOLOAD):
151+
{
152+
. = ALIGN(4);
153+
*(.rtt)
154+
. = ALIGN(4);
155+
} > RAM
156+
157+
.data :
158+
{
159+
__data_start__ = .;
160+
*(vtable)
161+
*(.data*)
162+
163+
*(.jcr)
164+
*liblc3.a:(.text* .rodata*)
165+
*libsamplerate.a:(.text* .rodata*)
166+
*audio_usb.o(.text*)
167+
*libm.a:(.text*)
168+
. = ALIGN(4);
169+
/* All data end */
170+
__data_end__ = .;
171+
} > RAM AT > FLASH
172+
173+
/* Non-zeroed BSS. This section is similar to BSS, but does not get zeroed at init-time.
174+
*/
175+
.bssnz :
176+
{
177+
. = ALIGN(4);
178+
__bssnz_start__ = .;
179+
*(.bss.core.nz*)
180+
. = ALIGN(4);
181+
__bssnz_end__ = .;
182+
} > RAM
183+
184+
.bss :
185+
{
186+
. = ALIGN(4);
187+
__bss_start__ = .;
188+
*(.bss*)
189+
*(COMMON)
190+
. = ALIGN(4);
191+
__bss_end__ = .;
192+
} > RAM
193+
194+
/* Heap starts after BSS */
195+
. = ALIGN(8);
196+
__HeapBase = .;
197+
198+
/* .stack_dummy section doesn't contains any symbols. It is only
199+
* used for linker to calculate size of stack sections, and assign
200+
* values to stack symbols later */
201+
.stack_dummy (COPY):
202+
{
203+
*(.stack*)
204+
} > RAM
205+
206+
_ram_start = ORIGIN(RAM);
207+
208+
/* Set stack top to end of RAM, and stack limit move down by
209+
* size of stack_dummy section */
210+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
211+
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
212+
PROVIDE(__stack = __StackTop);
213+
214+
/* Top of head is the bottom of the stack */
215+
__HeapLimit = __StackLimit;
216+
217+
/* Check if data + heap + stack exceeds RAM limit */
218+
ASSERT(__HeapBase <= __HeapLimit, "region RAM overflowed with stack")
219+
}
220+

targets/auracast_usb/nrf5340.ld

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
MEMORY
20+
{
21+
FLASH (rx) : ORIGIN = 0x0000c000, LENGTH = 0x76000
22+
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x80000
23+
}
24+
25+
/* This linker script is used for images and thus contains an image header */
26+
_imghdr_size = 0x20;

targets/auracast_usb/pkg.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
pkg.name: targets/auracast_usb
21+
pkg.type: target
22+
pkg.description:
23+
pkg.author:
24+
pkg.homepage:

targets/auracast_usb/syscfg.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
syscfg.vals.BSP_NRF5340:
21+
MCU_MPU_ENABLE: 0
22+
MCU_CACHE_ENABLED: 1
23+
BSP_NRF5340_NET_ENABLE: 1
24+
NRF5340_EMBED_NET_CORE: 1
25+
NET_CORE_IMAGE_TARGET_NAME: "@apache-mynewt-nimble/targets/nordic_pca10095_net-blehci_broadcaster"

targets/auracast_usb/target.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
target.app: "@apache-mynewt-nimble/apps/auracast_usb"
21+
target.bsp: "@apache-mynewt-core/hw/bsp/nordic_pca10121"
22+
target.build_profile: speed
23+
24+
# linkerscrupt that moves audio processing to RAM, for better performance
25+
bsp.linkerscript:
26+
- "@apache-mynewt-nimble/targets/auracast_usb/nrf5340.ld"
27+
- "@apache-mynewt-nimble/targets/auracast_usb/nrf5340-mcu.ld"

0 commit comments

Comments
 (0)