[bsp][rsoc]Fix compilation issues with bsp of hc32l136

This commit is contained in:
CYFS
2024-10-19 12:23:07 -04:00
committed by GitHub
parent ab964e1e5a
commit e47f478e12
15 changed files with 4228 additions and 212 deletions
+1
View File
@@ -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
File diff suppressed because it is too large Load Diff
@@ -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)
{
+1 -1
View File
@@ -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']:
+4 -4
View File
@@ -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
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -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'