Skip to content

Commit adcf0e2

Browse files
committed
DISCO_H747I Dualcore support
Add 2 targets for DISCO_H747I dualcore: * DISCO_H747I -> for CM7 core * DISCO_H747I_CM4 -> for CM4 core Current restrictions: * TICKLESS deactivated * DeepSleep not supported (DeepSleep wrapped to sleep) Warning: use of the same IP (example I2C1) by both core at the same time is not prevented, but is strongly not recommended. Some Hardware Semaphore are use for common IP, to manage concurrent access by both cores: Flash, GPIO, RCC. Warning: Drag and drop of binary to DISCO_H747I will flash CM7. In order to flash CM4, one can use STM32 CubeProgrammer tool.
1 parent 079564b commit adcf0e2

File tree

34 files changed

+3245
-73
lines changed

34 files changed

+3245
-73
lines changed

features/mbedtls/targets/TARGET_STM/aes_alt.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,19 @@ void mbedtls_aes_free(mbedtls_aes_context *ctx)
103103
if (ctx == NULL) {
104104
return;
105105
}
106+
#if defined(DUAL_CORE)
107+
uint32_t timeout = HSEM_TIMEOUT;
108+
while (LL_HSEM_1StepLock(HSEM, CFG_HW_RCC_SEMID) && (--timeout != 0)) {
109+
}
110+
#endif /* DUAL_CORE */
106111
/* Force the CRYP Periheral Clock Reset */
107112
__HAL_RCC_CRYP_FORCE_RESET();
108113

109114
/* Release the CRYP Periheral Clock Reset */
110115
__HAL_RCC_CRYP_RELEASE_RESET();
116+
#if defined(DUAL_CORE)
117+
LL_HSEM_ReleaseLock(HSEM, CFG_HW_RCC_SEMID, HSEM_CR_COREID_CURRENT);
118+
#endif /* DUAL_CORE */
111119

