Skip to content

Commit 57ebf8b

Browse files
authored
Merge pull request #2548 from jamike/NUCLEO_F303ZE
Nucleof303ze
2 parents a6b2731 + 9d3e34e commit 57ebf8b

File tree

41 files changed

+19694
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+19694
-32
lines changed

hal/targets.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,19 @@
744744
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
745745
"release_versions": ["2", "5"]
746746
},
747+
"NUCLEO_F303ZE": {
748+
"supported_form_factors": ["ARDUINO", "MORPHO"],
749+
"core": "Cortex-M4F",
750+
"fpu": "single",
751+
"default_toolchain": "uARM",
752+
"extra_labels": ["STM", "STM32F3", "STM32F303ZE"],
753+
"supported_toolchains": ["ARM", "uARM", "IAR", "GCC_ARM"],
754+
"inherits": ["Target"],
755+
"progen": {"target": "nucleo-f303ze"},
756+
"detect_code": ["0745"],
757+
"device_has": ["ANALOGIN", "ANALOGOUT", "CAN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
758+
"release_versions": ["2"]
759+
},
747760
"NUCLEO_F334R8": {
748761
"supported_form_factors": ["ARDUINO", "MORPHO"],
749762
"core": "Cortex-M4F",

hal/targets/cmsis/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303ZE/TOOLCHAIN_ARM_MICRO/startup_stm32f303xe.S

Lines changed: 407 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) 2014, 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+
; STM32F303RE: 512KB FLASH (0x80000) + 64KB SRAM (0x10000)
31+
LR_IROM1 0x08000000 0x80000 { ; load region size_region
32+
33+
ER_IROM1 0x08000000 0x80000 { ; load address = execution address
34+
*.o (RESET, +First)
35+
*(InRoot$$Sections)
36+
.ANY (+RO)
37+
}
38+
39+
; 101 vectors = 404 bytes (0x194) to be reserved in RAM
40+
RW_IRAM1 (0x20000000+0x194) (0x10000-0x194) { ; RW data
41+
.ANY (+RW +ZI)
42+
}
43+
44+
}
45+

hal/targets/cmsis/TARGET_STM/TARGET_STM32F3/TARGET_NUCLEO_F303ZE/TOOLCHAIN_ARM_STD/startup_stm32f303xe.S

Lines changed: 380 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) 2014, 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+
; STM32F303RE: 512KB FLASH (0x80000) + 64KB SRAM (0x10000)
31+
LR_IROM1 0x08000000 0x80000 { ; load region size_region
32+
33+
ER_IROM1 0x08000000 0x80000 { ; load address = execution address
34+
*.o (RESET, +First)
35+
*(InRoot$$Sections)
36+
.ANY (+RO)
37+
}
38+
39+
; 101 vectors = 404 bytes (0x194) to be reserved in RAM
40+
RW_IRAM1 (0x20000000+0x194) (0x10000-0x194) { ; 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: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/* Linker script to configure memory regions. */
2+
MEMORY
3+
{
4+
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
5+
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 16K
6+
RAM (rwx) : ORIGIN = 0x20000194, LENGTH = 64K - 0x194
7+
}
8+
9+
/* Linker script to place sections and symbol values. Should be used together
10+
* with other linker script that defines memory regions FLASH and RAM.
11+
* It references following symbols, which must be defined in code:
12+
* Reset_Handler : Entry of reset handler
13+
*
14+
* It defines following symbols, which code can use without definition:
15+
* __exidx_start
16+
* __exidx_end
17+
* __etext
18+
* __data_start__
19+
* __preinit_array_start
20+
* __preinit_array_end
21+
* __init_array_start
22+
* __init_array_end
23+
* __fini_array_start
24+
* __fini_array_end
25+
* __data_end__
26+
* __bss_start__
27+
* __bss_end__
28+
* __end__
29+
* end
30+
* __HeapLimit
31+
* __StackLimit
32+
* __StackTop
33+
* __stack
34+
* _estack
35+
*/
36+
ENTRY(Reset_Handler)
37+
38+
SECTIONS
39+
{
40+
.text :
41+
{
42+
KEEP(*(.isr_vector))
43+
*(.text*)
44+
KEEP(*(.init))
45+
KEEP(*(.fini))
46+
47+
/* .ctors */
48+
*crtbegin.o(.ctors)
49+
*crtbegin?.o(.ctors)
50+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
51+
*(SORT(.ctors.*))
52+
*(.ctors)
53+
54+
/* .dtors */
55+
*crtbegin.o(.dtors)
56+
*crtbegin?.o(.dtors)
57+
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
58+
*(SORT(.dtors.*))
59+
*(.dtors)
60+
61+
*(.rodata*)
62+
63+
KEEP(*(.eh_frame*))
64+
} > FLASH
65+
66+
.ARM.extab :
67+
{
68+
*(.ARM.extab* .gnu.linkonce.armextab.*)
69+
} > FLASH
70+
71+
__exidx_start = .;
72+
.ARM.exidx :
73+
{
74+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
75+
} > FLASH
76+
__exidx_end = .;
77+
78+
__etext = .;
79+
_sidata = .;
80+
81+
.data : AT (__etext)
82+
{
83+
__data_start__ = .;
84+
_sdata = .;
85+
*(vtable)
86+
*(.data*)
87+
88+
. = ALIGN(4);
89+
/* preinit data */
90+
PROVIDE_HIDDEN (__preinit_array_start = .);
91+
KEEP(*(.preinit_array))
92+
PROVIDE_HIDDEN (__preinit_array_end = .);
93+
94+
. = ALIGN(4);
95+
/* init data */
96+
PROVIDE_HIDDEN (__init_array_start = .);
97+
KEEP(*(SORT(.init_array.*)))
98+
KEEP(*(.init_array))
99+
PROVIDE_HIDDEN (__init_array_end = .);
100+
101+
102+
. = ALIGN(4);
103+
/* finit data */
104+
PROVIDE_HIDDEN (__fini_array_start = .);
105+
KEEP(*(SORT(.fini_array.*)))
106+
KEEP(*(.fini_array))
107+
PROVIDE_HIDDEN (__fini_array_end = .);
108+
109+
KEEP(*(.jcr*))
110+
. = ALIGN(4);
111+
/* All data end */
112+
__data_end__ = .;
113+
_edata = .;
114+
115+
} > RAM
116+
117+
.bss :
118+
{
119+
. = ALIGN(4);
120+
__bss_start__ = .;
121+
_sbss = .;
122+
*(.bss*)
123+
*(COMMON)
124+
. = ALIGN(4);
125+
__bss_end__ = .;
126+
_ebss = .;
127+
} > RAM
128+
129+
.heap (COPY):
130+
{
131+
__end__ = .;
132+
end = __end__;
133+
*(.heap*)
134+
__HeapLimit = .;
135+
} > RAM
136+
137+
/* .stack_dummy section doesn't contains any symbols. It is only
138+
* used for linker to calculate size of stack sections, and assign
139+
* values to stack symbols later */
140+
.stack_dummy (COPY):
141+
{
142+
*(.stack*)
143+
} > RAM
144+
145+
/* Set stack top to end of RAM, and stack limit move down by
146+
* size of stack_dummy section */
147+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
148+
_estack = __StackTop;
149+
__StackLimit = __StackTop - SIZEOF(.stack_dummy);
150+
PROVIDE(__stack = __StackTop);
151+
152+
/* Check if data + heap + stack exceeds RAM limit */
153+
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
154+
}
155+

0 commit comments

Comments
 (0)