Skip to content

Commit

Permalink
include/arch/arm: linker.ld: Add shared memory sections definitions
Browse files Browse the repository at this point in the history
STM32WB HCI driver requires definition of 2 RAM regions to support
use of 3 shared memory sections: MAPPING_TABLE, MB_MEM1 and MB_MEM2.
In linker.ld, under conditions of HCI driver to be enabled,
define SRAM1 and SRAM2 based on input defined in stm32wb linker.
Then define the 3 sections MAPPING_TABLE, MB_MEM1 and MB_MEM

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
  • Loading branch information
erwango authored and nashif committed Jun 3, 2019
1 parent a0e8171 commit c6ebfad
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
5 changes: 4 additions & 1 deletion include/arch/arm/cortex_m/scripts/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ MEMORY
CCM (rw) : ORIGIN = DT_CCM_BASE_ADDRESS, LENGTH = DT_CCM_SIZE * 1K
#endif
SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE

#ifdef CONFIG_BT_STM32_IPM
SRAM1 (rw) : ORIGIN = RAM1_ADDR, LENGTH = RAM1_SIZE
SRAM2 (rw) : ORIGIN = RAM2_ADDR, LENGTH = RAM2_SIZE
#endif
/* Used by and documented in include/linker/intlist.ld */
IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K
}
Expand Down
5 changes: 5 additions & 0 deletions soc/arm/st_stm32/stm32wb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ zephyr_include_directories(${ZEPHYR_BASE}/drivers)
zephyr_sources(
soc.c
)

zephyr_linker_sources_ifdef(CONFIG_BT_STM32_IPM
SECTIONS
ipm.ld
)
9 changes: 9 additions & 0 deletions soc/arm/st_stm32/stm32wb/ipm.ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2019 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/

MAPPING_TABLE (NOLOAD) : {_sMAPPING_TABLE = .; *(MAPPING_TABLE); _eMAPPING_TABLE = .; } >SRAM1
MB_MEM1 (NOLOAD) : { _sMB_MEM1 = .; *(MB_MEM1); _eMB_MEM1 = .; } >SRAM1
MB_MEM2 (NOLOAD) : { _sMB_MEM2 = .; *(MB_MEM2); _eMB_MEM2 = .; } >SRAM2
7 changes: 6 additions & 1 deletion soc/arm/st_stm32/stm32wb/linker.ld
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/* linker.ld - Linker command/script file */

/*
* Copyright (c) 2014-2016 Wind River Systems, Inc.
* Copyright (c) 2019 Linaro Limited
*
* SPDX-License-Identifier: Apache-2.0
*/

#define RAM1_SIZE (10 * 1K)
#define RAM1_ADDR 0x20030000
#define RAM2_SIZE (20 * 1K)
#define RAM2_ADDR 0x20038000

#include <arch/arm/cortex_m/scripts/linker.ld>

0 comments on commit c6ebfad

Please sign in to comment.