112120
mbedtls_zeroize(ctx, sizeof(mbedtls_aes_context));
113121
}

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_DISCO_H747I/PeripheralPins.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ MBED_WEAK const PinMap PinMap_I2C_SCL[] = {
198198
// You have to comment all PWM using TIM_MST defined in hal_tick.h file
199199
// or update python script (check TIM_MST_LIST) and re-run it
200200
MBED_WEAK const PinMap PinMap_PWM[] = {
201-
{PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 // Connected to PMOD\#1- USART2_CTS_NSS
202-
{PA_0_ALT0, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 // Connected to PMOD\#1- USART2_CTS_NSS
203-
{PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 // Connected to ETH_REF_CLK
204-
{PA_1_ALT0, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 // Connected to ETH_REF_CLK
205-
{PA_1_ALT1, PWM_15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 1)}, // TIM15_CH1N // Connected to ETH_REF_CLK
206-
{PA_2, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 // Connected to ETH_MDIO
207-
{PA_2_ALT0, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 // Connected to ETH_MDIO
208-
{PA_2_ALT1, PWM_15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 0)}, // TIM15_CH1 // Connected to ETH_MDIO
201+
// {PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 // Connected to PMOD\#1- USART2_CTS_NSS
202+
// {PA_0_ALT0, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 // Connected to PMOD\#1- USART2_CTS_NSS
203+
// {PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 // Connected to ETH_REF_CLK
204+
// {PA_1_ALT0, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 // Connected to ETH_REF_CLK
205+
{PA_1, PWM_15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 1)}, // TIM15_CH1N // Connected to ETH_REF_CLK
206+
// {PA_2, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 // Connected to ETH_MDIO
207+
// {PA_2_ALT0, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 // Connected to ETH_MDIO
208+
{PA_2, PWM_15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 1, 0)}, // TIM15_CH1 // Connected to ETH_MDIO
209209
{PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 // Connected to ULPI_D0
210210
{PA_3_ALT0, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 // Connected to ULPI_D0
211211
{PA_3_ALT1, PWM_15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM15, 2, 0)}, // TIM15_CH2 // Connected to ULPI_D0

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H747xI/TARGET_DISCO_H747I_CM4/TOOLCHAIN_ARM_STD/startup_stm32h747xx.S

Lines changed: 574 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#! armcc -E
2+
; Scatter-Loading Description File
3+
;******************************************************************************
4+
;* @attention
5+
;*
6+
;* Copyright (c) 2019 STMicroelectronics.
7+
;* All rights reserved.
8+
;*
9+
;* This software component is licensed by ST under BSD 3-Clause license,
10+
;* the "License"; You may not use this file except in compliance with the
11+
;* License. You may obtain a copy of the License at:
12+
;* opensource.org/licenses/BSD-3-Clause
13+
;*
14+
;******************************************************************************
15+
16+
#if !defined(MBED_APP_START)
17+
#define MBED_APP_START 0x08100000
18+
#endif
19+
20+
#if !defined(MBED_APP_SIZE)
21+
#define MBED_APP_SIZE 0x100000
22+
#endif
23+
24+
#if !defined(MBED_BOOT_STACK_SIZE)
25+
#define MBED_BOOT_STACK_SIZE 0x400
26+
#endif
27+
28+
#define Stack_Size MBED_BOOT_STACK_SIZE
29+
30+
#define MBED_RAM_START 0x10000000
31+
#define MBED_RAM_SIZE 0x48000
32+
#define MBED_VECTTABLE_RAM_START (MBED_RAM_START)
33+
#define MBED_VECTTABLE_RAM_SIZE 0x298
34+
#define MBED_RAM0_START (MBED_VECTTABLE_RAM_START + MBED_VECTTABLE_RAM_SIZE)
35+
#define MBED_RAM0_SIZE (MBED_RAM_SIZE - MBED_VECTTABLE_RAM_SIZE)
36+
37+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
38+
39+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
40+
*.o (RESET, +First)
41+
*(InRoot$$Sections)
42+
.ANY (+RO)
43+
}
44+
45+
RW_IRAM1 (MBED_RAM0_START) (MBED_RAM0_SIZE-Stack_Size) { ; RW data
46+
.ANY (+RW +ZI)
47+
}
48+
49+
ARM_LIB_STACK (MBED_RAM0_START+MBED_RAM0_SIZE) EMPTY -Stack_Size { ; stack
50+
}
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
/* Linker script to configure memory regions. */
2+
/*******************************************************************************
3+
* @attention
4+
*
5+
* Copyright (c) 2019 STMicroelectronics.
6+
* All rights reserved.
7+
*
8+
* This software component is licensed by ST under BSD 3-Clause license,
9+
* the "License"; You may not use this file except in compliance with the
10+
* License. You may obtain a copy of the License at:
11+
* opensource.org/licenses/BSD-3-Clause
12+
*
13+
******************************************************************************
14+
*/
15+
16+
#if !defined(MBED_APP_START)
17+
#define MBED_APP_START 0x08100000
18+
#endif
19+
20+
#if !defined(MBED_APP_SIZE)
21+
#define MBED_APP_SIZE 1024K
22+
#endif
23+
24+
#if !defined(MBED_BOOT_STACK_SIZE)
25+
#define MBED_BOOT_STACK_SIZE 0x400
26+
#endif
27+
28+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
29+
30+
MEMORY
31+
{
32+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
33+
RAM (rwx) : ORIGIN = 0x10000298, LENGTH = 288K - 0x298
34+
}
35+
36+
/* Linker script to place sections and symbol values. Should be used together
37+
* with other linker script that defines memory regions FLASH and RAM.
38+
* It references following symbols, which must be defined in code:
39+
* Reset_Handler : Entry of reset handler
40+
*
41+
* It defines following symbols, which code can use without definition:
42+
* __exidx_start
43+
* __exidx_end
44+
* __etext
45+
* __data_start__
46+
* __preinit_array_start
47+
* __preinit_array_end
48+
* __init_array_start
49+
* __init_array_end
50+
* __fini_array_start
51+
* __fini_array_end
52+
* __data_end__
53+
* __bss_start__
54+
* __bss_end__
55+
* __end__
56+
* end
57+
* __HeapLimit
58+
* __StackLimit
59+
* __StackTop
60+
* __stack
61+
* _estack
62+
*/
63+
ENTRY(Reset_Handler)
64+
65+
SECTIONS
66+
{
67+
.text :
68+
{
69+
KEEP(*(.isr_vector))
70+
*(.text*)
71+
KEEP(*(.init))
72+
KEEP(*(.fini))
73+
74+
/* .ctors */
75+
*crtbegin.o(.ctors)
76+
*crtbegin?.o(.ctors)
77+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
78+
*(SORT(.ctors.*))
79+
*(.ctors)
80+
81+
/* .dtors */
82+
*crtbegin.o(.dtors)
83+
*crtbegin?.o(.dtors)
84+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
85+
*(SORT(.dtors.*))
86+
*(.dtors)
87+
88+
*(.rodata*)
89+
90+
KEEP(*(.eh_frame*))
91+
} > FLASH
92+
93+
.ARM.extab :
94+
{
95+
*(.ARM.extab* .gnu.linkonce.armextab.*)
96+
} > FLASH
97+
98+
__exidx_start = .;
99+
.ARM.exidx :
100+
{
101+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
102+
} > FLASH
103+
__exidx_end = .;
104+
105+
__etext = .;
106+
_sidata = .;
107+
108+
.data : AT (__etext)
109+
{
110+
__data_start__ = .;
111+
_sdata = .;
112+
*(vtable)
113+
*(.data*)
114+
115+
. = ALIGN(8);
116+
/* preinit data */
117+
PROVIDE_HIDDEN (__preinit_array_start = .);
118+
KEEP(*(.preinit_array))
119+
PROVIDE_HIDDEN (__preinit_array_end = .);
120+
121+
. = ALIGN(8);
122+
/* init data */
123+
PROVIDE_HIDDEN (__init_array_start = .);
124+
KEEP(*(SORT(.init_array.*)))
125+
KEEP(*(.init_array))
126+
PROVIDE_HIDDEN (__init_array_end = .);
127+
128+
129+
. = ALIGN(8);
130+
/* finit data */
131+
PROVIDE_HIDDEN (__fini_array_start = .);
132+
KEEP(*(SORT(.fini_array.*)))
133+
KEEP(*(.fini_array))
134+
PROVIDE_HIDDEN (__fini_array_end = .);
135+
136+
KEEP(*(.jcr*))
137+
. = ALIGN(8);
138+
/* All data end */
139+
__data_end__ = .;
140+
_edata = .;
141+
142+
} > RAM
143+
144+
.bss :
145+
{
146+
. = ALIGN(8);
147+
__bss_start__ = .;
148+
_sbss = .;
149+
*(.bss*)
150+
*(COMMON)
151+
. = ALIGN(8);
152+
__bss_end__ = .;
153+
_ebss = .;
154+
} > RAM
155+
156+
.heap (COPY):
157+
{
158+
__end__ = .;
159+
end = __end__;
160+
*(.heap*)
161+
. = ORIGIN(RAM) + LENGTH(RAM) - STACK_SIZE;
162+
__HeapLimit = .;
163+
} > RAM
164+
165+
/* .stack_dummy section doesn't contains any symbols. It is only
166+
* used for linker to calculate size of stack sections, and assign
167+
* values to stack symbols later */
168+
.stack_dummy (COPY):
169+
{
170+
*(.stack*)
171+
} > RAM
172+
173+
/* Set stack top to end of RAM, and stack limit move down by
174+
* size of stack_dummy section */
175+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
176+
_estack = __StackTop;
177+
__StackLimit = __StackTop - STACK_SIZE;
178+
PROVIDE(__stack = __StackTop);
179+
180+
/* Check if data + heap + stack exceeds RAM limit */
181+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
182+
}

0 commit comments

Comments
 (0)