Skip to content

Commit 57b5dc1

Browse files
hw/bsp/dialog_da1469x-dk-pro: select linker script by MCU_TARGET
Pick the linker script dynamically based on the syscfg MCU_TARGET value. This makes flashing DA14691 easier since it has a different RAM size than other DA1469x chips.
1 parent a52f357 commit 57b5dc1

File tree

4 files changed

+87
-1
lines changed

4 files changed

+87
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
MEMORY
21+
{
22+
/*
23+
* Flash is remapped at 0x0 by 1st stage bootloader, but this is done with
24+
* an offset derived from image header thus it is safer to use remapped
25+
* address space at 0x0 instead of QSPI_M address space at 0x16000000.
26+
* Bootloader partition is 32K, but 9K is currently reserved for product
27+
* header (8K) and image header (1K).
28+
* First 512 bytes of SYSRAM are remapped at 0x0 and used as ISR vector
29+
* (there's no need to reallocate ISR vector) and thus cannot be used by
30+
* application.
31+
*/
32+
33+
FLASH (rx) : ORIGIN = (0x00000000), LENGTH = (23 * 1024)
34+
RAM (rw) : ORIGIN = (0x20000000), LENGTH = (384 * 1024)
35+
}
36+
37+
/* The bootloader does not contain an image header */
38+
_imghdr_size = 0x0;

hw/bsp/dialog_da1469x-dk-pro/bsp.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,26 @@ bsp.linkerscript:
3030
- "hw/bsp/dialog_da1469x-dk-pro/da1469x.ld"
3131
- "hw/mcu/dialog/da1469x/da1469x.ld"
3232

33+
bsp.linkerscript.'MCU_TARGET == "DA14691"'.OVERWRITE:
34+
- "hw/bsp/dialog_da1469x-dk-pro/da14691.ld"
35+
- "hw/mcu/dialog/da1469x/da1469x.ld"
36+
3337
bsp.linkerscript.BOOT_LOADER.OVERWRITE:
3438
- "hw/bsp/dialog_da1469x-dk-pro/boot-da1469x.ld"
3539
- "hw/mcu/dialog/da1469x/da1469x.ld"
3640

41+
bsp.linkerscript.BOOT_LOADER.'MCU_TARGET == "DA14691"'.OVERWRITE:
42+
- "hw/bsp/dialog_da1469x-dk-pro/boot-da14691.ld"
43+
- "hw/mcu/dialog/da1469x/da1469x.ld"
44+
3745
bsp.linkerscript.RAM_RESIDENT.OVERWRITE:
3846
- "hw/bsp/dialog_da1469x-dk-pro/boot-da1469x.ld"
3947
- "hw/mcu/dialog/da1469x/da1469x_ram_resident.ld"
4048

49+
bsp.linkerscript.RAM_RESIDENT.'MCU_TARGET == "DA14691"'.OVERWRITE:
50+
- "hw/bsp/dialog_da1469x-dk-pro/boot-da14691.ld"
51+
- "hw/mcu/dialog/da1469x/da1469x_ram_resident.ld"
52+
4153
bsp.flash_map:
4254
areas:
4355
# System areas.
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+
MEMORY
21+
{
22+
FLASH (rx) : ORIGIN = (0x16008000), LENGTH = (384 * 1024)
23+
RAM (rw) : ORIGIN = (0x20000000), LENGTH = (384 * 1024)
24+
}
25+
26+
/* This linker script is used for images and thus contains an image header */
27+
_imghdr_size = 0x20;

hw/bsp/dialog_da1469x-dk-pro/include/bsp/bsp.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525

2626
#ifdef __cplusplus
2727
extern "C" {
28+
29+
30+
2831
#endif
2932

3033
/* Define special stackos sections */
@@ -36,7 +39,13 @@ extern "C" {
3639
#define bssnz_t sec_bss_nz_core
3740

3841
extern uint8_t _ram_start;
39-
#define RAM_SIZE 0x80000
42+
43+
#if MYNEWT_VAL_CHOICE(MCU_TARGET, DA14691)
44+
#define RAM_SIZE 0x60000
45+
#else
46+
#define RAM_SIZE 0x80000
47+
#endif
48+
4049

4150
/* LED pins */
4251
#define LED_1 (33) /* P1_1 */

0 commit comments

Comments
 (0)