Skip to content

Commit 827609b

Browse files
hydevcodemysterywolf
authored andcommitted
[bsp][essemi][rsoc] Fix compilation issues with bsp of essemi series
1 parent bad2745 commit 827609b

File tree

10 files changed

+354
-8
lines changed

10 files changed

+354
-8
lines changed

.github/workflows/bsp_buildings.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ jobs:
101101
- "rm48x50"
102102
- "ht32/ht32f52352"
103103
- "ht32/ht32f12366"
104+
- "essemi/es32f0654"
105+
- "essemi/es32f365x"
104106
- RTT_BSP: "stm32l4_f0_f1"
105107
RTT_TOOL_CHAIN: "sourcery-arm"
106108
SUB_RTT_BSP:

.github/workflows/manual_trigger_scons_except_STM32_all.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ jobs:
9191
- {RTT_BSP_NAME: "dm365", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "dm365"}
9292
- {RTT_BSP_NAME: "efm32", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "efm32"}
9393
- {RTT_BSP_NAME: "ESP32_C3", RTT_TOOL_CHAIN: "sourcery-riscv32-esp32", RTT_BSP: "ESP32_C3"}
94-
#- {RTT_BSP_NAME: "essemi_es32f0654", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "essemi/es32f0654"} #GCC link文件没支持好
95-
#- {RTT_BSP_NAME: "essemi_es32f365x", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "essemi/es32f365x"} #GCC link文件没支持好
94+
- {RTT_BSP_NAME: "essemi_es32f0654", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "essemi/es32f0654"}
95+
- {RTT_BSP_NAME: "essemi_es32f365x", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "essemi/es32f365x"}
9696
- {RTT_BSP_NAME: "essemi_es32f369x", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "essemi/es32f369x"}
9797
- {RTT_BSP_NAME: "essemi_es32vf2264", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "essemi/es32vf2264"}
9898
#- {RTT_BSP_NAME: "fm33lc026", RTT_TOOL_CHAIN: "sourcery-arm", RTT_BSP: "fm33lc026"} #GCC
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*###ICF### Section handled by ICF editor, don't touch! ****/
2+
/*-Editor annotation file-*/
3+
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4+
/*-Specials-*/
5+
define symbol __ICFEDIT_intvec_start__ = 0x0003E000;
6+
/*-Memory Regions-*/
7+
define symbol __ICFEDIT_region_ROM_start__ = 0x00038000;
8+
define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF;
9+
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000;
10+
define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF;
11+
/*-Sizes-*/
12+
define symbol __ICFEDIT_size_cstack__ = 0x400;
13+
define symbol __ICFEDIT_size_heap__ = 0x400;
14+
/**** End of ICF editor section. ###ICF###*/
15+
16+
17+
define memory mem with size = 4G;
18+
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
19+
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
20+
21+
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
22+
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
23+
24+
initialize by copy { readwrite };
25+
do not initialize { section .noinit };
26+
27+
place at address mem:__ICFEDIT_intvec_start__ { section .intvec };
28+
29+
place in ROM_region { readonly };
30+
place in RAM_region { readwrite,
31+
block CSTACK, block HEAP };
32+
33+
export symbol __ICFEDIT_region_RAM_start__;
34+
export symbol __ICFEDIT_region_RAM_end__;
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*
2+
*****************************************************************************
3+
**
4+
** File : es32f0654.ld
5+
**
6+
** Abstract : Linker script for ES32F0654 Device with
7+
** 256K-Byte FLASH, 32K-Byte RAM
8+
**
9+
** Set heap size, stack size and stack location according
10+
** to application requirements.
11+
**
12+
** Set memory bank area and size if external memory is used.
13+
**
14+
*****************************************************************************
15+
*/
16+
17+
/* Entry Point */
18+
ENTRY(Reset_Handler)
19+
20+
/* Highest address of the user mode stack */
21+
_estack = 0x20008000; /* end of 32K RAM */
22+
23+
/* Generate a link error if heap and stack don't fit into RAM */
24+
_Min_Heap_Size = 0; /* required amount of heap */
25+
_Min_Stack_Size = 0x400; /* required amount of stack */
26+
27+
/* Specify the memory areas */
28+
MEMORY
29+
{
30+
FLASH (rx) : ORIGIN = 0x00008000, LENGTH = 224K
31+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K
32+
MEMORY_B1 (rx) : ORIGIN = 0x20008000, LENGTH = 0K
33+
}
34+
35+
/* Define output sections */
36+
SECTIONS
37+
{
38+
/* The startup code goes first into FLASH */
39+
.isr_vector :
40+
{
41+
. = ALIGN(4);
42+
KEEP(*(.isr_vector)) /* Startup code */
43+
. = ALIGN(4);
44+
} >FLASH
45+
46+
/* The program code and other data goes into FLASH */
47+
.text :
48+
{
49+
. = ALIGN(4);
50+
*(.text) /* .text sections (code) */
51+
*(.text*) /* .text* sections (code) */
52+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
53+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
54+
*(.glue_7) /* glue arm to thumb code */
55+
*(.glue_7t) /* glue thumb to arm code */
56+
57+
KEEP (*(.init))
58+
KEEP (*(.fini))
59+
60+
. = ALIGN(4);
61+
_etext = .; /* define a global symbols at end of code */
62+
} >FLASH
63+
64+
65+
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
66+
.ARM : {
67+
__exidx_start = .;
68+
*(.ARM.exidx*)
69+
__exidx_end = .;
70+
} >FLASH
71+
72+
.ARM.attributes : { *(.ARM.attributes) } > FLASH
73+
74+
.preinit_array :
75+
{
76+
PROVIDE_HIDDEN (__preinit_array_start = .);
77+
KEEP (*(.preinit_array*))
78+
PROVIDE_HIDDEN (__preinit_array_end = .);
79+
} >FLASH
80+
.init_array :
81+
{
82+
PROVIDE_HIDDEN (__init_array_start = .);
83+
KEEP (*(SORT(.init_array.*)))
84+
KEEP (*(.init_array*))
85+
PROVIDE_HIDDEN (__init_array_end = .);
86+
} >FLASH
87+
.fini_array :
88+
{
89+
PROVIDE_HIDDEN (__fini_array_start = .);
90+
KEEP (*(.fini_array*))
91+
KEEP (*(SORT(.fini_array.*)))
92+
PROVIDE_HIDDEN (__fini_array_end = .);
93+
} >FLASH
94+
95+
/* used by the startup to initialize data */
96+
_sidata = .;
97+
98+
/* Initialized data sections goes into RAM, load LMA copy after code */
99+
.data : AT ( _sidata )
100+
{
101+
. = ALIGN(4);
102+
_sdata = .; /* create a global symbol at data start */
103+
*(.data) /* .data sections */
104+
*(.data*) /* .data* sections */
105+
. = ALIGN(4);
106+
_edata = .; /* define a global symbol at data end */
107+
} >RAM
108+
109+
/* Uninitialized data section */
110+
. = ALIGN(4);
111+
.bss :
112+
{
113+
/* This is used by the startup in order to initialize the .bss secion */
114+
_sbss = .; /* define a global symbol at bss start */
115+
__bss_start__ = _sbss;
116+
*(.bss)
117+
*(.bss*)
118+
*(COMMON)
119+
120+
. = ALIGN(4);
121+
_ebss = .; /* define a global symbol at bss end */
122+
__bss_end__ = _ebss;
123+
} >RAM
124+
125+
PROVIDE ( end = _ebss );
126+
PROVIDE ( _end = _ebss );
127+
128+
/* User_heap_stack section, used to check that there is enough RAM left */
129+
._user_heap_stack :
130+
{
131+
. = ALIGN(4);
132+
. = . + _Min_Heap_Size;
133+
. = . + _Min_Stack_Size;
134+
. = ALIGN(4);
135+
} >RAM
136+
137+
/* MEMORY_bank1 section, code must be located here explicitly */
138+
/* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
139+
.memory_b1_text :
140+
{
141+
*(.mb1text) /* .mb1text sections (code) */
142+
*(.mb1text*) /* .mb1text* sections (code) */
143+
*(.mb1rodata) /* read-only data (constants) */
144+
*(.mb1rodata*)
145+
} >MEMORY_B1
146+
147+
148+
/* Remove information from the standard libraries */
149+
/DISCARD/ :
150+
{
151+
libc.a ( * )
152+
libm.a ( * )
153+
libgcc.a ( * )
154+
}
155+
}

