mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-08-18 11:53:05 +08:00
[bsp][rsoc]Fix compilation issues with bsp of hc32l136
This commit is contained in:
@@ -105,6 +105,7 @@ jobs:
|
||||
- "w60x"
|
||||
- "essemi/es32f0654"
|
||||
- "essemi/es32f365x"
|
||||
- "hc32l136"
|
||||
- RTT_BSP: "stm32l4_f0_f1"
|
||||
RTT_TOOL_CHAIN: "sourcery-arm"
|
||||
SUB_RTT_BSP:
|
||||
|
||||
@@ -120,7 +120,7 @@ jobs:
|
||||
- {RTT_BSP_NAME: "gd32_risc-v_gd32vf103v-eval", RTT_TOOL_CHAIN: "sourcery-riscv-none-embed", RTT_BSP: "gd32/risc-v/gd32vf103v-eval"}
|
||||
- {RTT_BSP_NAME: "hc32_ev_hc32f460_lqfp100_v2", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "hc32/ev_hc32f460_lqfp100_v2"}
|
||||
- {RTT_BSP_NAME: "hc32_ev_hc32f4a0_lqfp176", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "hc32/ev_hc32f4a0_lqfp176"}
|
||||
#- {RTT_BSP_NAME: "hc32l136", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "hc32l136"} #编译错误
|
||||
- {RTT_BSP_NAME: "hc32l136", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "hc32l136"}
|
||||
- {RTT_BSP_NAME: "hc32l196", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "hc32l196"}
|
||||
- {RTT_BSP_NAME: "hifive1", RTT_TOOL_CHAIN: "sourcery-riscv-none-embed", RTT_BSP: "hifive1"}
|
||||
#- {RTT_BSP_NAME: "hk32_hk32f030c8-mini", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "hk32/hk32f030c8-mini"} #scons dist有问题
|
||||
|
||||
@@ -79,6 +79,8 @@
|
||||
#define __WEAKDEF __WEAK __ATTRIBUTES
|
||||
#elif defined (__CC_ARM)
|
||||
#define __WEAKDEF __weak
|
||||
#elif defined (__GNUC__) // 添加这一行以支持 GCC
|
||||
#define __WEAKDEF __attribute__((weak))
|
||||
#else
|
||||
#error "unsupported compiler!!"
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
.section .stack, "aw"
|
||||
.stack_size = 0x200
|
||||
.stack_space: .space .stack_size
|
||||
|
||||
.section .heap, "aw"
|
||||
.heap_size = 0x200
|
||||
.heap_space: .space .heap_size
|
||||
|
||||
.section .vectors, "a"
|
||||
.global __Vectors
|
||||
.global __Vectors_End
|
||||
.global __Vectors_Size
|
||||
|
||||
.type __Vectors, %function
|
||||
__Vectors:
|
||||
.word .stack_space + .stack_size // Stack Pointer
|
||||
.word Reset_Handler // Reset
|
||||
.word NMI_Handler // NMI
|
||||
.word HardFault_Handler // Hard Fault
|
||||
.word 0 // Reserved
|
||||
.word 0 // Reserved
|
||||
.word 0 // Reserved
|
||||
.word 0 // Reserved
|
||||
.word 0 // Reserved
|
||||
.word 0 // Reserved
|
||||
.word 0 // Reserved
|
||||
.word SVC_Handler // SVCall
|
||||
.word 0 // Reserved
|
||||
.word 0 // Reserved
|
||||
.word PendSV_Handler // PendSV
|
||||
.word SysTick_Handler // SysTick
|
||||
|
||||
// 中断处理函数
|
||||
.word IRQ000_Handler
|
||||
.word IRQ001_Handler
|
||||
.word IRQ002_Handler
|
||||
.word IRQ003_Handler
|
||||
.word IRQ004_Handler
|
||||
.word IRQ005_Handler
|
||||
.word IRQ006_Handler
|
||||
.word IRQ007_Handler
|
||||
.word IRQ008_Handler
|
||||
.word IRQ009_Handler
|
||||
.word IRQ010_Handler
|
||||
.word IRQ011_Handler
|
||||
.word IRQ012_Handler
|
||||
.word IRQ013_Handler
|
||||
.word IRQ014_Handler
|
||||
.word IRQ015_Handler
|
||||
.word IRQ016_Handler
|
||||
.word IRQ017_Handler
|
||||
.word IRQ018_Handler
|
||||
.word IRQ019_Handler
|
||||
.word IRQ020_Handler
|
||||
.word IRQ021_Handler
|
||||
.word IRQ022_Handler
|
||||
.word IRQ023_Handler
|
||||
.word IRQ024_Handler
|
||||
.word IRQ025_Handler
|
||||
.word IRQ026_Handler
|
||||
.word IRQ027_Handler
|
||||
.word IRQ028_Handler
|
||||
.word IRQ029_Handler
|
||||
.word IRQ030_Handler
|
||||
.word IRQ031_Handler
|
||||
|
||||
.global __Vectors_End
|
||||
__Vectors_End:
|
||||
.global __Vectors_Size
|
||||
__Vectors_Size = __Vectors_End - __Vectors
|
||||
|
||||
.section .text
|
||||
.global Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
Reset_Handler:
|
||||
// 重置处理
|
||||
ldr r0, =0xE000ED08
|
||||
ldr r1, =.stack_space
|
||||
str r1, [r0] // 设置堆栈指针
|
||||
|
||||
bl SystemInit // 调用系统初始化
|
||||
bl entry // 调用主函数
|
||||
b . // 无限循环
|
||||
|
||||
// 异常处理程序
|
||||
.type NMI_Handler, %function
|
||||
NMI_Handler:
|
||||
b .
|
||||
|
||||
.type HardFault_Handler, %function
|
||||
HardFault_Handler:
|
||||
b .
|
||||
|
||||
.type SVC_Handler, %function
|
||||
SVC_Handler:
|
||||
b .
|
||||
|
||||
.type PendSV_Handler, %function
|
||||
PendSV_Handler:
|
||||
b .
|
||||
|
||||
.type SysTick_Handler, %function
|
||||
SysTick_Handler:
|
||||
b .
|
||||
|
||||
.type Default_Handler, %function
|
||||
Default_Handler:
|
||||
b .
|
||||
|
||||
// 中断处理函数的默认实现
|
||||
.weak IRQ000_Handler
|
||||
.thumb_set IRQ000_Handler, Default_Handler
|
||||
|
||||
.weak IRQ001_Handler
|
||||
.thumb_set IRQ001_Handler, Default_Handler
|
||||
|
||||
.weak IRQ002_Handler
|
||||
.thumb_set IRQ002_Handler, Default_Handler
|
||||
|
||||
.weak IRQ003_Handler
|
||||
.thumb_set IRQ003_Handler, Default_Handler
|
||||
|
||||
.weak IRQ004_Handler
|
||||
.thumb_set IRQ004_Handler, Default_Handler
|
||||
|
||||
.weak IRQ005_Handler
|
||||
.thumb_set IRQ005_Handler, Default_Handler
|
||||
|
||||
.weak IRQ006_Handler
|
||||
.thumb_set IRQ006_Handler, Default_Handler
|
||||
|
||||
.weak IRQ007_Handler
|
||||
.thumb_set IRQ007_Handler, Default_Handler
|
||||
|
||||
.weak IRQ008_Handler
|
||||
.thumb_set IRQ008_Handler, Default_Handler
|
||||
|
||||
.weak IRQ009_Handler
|
||||
.thumb_set IRQ009_Handler, Default_Handler
|
||||
|
||||
.weak IRQ010_Handler
|
||||
.thumb_set IRQ010_Handler, Default_Handler
|
||||
|
||||
.weak IRQ011_Handler
|
||||
.thumb_set IRQ011_Handler, Default_Handler
|
||||
|
||||
.weak IRQ012_Handler
|
||||
.thumb_set IRQ012_Handler, Default_Handler
|
||||
|
||||
.weak IRQ013_Handler
|
||||
.thumb_set IRQ013_Handler, Default_Handler
|
||||
|
||||
.weak IRQ014_Handler
|
||||
.thumb_set IRQ014_Handler, Default_Handler
|
||||
|
||||
.weak IRQ015_Handler
|
||||
.thumb_set IRQ015_Handler, Default_Handler
|
||||
|
||||
.weak IRQ016_Handler
|
||||
.thumb_set IRQ016_Handler, Default_Handler
|
||||
|
||||
.weak IRQ017_Handler
|
||||
.thumb_set IRQ017_Handler, Default_Handler
|
||||
|
||||
.weak IRQ018_Handler
|
||||
.thumb_set IRQ018_Handler, Default_Handler
|
||||
|
||||
.weak IRQ019_Handler
|
||||
.thumb_set IRQ019_Handler, Default_Handler
|
||||
|
||||
.weak IRQ020_Handler
|
||||
.thumb_set IRQ020_Handler, Default_Handler
|
||||
|
||||
.weak IRQ021_Handler
|
||||
.thumb_set IRQ021_Handler, Default_Handler
|
||||
|
||||
.weak IRQ022_Handler
|
||||
.thumb_set IRQ022_Handler, Default_Handler
|
||||
|
||||
.weak IRQ023_Handler
|
||||
.thumb_set IRQ023_Handler, Default_Handler
|
||||
|
||||
.weak IRQ024_Handler
|
||||
.thumb_set IRQ024_Handler, Default_Handler
|
||||
|
||||
.weak IRQ025_Handler
|
||||
.thumb_set IRQ025_Handler, Default_Handler
|
||||
|
||||
.weak IRQ026_Handler
|
||||
.thumb_set IRQ026_Handler, Default_Handler
|
||||
|
||||
.weak IRQ027_Handler
|
||||
.thumb_set IRQ027_Handler, Default_Handler
|
||||
|
||||
.weak IRQ028_Handler
|
||||
.thumb_set IRQ028_Handler, Default_Handler
|
||||
|
||||
.weak IRQ029_Handler
|
||||
.thumb_set IRQ029_Handler, Default_Handler
|
||||
|
||||
.weak IRQ030_Handler
|
||||
.thumb_set IRQ030_Handler, Default_Handler
|
||||
|
||||
.weak IRQ031_Handler
|
||||
.thumb_set IRQ031_Handler, Default_Handler
|
||||
|
||||
.end
|
||||
@@ -73,8 +73,9 @@
|
||||
/** __FPU_USED indicates whether an FPU is used or not.
|
||||
This core does not support an FPU at all
|
||||
*/
|
||||
#ifndef __FPU_USED
|
||||
#define __FPU_USED 0U
|
||||
|
||||
#endif
|
||||
#if defined ( __CC_ARM )
|
||||
#if defined __TARGET_FPU_VFP
|
||||
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||
|
||||
@@ -188,10 +188,6 @@ int fputc(int ch, FILE *f)
|
||||
}
|
||||
#endif
|
||||
|
||||
void _ttywrch(int c)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
int __backspace(void)
|
||||
{
|
||||
|
||||
@@ -459,7 +459,7 @@ en_result_t Rtc_CheckDateTimeFormat(uint8_t* pu8TimeDate,uint8_t u8Mode)
|
||||
en_result_t enRet=Error;
|
||||
while(u8i<7)
|
||||
{
|
||||
if(u8Mode&&(1<<u8i))
|
||||
if(u8Mode && (1 << u8i) != 0)
|
||||
{
|
||||
switch(u8i)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ if GetDepend(['RT_USING_WDT']):
|
||||
|
||||
#add for startup script
|
||||
if rtconfig.PLATFORM in ['gcc']:
|
||||
src = src + ['CMSIS/Device/HDSC/HC32L136/Source/GCC/startup_hc32l136.S']
|
||||
src = src + ['CMSIS/Device/HDSC/HC32L136/Source/GCC/startup_hc32l136.s']
|
||||
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
|
||||
src = src + ['CMSIS/Device/HDSC/HC32L136/Source/ARM/startup_hc32l136.s']
|
||||
elif rtconfig.PLATFORM in ['iccarm']:
|
||||
|
||||
@@ -2,13 +2,13 @@ import os
|
||||
import sys
|
||||
import rtconfig
|
||||
|
||||
print "############sconstruct##############"
|
||||
print('############sconstruct##############')
|
||||
if os.getenv('RTT_ROOT'):
|
||||
RTT_ROOT = os.getenv('RTT_ROOT')
|
||||
else:
|
||||
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
||||
|
||||
print "RTT_ROOT: " + RTT_ROOT
|
||||
print('RTT_ROOT: ' + RTT_ROOT)
|
||||
|
||||
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
||||
try:
|
||||
@@ -37,8 +37,8 @@ Export('RTT_ROOT')
|
||||
Export('rtconfig')
|
||||
|
||||
# prepare building environment
|
||||
print "######################env:"
|
||||
print env
|
||||
print ('######################env:')
|
||||
print(env)
|
||||
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
|
||||
|
||||
# make a building
|
||||
|
||||
@@ -59,7 +59,7 @@ void key_handler(void *param)
|
||||
** \retval int32_t Return value, if needed
|
||||
**
|
||||
******************************************************************************/
|
||||
int32_t main(void)
|
||||
int main(void)
|
||||
{
|
||||
rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);
|
||||
rt_pin_attach_irq(KEY_PIN, PIN_IRQ_MODE_FALLING, key_handler, RT_NULL);
|
||||
|
||||
@@ -156,7 +156,7 @@ SECTIONS
|
||||
*(COMMON)
|
||||
. = ALIGN(4);
|
||||
_ebss = .;
|
||||
__bss_end__ = _ebss;
|
||||
__bss_end = _ebss;
|
||||
} >RAM
|
||||
|
||||
.ramb_bss :
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
+1300
-195
File diff suppressed because it is too large
Load Diff
@@ -5,12 +5,12 @@ ARCH='arm'
|
||||
CPU='cortex-m0'
|
||||
CROSS_TOOL='iar'
|
||||
|
||||
print "############rtconfig##############"
|
||||
print('############rtconfig##############')
|
||||
|
||||
if os.getenv('RTT_CC'):
|
||||
CROSS_TOOL = os.getenv('RTT_CC')
|
||||
|
||||
print "CROSS_TOOL: " + CROSS_TOOL
|
||||
print('CROSS_TOOL: ' + CROSS_TOOL)
|
||||
|
||||
# cross_tool provides the cross compiler
|
||||
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR
|
||||
@@ -42,7 +42,7 @@ if PLATFORM == 'gcc':
|
||||
OBJDUMP = PREFIX + 'objdump'
|
||||
OBJCPY = PREFIX + 'objcopy'
|
||||
|
||||
DEVICE = ' -mcpu=cortex-m0 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections'
|
||||
DEVICE = ' -mcpu=cortex-m0 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=soft -ffunction-sections -fdata-sections'
|
||||
CFLAGS = DEVICE + ' -g -Wall -DHC32F4A0 -D__DEBUG -DUSE_DDL_DRIVER -D__ASSEMBLY__ -D__FPU_USED'
|
||||
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb '
|
||||
LFLAGS = DEVICE + ' -lm -lgcc -lc' + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
|
||||
|
||||
Reference in New Issue
Block a user