2
2
* FreeRTOS V202112.00
3
3
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
*
5
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- * this software and associated documentation files (the "Software"), to deal in
7
- * the Software without restriction, including without limitation the rights to
8
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- * the Software, and to permit persons to whom the Software is furnished to do so,
10
- * subject to the following conditions:
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
11
*
12
- * The above copyright notice and this permission notice shall be included in all
13
- * copies or substantial portions of the Software.
12
+ * The above copyright notice and this permission notice shall be included in
13
+ * all copies or substantial portions of the Software.
14
14
*
15
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
21
22
*
22
23
* https://www.FreeRTOS.org
23
24
* https://github.com/FreeRTOS
@@ -31,84 +32,76 @@ extern int main();
31
32
extern uint32_t _estack , _sidata , _sdata , _edata , _sbss , _ebss ;
32
33
33
34
/* Prevent optimization so gcc does not replace code with memcpy */
34
- __attribute__( ( optimize ( "O0" ) ) )
35
- __attribute__( ( naked ) )
36
- void Reset_Handler ( void )
37
- {
38
- /* set stack pointer */
39
- __asm volatile ( "ldr r0, =_estack" );
40
- __asm volatile ( "mov sp, r0" );
35
+ __attribute__((optimize ("O0" ))) __attribute__((naked )) void Reset_Handler (
36
+ void ) {
37
+ /* set stack pointer */
38
+ __asm volatile ("ldr r0, =_estack" );
39
+ __asm volatile ("mov sp, r0" );
41
40
42
- /* copy .data section from flash to RAM */
43
- // Not needed for this example, see linker script
44
- // for( uint32_t * src = &_sidata, * dest = &_sdata; dest < &_edata; )
45
- // {
46
- // *dest++ = *src++;
47
- // }
41
+ /* copy .data section from flash to RAM */
42
+ // Not needed for this example, see linker script
43
+ // for( uint32_t * src = &_sidata, * dest = &_sdata; dest < &_edata; )
44
+ // {
45
+ // *dest++ = *src++;
46
+ // }
48
47
49
- /* zero out .bss section */
50
- for ( uint32_t * dest = & _sbss ; dest < & _ebss ; )
51
- {
52
- * dest ++ = 0 ;
53
- }
48
+ /* zero out .bss section */
49
+ for (uint32_t * dest = & _sbss ; dest < & _ebss ;) {
50
+ * dest ++ = 0 ;
51
+ }
54
52
55
- /* jump to board initialisation */
56
- void _start ( void );
57
- _start ();
53
+ /* jump to board initialisation */
54
+ void _start (void );
55
+ _start ();
58
56
}
59
57
60
- const uint32_t * isr_vector [] __attribute__( ( section ( ".isr_vector" ) ) ) =
61
- {
62
- ( uint32_t * ) & _estack ,
63
- ( uint32_t * ) & Reset_Handler , /* Reset -15 */
64
- 0 , /* NMI_Handler -14 */
65
- 0 , /* HardFault_Handler -13 */
66
- 0 , /* MemManage_Handler -12 */
67
- 0 , /* BusFault_Handler -11 */
68
- 0 , /* UsageFault_Handler -10 */
69
- 0 , /* reserved */
70
- 0 , /* reserved */
71
- 0 , /* reserved */
72
- 0 , /* reserved -6 */
73
- 0 , /* SVC_Handler -5 */
74
- 0 , /* DebugMon_Handler -4 */
75
- 0 , /* reserved */
76
- 0 , /* PendSV handler -2 */
77
- 0 , /* SysTick_Handler -1 */
78
- 0 , /* uart0 receive 0 */
79
- 0 , /* uart0 transmit */
80
- 0 , /* uart1 receive */
81
- 0 , /* uart1 transmit */
82
- 0 , /* uart 2 receive */
83
- 0 , /* uart 2 transmit */
84
- 0 , /* GPIO 0 combined interrupt */
85
- 0 , /* GPIO 2 combined interrupt */
86
- 0 , /* Timer 0 */
87
- 0 , /* Timer 1 */
88
- 0 , /* Dial Timer */
89
- 0 , /* SPI0 SPI1 */
90
- 0 , /* uart overflow 1, 2,3 */
91
- 0 , /* Ethernet 13 */
58
+ const uint32_t * isr_vector [] __attribute__((section (".isr_vector" ))) = {
59
+ (uint32_t * )& _estack ,
60
+ (uint32_t * )& Reset_Handler , /* Reset -15 */
61
+ 0 , /* NMI_Handler -14 */
62
+ 0 , /* HardFault_Handler -13 */
63
+ 0 , /* MemManage_Handler -12 */
64
+ 0 , /* BusFault_Handler -11 */
65
+ 0 , /* UsageFault_Handler -10 */
66
+ 0 , /* reserved */
67
+ 0 , /* reserved */
68
+ 0 , /* reserved */
69
+ 0 , /* reserved -6 */
70
+ 0 , /* SVC_Handler -5 */
71
+ 0 , /* DebugMon_Handler -4 */
72
+ 0 , /* reserved */
73
+ 0 , /* PendSV handler -2 */
74
+ 0 , /* SysTick_Handler -1 */
75
+ 0 , /* uart0 receive 0 */
76
+ 0 , /* uart0 transmit */
77
+ 0 , /* uart1 receive */
78
+ 0 , /* uart1 transmit */
79
+ 0 , /* uart 2 receive */
80
+ 0 , /* uart 2 transmit */
81
+ 0 , /* GPIO 0 combined interrupt */
82
+ 0 , /* GPIO 2 combined interrupt */
83
+ 0 , /* Timer 0 */
84
+ 0 , /* Timer 1 */
85
+ 0 , /* Dial Timer */
86
+ 0 , /* SPI0 SPI1 */
87
+ 0 , /* uart overflow 1, 2,3 */
88
+ 0 , /* Ethernet 13 */
92
89
};
93
90
94
- __attribute__( ( naked ) ) void exit (__attribute__((unused )) int status )
95
- {
96
- /* Force qemu to exit using ARM Semihosting */
97
- __asm volatile (
98
- "mov r1, r0\n"
99
- "cmp r1, #0\n"
100
- "bne .notclean\n"
101
- "ldr r1, =0x20026\n" /* ADP_Stopped_ApplicationExit, a clean exit */
102
- ".notclean:\n"
103
- "movs r0, #0x18\n" /* SYS_EXIT */
104
- "bkpt 0xab\n"
105
- "end: b end\n"
106
- );
91
+ __attribute__((naked )) void exit (__attribute__((unused )) int status ) {
92
+ /* Force qemu to exit using ARM Semihosting */
93
+ __asm volatile (
94
+ "mov r1, r0\n"
95
+ "cmp r1, #0\n"
96
+ "bne .notclean\n"
97
+ "ldr r1, =0x20026\n" /* ADP_Stopped_ApplicationExit, a clean exit */
98
+ ".notclean:\n"
99
+ "movs r0, #0x18\n" /* SYS_EXIT */
100
+ "bkpt 0xab\n"
101
+ "end: b end\n" );
107
102
}
108
103
109
- void _start ( void )
110
- {
111
- main ( );
112
- exit ( 0 );
104
+ void _start (void ) {
105
+ main ();
106
+ exit (0 );
113
107
}
114
-
0 commit comments