bsp/essemi/es32f0654/rtconfig.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
DEVICE = ' -mcpu=' + CPU + ' -mthumb -ffunction-sections -fdata-sections'
4747
CFLAGS = DEVICE
4848
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -Wa,-mimplicit-it=thumb'
49-
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T drivers/linker_scripts/link.lds'
49+
LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,Reset_Handler -T board/linker_scripts/link.lds'
5050

5151
CPATH = ''
5252
LPATH = ''
@@ -69,7 +69,7 @@
6969
DEVICE = ' --device DARMSTM'
7070
CFLAGS = '-c ' + DEVICE + ' --apcs=interwork --c99'
7171
AFLAGS = DEVICE + ' --apcs=interwork '
72-
LFLAGS = DEVICE + ' --scatter "drivers/linker_scripts/link.sct" --info sizes --info totals --info unused --info veneers --list rtthread.map --strict'
72+
LFLAGS = DEVICE + ' --scatter "board/linker_scripts/link.sct" --info sizes --info totals --info unused --info veneers --list rtthread.map --strict'
7373

7474
CFLAGS += ' -I' + EXEC_PATH + '/ARM/ARMCC/include'
7575
LFLAGS += ' --libpath ' + EXEC_PATH + '/ARM/ARMCC/lib'
@@ -121,7 +121,7 @@
121121
AFLAGS += ' --fpu None'
122122
AFLAGS += ' -S'
123123

