Skip to content

Commit 796c493

Browse files
committed
[BSP] Fix the gcc compiling issue in LPC408x bsp
1 parent 3bf721a commit 796c493

File tree

4 files changed

+31
-23
lines changed

4 files changed

+31
-23
lines changed

bsp/lpc408x/Libraries/Device/NXP/LPC407x_8x_177x_8x/Source/Templates/GCC/startup_LPC407x_8x_177x_8x.s

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,18 @@ __cs3_interrupt_vector_cortex_m:
102102
.long DMA_IRQHandler /* 42: General Purpose DMA */
103103
.long I2S_IRQHandler /* 43: I2S */
104104
.long ENET_IRQHandler /* 44: Ethernet */
105-
.long MCI_IRQHandler /* 45: SD/MMC Card */
105+
.long MCI_IRQHandler /* 45: SD/MMC Card */
106106
.long MCPWM_IRQHandler /* 46: Motor Control PWM */
107107
.long QEI_IRQHandler /* 47: Quadrature Encoder Interface */
108108
.long PLL1_IRQHandler /* 48: PLL1 Lock (USB PLL) */
109-
.long USBActivity_IRQHandler /* 49: USB Activity */
110-
.long CANActivity_IRQHandler /* 50: CAN Activity */
111-
.long UART4_IRQHandler /* 51: UART4 */
112-
.long SSP2_IRQHandler /* 52: SSP2 */
113-
.long LCD_IRQHandler /* 53: LCD */
114-
.long GPIO_IRQHandler /* 54: GPIO */
115-
.long PWM0_IRQHandler /* 55: PWM0 */
116-
.long EEPROM_IRQHandler /* 56: EEPROM */
109+
.long USBActivity_IRQHandler /* 49: USB Activity */
110+
.long CANActivity_IRQHandler /* 50: CAN Activity */
111+
.long UART4_IRQHandler /* 51: UART4 */
112+
.long SSP2_IRQHandler /* 52: SSP2 */
113+
.long LCD_IRQHandler /* 53: LCD */
114+
.long GPIO_IRQHandler /* 54: GPIO */
115+
.long PWM0_IRQHandler /* 55: PWM0 */
116+
.long EEPROM_IRQHandler /* 56: EEPROM */
117117

118118
.size __cs3_interrupt_vector_cortex_m, . - __cs3_interrupt_vector_cortex_m
119119

@@ -130,22 +130,24 @@ CRP_Value:
130130
.section .cs3.reset,"x",%progbits
131131
.thumb_func
132132
.globl __cs3_reset_cortex_m
133+
.globl Reset_Handler
133134
.type __cs3_reset_cortex_m, %function
134135
__cs3_reset_cortex_m:
136+
Reset_Handler:
135137
.fnstart
136138
.ifdef RAM_MODE
137139
/* Clear .bss section (Zero init) */
138-
MOV R0, #0
139-
LDR R1, =__bss_start__
140-
LDR R2, =__bss_end__
141-
CMP R1,R2
142-
BEQ BSSIsEmpty
140+
MOV R0, #0
141+
LDR R1, =__bss_start__
142+
LDR R2, =__bss_end__
143+
CMP R1,R2
144+
BEQ BSSIsEmpty
143145
LoopZI:
144-
CMP R1, R2
145-
BHS BSSIsEmpty
146-
STR R0, [R1]
147-
ADD R1, #4
148-
BLO LoopZI
146+
CMP R1, R2
147+
BHS BSSIsEmpty
148+
STR R0, [R1]
149+
ADD R1, #4
150+
BLO LoopZI
149151
BSSIsEmpty:
150152
LDR R0, =SystemInit
151153
BLX R0
@@ -154,7 +156,7 @@ BSSIsEmpty:
154156
.else
155157
LDR R0, =SystemInit
156158
BLX R0
157-
LDR R0,=_start
159+
LDR R0,=main
158160
BX R0
159161
.endif
160162
.pool

bsp/lpc408x/SConstruct

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ TARGET = 'rtthread-%s.%s' % (rtconfig.BOARD_NAME, rtconfig.TARGET_EXT)
1515
env = Environment(tools = ['mingw'],
1616
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
1717
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
18+
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
1819
AR = rtconfig.AR, ARFLAGS = '-rc',
1920
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
2021
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)

bsp/lpc408x/rtconfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@
104104
// </section>
105105

106106
// <section name="LIBC" description="C Runtime library setting" default="always" >
107-
// <bool name="RT_USING_NEWLIB" description="Using newlib library, only available under GNU GCC" default="true" />
108-
// #define RT_USING_NEWLIB
107+
// <bool name="RT_USING_LIBC" description="Using C library" default="true" />
108+
// #define RT_USING_LIBC
109109
// <bool name="RT_USING_PTHREADS" description="Using POSIX threads library" default="true" />
110110
#define RT_USING_PTHREADS
111111
// </section>

bsp/lpc408x/rtconfig.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
if PLATFORM == 'gcc':
3030
# toolchains
3131
PREFIX = 'arm-none-eabi-'
32-
CC = PREFIX + 'gcc'
32+
CC = PREFIX + 'gcc'
33+
CXX = PREFIX + 'g++'
3334
AS = PREFIX + 'gcc'
3435
AR = PREFIX + 'ar'
3536
LINK = PREFIX + 'gcc'
@@ -52,11 +53,14 @@
5253
else:
5354
CFLAGS += ' -O2'
5455

56+
CXXFLAGS = CFLAGS
57+
5558
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
5659

5760
elif PLATFORM == 'armcc':
5861
# toolchains
5962
CC = 'armcc'
63+
CXX = 'armcc'
6064
AS = 'armasm'
6165
AR = 'armar'
6266
LINK = 'armlink'
@@ -70,6 +74,7 @@
7074

7175
CFLAGS += ' -I' + EXEC_PATH + '/ARM/RV31/INC'
7276
LFLAGS += ' --libpath ' + EXEC_PATH + '/ARM/RV31/LIB'
77+
CXXFLAGS = CFLAGS
7378

7479
EXEC_PATH += '/arm/bin40/'
7580

0 commit comments

Comments
 (0)