Skip to content

Commit c1ee7fb

Browse files
authored
Merge pull request #2504 from ohagendorf/disco_f769_ii
[Disco_F769NI] adding new target
2 parents 7198385 + 765aeb0 commit c1ee7fb

File tree

32 files changed

+16530
-17
lines changed

32 files changed

+16530
-17
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
#include "stm32f7xx_hal.h"
2+
3+
/**
4+
* Override HAL Eth Init function
5+
*/
6+
void HAL_ETH_MspInit(ETH_HandleTypeDef* heth)
7+
{
8+
GPIO_InitTypeDef GPIO_InitStructure;
9+
if (heth->Instance == ETH) {
10+
11+
/* Enable GPIOs clocks */
12+
__HAL_RCC_GPIOA_CLK_ENABLE();
13+
__HAL_RCC_GPIOC_CLK_ENABLE();
14+
__HAL_RCC_GPIOD_CLK_ENABLE();
15+
__HAL_RCC_GPIOG_CLK_ENABLE();
16+
17+
/** ETH GPIO Configuration
18+
RMII_REF_CLK ----------------------> PA1
19+
RMII_MDIO -------------------------> PA2
20+
RMII_MDC --------------------------> PC1
21+
RMII_MII_CRS_DV -------------------> PA7
22+
RMII_MII_RXD0 ---------------------> PC4
23+
RMII_MII_RXD1 ---------------------> PC5
24+
RMII_MII_RXER ---------------------> PD5
25+
RMII_MII_TX_EN --------------------> PG11
26+
RMII_MII_TXD0 ---------------------> PG13
27+
RMII_MII_TXD1 ---------------------> PG14
28+
*/
29+
/* Configure PA1, PA2 and PA7 */
30+
GPIO_InitStructure.Speed = GPIO_SPEED_HIGH;
31+
GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
32+
GPIO_InitStructure.Pull = GPIO_NOPULL;
33+
GPIO_InitStructure.Alternate = GPIO_AF11_ETH;
34+
GPIO_InitStructure.Pin = GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_7;
35+
HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
36+
37+
/* Configure PC1, PC4 and PC5 */
38+
GPIO_InitStructure.Pin = GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5;
39+
HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
40+
41+
/* Configure PD5 */
42+
GPIO_InitStructure.Pin = GPIO_PIN_5;
43+
HAL_GPIO_Init(GPIOD, &GPIO_InitStructure);
44+
45+
/* Configure PG11, PG13 and PG14 */
46+
GPIO_InitStructure.Pin = GPIO_PIN_11 | GPIO_PIN_13 | GPIO_PIN_14;
47+
HAL_GPIO_Init(GPIOG, &GPIO_InitStructure);
48+
49+
/* Enable the Ethernet global Interrupt */
50+
HAL_NVIC_SetPriority(ETH_IRQn, 0x7, 0);
51+
HAL_NVIC_EnableIRQ(ETH_IRQn);
52+
53+
/* Enable ETHERNET clock */
54+
__HAL_RCC_ETH_CLK_ENABLE();
55+
}
56+
}
57+
58+
/**
59+
* Override HAL Eth DeInit function
60+
*/
61+
void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
62+
{
63+
if (heth->Instance == ETH) {
64+
/* Peripheral clock disable */
65+
__HAL_RCC_ETH_CLK_DISABLE();
66+
67+
/** ETH GPIO Configuration
68+
RMII_REF_CLK ----------------------> PA1
69+
RMII_MDIO -------------------------> PA2
70+
RMII_MDC --------------------------> PC1
71+
RMII_MII_CRS_DV -------------------> PA7
72+
RMII_MII_RXD0 ---------------------> PC4
73+
RMII_MII_RXD1 ---------------------> PC5
74+
RMII_MII_RXER ---------------------> PD5
75+
RMII_MII_TX_EN --------------------> PG11
76+
RMII_MII_TXD0 ---------------------> PG13
77+
RMII_MII_TXD1 ---------------------> PG14
78+
*/
79+
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_7);
80+
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_1 | GPIO_PIN_4 | GPIO_PIN_5);
81+
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_5);
82+
HAL_GPIO_DeInit(GPIOG, GPIO_PIN_11 | GPIO_PIN_13 | GPIO_PIN_14);
83+
84+
/* Disable the Ethernet global Interrupt */
85+
NVIC_DisableIRQ(ETH_IRQn);
86+
}
87+
}

