Skip to content

Commit 3dff531

Browse files
committed
Merge remote-tracking branch 'refs/remotes/mbedmicro/master' into dev_nucleo_f303k8
2 parents d7ab336 + 3f2632b commit 3dff531

File tree

234 files changed

+8310
-5757
lines changed

Some content is hidden

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

234 files changed

+8310
-5757
lines changed

libraries/mbed/api/mbed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#ifndef MBED_H
1717
#define MBED_H
1818

19-
#define MBED_LIBRARY_VERSION 106
19+
#define MBED_LIBRARY_VERSION 108
2020

2121
#include "platform.h"
2222

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
2+
OUTPUT_ARCH(arm)
3+
SEARCH_DIR(.)
4+
5+
/* Memory Spaces Definitions */
6+
MEMORY
7+
{
8+
rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000
9+
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000
10+
}
11+
12+
/* The stack size used by the application. NOTE: you need to adjust according to your application. */
13+
STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x2000;
14+
15+
/* Section Definitions */
16+
SECTIONS
17+
{
18+
.text :
19+
{
20+
. = ALIGN(4);
21+
_sfixed = .;
22+
KEEP(*(.vectors .vectors.*))
23+
*(.text .text.* .gnu.linkonce.t.*)
24+
*(.glue_7t) *(.glue_7)
25+
*(.rodata .rodata* .gnu.linkonce.r.*)
26+
*(.ARM.extab* .gnu.linkonce.armextab.*)
27+
28+
/* Support C constructors, and C destructors in both user code
29+
and the C library. This also provides support for C++ code. */
30+
. = ALIGN(4);
31+
KEEP(*(.init))
32+
. = ALIGN(4);
33+
__preinit_array_start = .;
34+
KEEP (*(.preinit_array))
35+
__preinit_array_end = .;
36+
37+
. = ALIGN(4);
38+
__init_array_start = .;
39+
KEEP (*(SORT(.init_array.*)))
40+
KEEP (*(.init_array))
41+
__init_array_end = .;
42+
43+
. = ALIGN(4);
44+
KEEP (*crtbegin.o(.ctors))
45+
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
46+
KEEP (*(SORT(.ctors.*)))
47+
KEEP (*crtend.o(.ctors))
48+
49+
. = ALIGN(4);
50+
KEEP(*(.fini))
51+
52+
. = ALIGN(4);
53+
__fini_array_start = .;
54+
KEEP (*(.fini_array))
55+
KEEP (*(SORT(.fini_array.*)))
56+
__fini_array_end = .;
57+
58+
KEEP (*crtbegin.o(.dtors))
59+
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
60+
KEEP (*(SORT(.dtors.*)))
61+
KEEP (*crtend.o(.dtors))
62+
63+
. = ALIGN(4);
64+
_efixed = .; /* End of text section */
65+
} > rom
66+
67+
/* .ARM.exidx is sorted, so has to go in its own output section. */
68+
PROVIDE_HIDDEN (__exidx_start = .);
69+
.ARM.exidx :
70+
{
71+
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
72+
} > rom
73+
PROVIDE_HIDDEN (__exidx_end = .);
74+
75+
. = ALIGN(4);
76+
_etext = .;
77+
78+
.dvectors (NOLOAD) :
79+
{
80+
_sdvectors = .;
81+
. = . + 0xB0;
82+
_edvectors = .;
83+
} > ram
84+
85+
.relocate : AT (_etext)
86+
{
87+
. = ALIGN(4);
88+
_srelocate = .;
89+
*(.ramfunc .ramfunc.*);
90+
*(.data .data.*);
91+
. = ALIGN(4);
92+
_erelocate = .;
93+
} > ram
94+
95+
/* .bss section which is used for uninitialized data */
96+
.bss (NOLOAD) :
97+
{
98+
. = ALIGN(4);
99+
_sbss = . ;
100+
_szero = .;
101+
*(.bss .bss.*)
102+
*(COMMON)
103+
. = ALIGN(4);
104+
_ebss = . ;
105+
_ezero = .;
106+
} > ram
107+
108+
.heap (NOLOAD) :
109+
{
110+
. = ALIGN(4);
111+
__end__ = . ;
112+
. = ORIGIN(ram) + LENGTH(ram) - STACK_SIZE;
113+
} > ram
114+
115+
/* stack section */
116+
.stack (NOLOAD):
117+
{
118+
. = ALIGN(8);
119+
_sstack = .;
120+
. = . + STACK_SIZE;
121+
. = ALIGN(8);
122+
_estack = .;
123+
} > ram
124+
125+
. = ALIGN(4);
126+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
#include "samd21.h"
2+
3+
/* Initialize segments */
4+
extern uint32_t _sfixed;
5+
extern uint32_t _efixed;
6+
extern uint32_t _etext;
7+
extern uint32_t _srelocate;
8+
extern uint32_t _erelocate;
9+
extern uint32_t _szero;
10+
extern uint32_t _ezero;
11+
extern uint32_t _sstack;
12+
extern uint32_t _estack;
13+
14+
/** \cond DOXYGEN_SHOULD_SKIP_THIS */
15+
int main(void);
16+
/** \endcond */
17+
18+
void __libc_init_array(void);
19+
20+
/* Default empty handler */
21+
void Dummy_Handler(void);
22+
23+
/* Cortex-M0+ core handlers */
24+
void NMI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
25+
void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
26+
void SVC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
27+
void PendSV_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
28+
void SysTick_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
29+
30+
/* Peripherals handlers */
31+
void PM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
32+
void SYSCTRL_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
33+
void WDT_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
34+
void RTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
35+
void EIC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
36+
void NVMCTRL_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
37+
void DMAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
38+
void USB_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
39+
void EVSYS_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
40+
void SERCOM0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
41+
void SERCOM1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
42+
void SERCOM2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
43+
void SERCOM3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
44+
void SERCOM4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
45+
void SERCOM5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
46+
void TCC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
47+
void TCC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
48+
void TCC2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
49+
void TC3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
50+
void TC4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
51+
void TC5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
52+
void TC6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
53+
void TC7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
54+
void ADC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
55+
void AC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
56+
void DAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
57+
void PTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
58+
void I2S_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler")));
59+
60+
/* Exception Table */
61+
__attribute__ ((section(".vectors")))
62+
const DeviceVectors exception_table = {
63+
64+
/* Configure Initial Stack Pointer, using linker-generated symbols */
65+
(void*) (&_estack),
66+
67+
(void*) Reset_Handler,
68+
(void*) NMI_Handler,
69+
(void*) HardFault_Handler,
70+
(void*) (0UL), /* Reserved */
71+
(void*) (0UL), /* Reserved */
72+
(void*) (0UL), /* Reserved */
73+
(void*) (0UL), /* Reserved */
74+
(void*) (0UL), /* Reserved */
75+
(void*) (0UL), /* Reserved */
76+
(void*) (0UL), /* Reserved */
77+
(void*) SVC_Handler,
78+
(void*) (0UL), /* Reserved */
79+
(void*) (0UL), /* Reserved */
80+
(void*) PendSV_Handler,
81+
(void*) SysTick_Handler,
82+
83+
/* Configurable interrupts */
84+
(void*) PM_Handler, /* 0 Power Manager */
85+
(void*) SYSCTRL_Handler, /* 1 System Control */
86+
(void*) WDT_Handler, /* 2 Watchdog Timer */
87+
(void*) RTC_Handler, /* 3 Real-Time Counter */
88+
(void*) EIC_Handler, /* 4 External Interrupt Controller */
89+
(void*) NVMCTRL_Handler, /* 5 Non-Volatile Memory Controller */
90+
(void*) DMAC_Handler, /* 6 Direct Memory Access Controller */
91+
(void*) USB_Handler, /* 7 Universal Serial Bus */
92+
(void*) EVSYS_Handler, /* 8 Event System Interface */
93+
(void*) SERCOM0_Handler, /* 9 Serial Communication Interface 0 */
94+
(void*) SERCOM1_Handler, /* 10 Serial Communication Interface 1 */
95+
(void*) SERCOM2_Handler, /* 11 Serial Communication Interface 2 */
96+
(void*) SERCOM3_Handler, /* 12 Serial Communication Interface 3 */
97+
(void*) SERCOM4_Handler, /* 13 Serial Communication Interface 4 */
98+
(void*) SERCOM5_Handler, /* 14 Serial Communication Interface 5 */
99+
(void*) TCC0_Handler, /* 15 Timer Counter Control 0 */
100+
(void*) TCC1_Handler, /* 16 Timer Counter Control 1 */
101+
(void*) TCC2_Handler, /* 17 Timer Counter Control 2 */
102+
(void*) TC3_Handler, /* 18 Basic Timer Counter 0 */
103+
(void*) TC4_Handler, /* 19 Basic Timer Counter 1 */
104+
(void*) TC5_Handler, /* 20 Basic Timer Counter 2 */
105+
(void*) TC6_Handler, /* 21 Basic Timer Counter 3 */
106+
(void*) TC7_Handler, /* 22 Basic Timer Counter 4 */
107+
(void*) ADC_Handler, /* 23 Analog Digital Converter */
108+
(void*) AC_Handler, /* 24 Analog Comparators */
109+
(void*) DAC_Handler, /* 25 Digital Analog Converter */
110+
(void*) PTC_Handler, /* 26 Peripheral Touch Controller */
111+
(void*) I2S_Handler /* 27 Inter-IC Sound Interface */
112+
};
113+
114+
/**
115+
* \brief This is the code that gets called on processor reset.
116+
* To initialize the device, and call the main() routine.
117+
*/
118+
void Reset_Handler(void)
119+
{
120+
uint32_t *pSrc, *pDest;
121+
122+
/* Initialize the relocate segment */
123+
pSrc = &_etext;
124+
pDest = &_srelocate;
125+
126+
if (pSrc != pDest) {
127+
for (; pDest < &_erelocate;) {
128+
*pDest++ = *pSrc++;
129+
}
130+
}
131+
132+
/* Clear the zero segment */
133+
for (pDest = &_szero; pDest < &_ezero;) {
134+
*pDest++ = 0;
135+
}
136+
137+
/* Set the vector table base address */
138+
pSrc = (uint32_t *) & _sfixed;
139+
SCB->VTOR = ((uint32_t) pSrc & SCB_VTOR_TBLOFF_Msk);
140+
141+
/* Initialize the C library */
142+
__libc_init_array();
143+
144+
/* Branch to main function */ // expected to be done by MBED OS
145+
main();
146+
147+
/* Infinite loop */
148+
while (1);
149+
}
150+
151+
/**
152+
* \brief Default interrupt handler for unused IRQs.
153+
*/
154+
void Dummy_Handler(void)
155+
{
156+
while (1) {
157+
}
158+
}

0 commit comments

Comments
 (0)