124-
LFLAGS = ' --config "drivers\linker_scripts\link.icf"'
124+
LFLAGS = ' --config "board\linker_scripts\link.icf"'
125125
LFLAGS += ' --redirect _Printf=_PrintfTiny'
126126
LFLAGS += ' --redirect _Scanf=_ScanfSmall'
127127
if BUILD == 'debug':
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/*
2+
*****************************************************************************
3+
**
4+
** File : es32f3696.ld
5+
**
6+
** Abstract : Linker script for ES32F3696 Device with
7+
** 512K-Byte FLASH, 96K-Byte RAM
8+
**
9+
** Set heap size, stack size and stack location according
10+
** to application requirements.
11+
**
12+
** Set memory bank area and size if external memory is used.
13+
**
14+
*****************************************************************************
15+
*/
16+
17+
/* Entry Point */
18+
ENTRY(Reset_Handler)
19+
20+
/* Highest address of the user mode stack */
21+
_estack = 0x20018000; /* end of 32K RAM */
22+
23+
/* Generate a link error if heap and stack don't fit into RAM */
24+
_Min_Heap_Size = 0; /* required amount of heap */
25+
_Min_Stack_Size = 0x400; /* required amount of stack */
26+
27+
/* Specify the memory areas */
28+
MEMORY
29+
{
30+
FLASH (rx) : ORIGIN = 0x00008000, LENGTH = 480K
31+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
32+
MEMORY_B1 (rx) : ORIGIN = 0x20018000, LENGTH = 0K
33+
}
34+
35+
/* Define output sections */
36+
SECTIONS
37+
{
38+
/* The startup code goes first into FLASH */
39+
.isr_vector :
40+
{
41+
. = ALIGN(4);
42+
KEEP(*(.isr_vector)) /* Startup code */
43+
. = ALIGN(4);
44+
} >FLASH
45+
46+
/* The program code and other data goes into FLASH */
47+
.text :
48+
{
49+
. = ALIGN(4);
50+
*(.text) /* .text sections (code) */
51+
*(.text*) /* .text* sections (code) */
52+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
53+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
54+
*(.glue_7) /* glue arm to thumb code */
55+
*(.glue_7t) /* glue thumb to arm code */
56+
57+
KEEP (*(.init))
58+
KEEP (*(.fini))
59+
60+
. = ALIGN(4);
61+
_etext = .; /* define a global symbols at end of code */
62+
} >FLASH
63+
64+
65+
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
66+
.ARM : {
67+
__exidx_start = .;
68+
*(.ARM.exidx*)
69+
__exidx_end = .;
70+
} >FLASH
71+
72+
.ARM.attributes : { *(.ARM.attributes) } > FLASH
73+
74+
.preinit_array :
75+
{
76+
PROVIDE_HIDDEN (__preinit_array_start = .);
77+
KEEP (*(.preinit_array*))
78+
PROVIDE_HIDDEN (__preinit_array_end = .);
79+
} >FLASH
80+
.init_array :
81+
{
82+
PROVIDE_HIDDEN (__init_array_start = .);
83+
KEEP (*(SORT(.init_array.*)))
84+
KEEP (*(.init_array*))
85+
PROVIDE_HIDDEN (__init_array_end = .);
86+
} >FLASH
87+
.fini_array :
88+
{
89+
PROVIDE_HIDDEN (__fini_array_start = .);
90+
KEEP (*(.fini_array*))
91+
KEEP (*(SORT(.fini_array.*)))
92+
PROVIDE_HIDDEN (__fini_array_end = .);
93+
} >FLASH
94+
95+
/* used by the startup to initialize data */
96+
_sidata = .;
97+
98+
/* Initialized data sections goes into RAM, load LMA copy after code */
99+
.data : AT ( _sidata )
100+
{
101+
. = ALIGN(4);
102+
_sdata = .; /* create a global symbol at data start */
103+
*(.data) /* .data sections */
104+
*(.data*) /* .data* sections */
105+
. = ALIGN(4);
106+
_edata = .; /* define a global symbol at data end */
107+
} >RAM
108+
109+
/* Uninitialized data section */
110+
. = ALIGN(4);
111+
.bss :
112+
{
113+
/* This is used by the startup in order to initialize the .bss secion */
114+
_sbss = .; /* define a global symbol at bss start */
115+
__bss_start__ = _sbss;
116+
*(.bss)
117+
*(.bss*)
118+
*(COMMON)
119+
120+
. = ALIGN(4);
121+
_ebss = .; /* define a global symbol at bss end */
122+
__bss_end__ = _ebss;
123+
} >RAM
124+
125+
PROVIDE ( end = _ebss );
126+
PROVIDE ( _end = _ebss );
127+
128+
/* User_heap_stack section, used to check that there is enough RAM left */
129+
._user_heap_stack :
130+
{
131+
. = ALIGN(4);
132+
. = . + _Min_Heap_Size;
133+
. = . + _Min_Stack_Size;
134+
. = ALIGN(4);
135+
} >RAM
136+
137+
/* MEMORY_bank1 section, code must be located here explicitly */
138+
/* Example: extern int foo(void) __attribute__ ((section (".mb1text"))); */
139+
.memory_b1_text :
140+
{
141+
*(.mb1text) /* .mb1text sections (code) */
142+
*(.mb1text*) /* .mb1text* sections (code) */
143+
*(.mb1rodata) /* read-only data (constants) */
144+
*(.mb1rodata*)
145+
} >MEMORY_B1
146+
147+
148+
/* Remove information from the standard libraries */
149+
/DISCARD/ :
150+
{
151+
libc.a ( * )
152+
libm.a ( * )
153+
libgcc.a ( * )
154+
}
155+
}

0 commit comments

Comments
 (0)