hal/targets.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,18 @@
11111111
"features": ["IPV4"],
11121112
"release_versions": ["2", "5"]
11131113
},
1114+
"DISCO_F769NI": {
1115+
"inherits": ["Target"],
1116+
"core": "Cortex-M7FD",
1117+
"extra_labels": ["STM", "STM32F7", "STM32F769", "STM32F769NI"],
1118+
"supported_toolchains": ["ARM", "GCC_ARM", "IAR"],
1119+
"default_toolchain": "ARM",
1120+
"progen": {"target": "disco-f769ni"},
1121+
"detect_code": ["0817"],
1122+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
1123+
"features": ["IPV4"],
1124+
"release_versions": ["2"]
1125+
},
11141126
"DISCO_L476VG": {
11151127
"inherits": ["Target"],
11161128
"core": "Cortex-M4F",

hal/targets/cmsis/TARGET_STM/TARGET_STM32F7/TARGET_DISCO_F769NI/TOOLCHAIN_ARM_STD/startup_stm32f769xx.S

Lines changed: 479 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
; Scatter-Loading Description File
2+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3+
; Copyright (c) 2016, STMicroelectronics
4+
; All rights reserved.
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,
10+
; this list of conditions and the following disclaimer.
11+
; 2. Redistributions in binary form must reproduce the above copyright notice,
12+
; this list of conditions and the following disclaimer in the documentation
13+
; and/or other materials provided with the distribution.
14+
; 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
; may be used to endorse or promote products derived from this software
16+
; without specific prior written permission.
17+
;
18+
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
29+
30+
; STM32F769NI: 2048 KB FLASH (0x200000) + 512 KB SRAM (0x80000)
31+
LR_IROM1 0x08000000 0x200000 { ; load region size_region
32+
33+
ER_IROM1 0x08000000 0x200000 { ; load address = execution address
34+
*.o (RESET, +First)
35+
*(InRoot$$Sections)
36+
.ANY (+RO)
37+
}
38+
39+
; Total: 126 vectors = 504 bytes (0x1F8) to be reserved in RAM
40+
RW_IRAM1 (0x20000000+0x1F8) (0x80000-0x1F8) { ; RW data
41+
.ANY (+RW +ZI)
42+
}
43+
44+
}
45+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/* mbed Microcontroller Library - stackheap
2+
* Setup a fixed single stack/heap memory model,
3+
* between the top of the RW/ZI region and the stackpointer
4+
*******************************************************************************
5+
* Copyright (c) 2014, STMicroelectronics
6+
* All rights reserved.
7+
*
8+
* Redistribution and use in source and binary forms, with or without
9+
* modification, are permitted provided that the following conditions are met:
10+
*
11+
* 1. Redistributions of source code must retain the above copyright notice,
12+
* this list of conditions and the following disclaimer.
13+
* 2. Redistributions in binary form must reproduce the above copyright notice,
14+
* this list of conditions and the following disclaimer in the documentation
15+
* and/or other materials provided with the distribution.
16+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
17+
* may be used to endorse or promote products derived from this software
18+
* 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 ARE
23+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
*******************************************************************************
31+
*/
32+
33+
#ifdef __cplusplus
34+
extern "C" {
35+
#endif
36+
37+
#include <rt_misc.h>
38+
#include <stdint.h>
39+
40+
extern char Image$$RW_IRAM1$$ZI$$Limit[];
41+
42+
extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) {
43+
uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit;
44+
uint32_t sp_limit = __current_sp();
45+
46+
zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned
47+
48+
struct __initial_stackheap r;
49+
r.heap_base = zi_limit;
50+
r.heap_limit = sp_limit;
51+
return r;
52+
}
53+
54+
#ifdef __cplusplus
55+
}
56+
#endif
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/* Linker script to configure memory regions. */
2+
MEMORY
3+
{
4+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K
5+
RAM (rwx) : ORIGIN = 0x200001F8, LENGTH = 512K - 0x1F8
6+
}
7+
8+
/* Linker script to place sections and symbol values. Should be used together
9+
* with other linker script that defines memory regions FLASH and RAM.
10+
* It references following symbols, which must be defined in code:
11+
* Reset_Handler : Entry of reset handler
12+
*
13+
* It defines following symbols, which code can use without definition:
14+
* __exidx_start
15+
* __exidx_end
16+
* __etext
17+
* __data_start__
18+
* __preinit_array_start
19+
* __preinit_array_end
20+
* __init_array_start
21+
* __init_array_end
22+
* __fini_array_start
23+
* __fini_array_end
24+
* __data_end__
25+
* __bss_start__
26+
* __bss_end__
27+
* __end__
28+
* end
29+
* __HeapLimit
30+
* __StackLimit
31+
* __StackTop
32+
* __stack
33+
* _estack
34+
*/
35+
ENTRY(Reset_Handler)
36+
37+
SECTIONS
38+
{
39+
.text :
40+
{
41+
KEEP(*(.isr_vector))
42+
*(.text*)
43+
KEEP(*(.init))
44+
KEEP(*(.fini))
45+
46+
/* .ctors */
47+
*crtbegin.o(.ctors)
48+
*crtbegin?.o(.ctors)
49+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
50+
*(SORT(.ctors.*))
51+
*(.ctors)
52+
53+
/* .dtors */
54+
*crtbegin.o(.dtors)
55+
*crtbegin?.o(.dtors)
56+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
57+
*(SORT(.dtors.*))
58+
*(.dtors)
59+
60+
*(.rodata*)
61+
62+
KEEP(*(.eh_frame*))
63+
} > FLASH
64+
65+
.ARM.extab :
66+
{
67+
*(.ARM.extab* .gnu.linkonce.armextab.*)
68+
} > FLASH
69+
70+
__exidx_start = .;
71+
.ARM.exidx :
72+
{
73+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
74+
} > FLASH
75+
__exidx_end = .;
76+
77+
__etext = .;
78+
_sidata = .;
79+
80+
.data : AT (__etext)
81+
{
82+
__data_start__ = .;
83+
_sdata = .;
84+
*(vtable)
85+
*(.data*)
86+
87+
. = ALIGN(4);
88+
/* preinit data */
89+
PROVIDE_HIDDEN (__preinit_array_start = .);
90+
KEEP(*(.preinit_array))
91+
PROVIDE_HIDDEN (__preinit_array_end = .);
92+
93+
. = ALIGN(4);
94+
/* init data */
95+
PROVIDE_HIDDEN (__init_array_start = .);
96+
KEEP(*(SORT(.init_array.*)))
97+
KEEP(*(.init_array))
98+
PROVIDE_HIDDEN (__init_array_end = .);
99+
100+
101+
. = ALIGN(4);
102+
/* finit data */
103+
PROVIDE_HIDDEN (__fini_array_start = .);
104+
KEEP(*(SORT(.fini_array.*)))
105+
KEEP(*(.fini_array))
106+
PROVIDE_HIDDEN (__fini_array_end = .);
107+
108+
KEEP(*(.jcr*))
109+
. = ALIGN(4);
110+
/* All data end */
111+
__data_end__ = .;
112+
_edata = .;
113+
114+
} > RAM
115+
116+
.bss :
117+
{
118+
. = ALIGN(4);
119+
__bss_start__ = .;
120+
_sbss = .;
121+
*(.bss*)
122+
*(COMMON)
123+
. = ALIGN(4);
124+
__bss_end__ = .;
125+
_ebss = .;
126+
} > RAM
127+
128+
.heap (COPY):
129+
{
130+
__end__ = .;
131+
end = __end__;
132+
*(.heap*)
133+
__HeapLimit = .;
134+
} > RAM
135+
136+
/* .stack_dummy section doesn't contains any symbols. It is only
137+
* used for linker to calculate size of stack sections, and assign
138+
* values to stack symbols later */
139+
.stack_dummy (COPY):
140+
{
141+
*(.stack*)
142+
} > RAM
143+
144+
/* Set stack top to end of RAM, and stack limit move down by
145+
* size of stack_dummy section */
146+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
147+
_estack = __StackTop;
148+
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
149+
PROVIDE(__stack = __StackTop);
150+
151+
/* Check if data + heap + stack exceeds RAM limit */
152+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
153+
}

0 commit comments

Comments
 (0)