Skip to content

Commit 606ccbc

Browse files
committed
Use cmsis gcc types instead of own
This caused a conflict. As CMSIS update introduced low level init, lets use the types from CMSIS. We could potentionally use __cmsis_start but as I saw for some targets, the init routine is slightly different. So rather keep what we have in targets, and just use types already defined in CMSIS.
1 parent e7e3cc0 commit 606ccbc

File tree

4 files changed

+27
-65
lines changed

4 files changed

+27
-65
lines changed

targets/TARGET_Analog_Devices/TARGET_ADUCM302X/TARGET_ADUCM3029/TARGET_EV_COG_AD3029LZ/device/startup_ADuCM3029.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ extern uint32_t Load$$LR$$LR_IROM1$$Base[];
9191
extern unsigned __etext;
9292
extern unsigned __data_start__;
9393
extern unsigned __data_end__;
94-
extern unsigned __copy_table_start__;
95-
extern unsigned __copy_table_end__;
96-
extern unsigned __zero_table_start__;
97-
extern unsigned __zero_table_end__;
9894
extern unsigned __bss_start__;
9995
extern unsigned __bss_end__;
10096
extern unsigned __StackTop;

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/TARGET_EV_COG_AD4050LZ/device/startup_ADuCM4050.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ extern uint32_t Load$$LR$$LR_IROM1$$Base[];
102102
extern uint32_t __etext;
103103
extern uint32_t __data_start__;
104104
extern uint32_t __data_end__;
105-
extern uint32_t __copy_table_start__;
106-
extern uint32_t __copy_table_end__;
107-
extern uint32_t __zero_table_start__;
108-
extern uint32_t __zero_table_end__;
109105
extern uint32_t __bss_start__;
110106
extern uint32_t __bss_end__;
111107
extern uint32_t __StackTop;

targets/TARGET_NUVOTON/TARGET_M2351/device/startup_M2351.c

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -464,52 +464,39 @@ void Reset_Handler_1(void)
464464
__iar_program_start();
465465

466466
#elif defined(__GNUC__)
467-
/* Move (multiple) .data section(s) from ROM to RAM */
468-
{
469-
/* Struct of copy table entry which must match linker script */
470-
typedef struct copy_table_entry_ {
471-
uint32_t src; // Address to copy from
472-
uint32_t dst; // Address to copy to
473-
uint32_t size; // Copy size in bytes
474-
} copy_table_entry;
475-
476-
copy_table_entry *copy_table_ind = (copy_table_entry *) &__copy_table_start__;
477-
copy_table_entry *copy_table_end = (copy_table_entry *) &__copy_table_end__;
478-
479-
for (; copy_table_ind != copy_table_end; copy_table_ind ++) {
480-
uint32_t *src_ind = (uint32_t *) copy_table_ind->src;
481-
uint32_t *src_end = (uint32_t *) (copy_table_ind->src + copy_table_ind->size);
482-
uint32_t *dst_ind = (uint32_t *) copy_table_ind->dst;
483-
if (src_ind != dst_ind) {
484-
for (; src_ind < src_end;) {
485-
*dst_ind ++ = *src_ind ++;
467+
/* Move (multiple) .data section(s) from ROM to RAM */
468+
{
469+
copy_table_entry *copy_table_ind = (copy_table_entry *) &__copy_table_start__;
470+
copy_table_entry *copy_table_end = (copy_table_entry *) &__copy_table_end__;
471+
472+
for (; copy_table_ind != copy_table_end; copy_table_ind ++) {
473+
uint32_t *src_ind = (uint32_t *) copy_table_ind->src;
474+
uint32_t *src_end = (uint32_t *) (copy_table_ind->src + copy_table_ind->size);
475+
uint32_t *dst_ind = (uint32_t *) copy_table_ind->dst;
476+
if (src_ind != dst_ind) {
477+
for (; src_ind < src_end;) {
478+
*dst_ind ++ = *src_ind ++;
479+
}
486480
}
487481
}
488482
}
489-
}
490483

491-
/* Initialize (multiple) .bss sections to zero */
492-
{
493-
/* Struct of zero table entry which must match linker script */
494-
typedef struct zero_table_entry_ {
495-
uint32_t start; // Address to start zero'ing
496-
uint32_t size; // Zero size in bytes
497-
} zero_table_entry;
484+
/* Initialize (multiple) .bss sections to zero */
485+
{
486+
zero_table_entry *zero_table_ind = (zero_table_entry *) &__zero_table_start__;
487+
zero_table_entry *zero_table_end = (zero_table_entry *) &__zero_table_end__;
498488

499-
zero_table_entry *zero_table_ind = (zero_table_entry *) &__zero_table_start__;
500-
zero_table_entry *zero_table_end = (zero_table_entry *) &__zero_table_end__;
489+
for (; zero_table_ind != zero_table_end; zero_table_ind ++) {
490+
uint32_t *dst_ind = (uint32_t *) zero_table_ind->start;
491+
uint32_t *dst_end = (uint32_t *) (zero_table_ind->start + zero_table_ind->size);
501492

502-
for (; zero_table_ind != zero_table_end; zero_table_ind ++) {
503-
uint32_t *dst_ind = (uint32_t *) zero_table_ind->start;
504-
uint32_t *dst_end = (uint32_t *) (zero_table_ind->start + zero_table_ind->size);
505-
506-
for (; dst_ind < dst_end; ) {
507-
*dst_ind ++ = 0;
493+
for (; dst_ind < dst_end; ) {
494+
*dst_ind ++ = 0;
495+
}
508496
}
509497
}
510-
}
511498

512-
_start();
499+
_start();
513500

514501
#endif
515502

targets/TARGET_NUVOTON/TARGET_M251/device/startup_M251.c

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ extern void __main(void);
6161
void __iar_program_start(void);
6262
#elif defined(__GNUC__)
6363
extern uint32_t __StackTop;
64-
extern uint32_t __copy_table_start__;
65-
extern uint32_t __copy_table_end__;
66-
extern uint32_t __zero_table_start__;
67-
extern uint32_t __zero_table_end__;
6864

6965
#if defined(TOOLCHAIN_GCC_ARM)
7066
extern void _start(void);
@@ -284,20 +280,13 @@ void Reset_Handler(void)
284280
#elif defined(__GNUC__)
285281
/* Move (multiple) .data section(s) from ROM to RAM */
286282
{
287-
/* Struct of copy table entry which must match linker script */
288-
typedef struct copy_table_entry_ {
289-
uint32_t src; // Address to copy from
290-
uint32_t dst; // Address to copy to
291-
uint32_t size; // Copy size in bytes
292-
} copy_table_entry;
293-
294283
copy_table_entry *copy_table_ind = (copy_table_entry *) &__copy_table_start__;
295284
copy_table_entry *copy_table_end = (copy_table_entry *) &__copy_table_end__;
296285

297286
for (; copy_table_ind != copy_table_end; copy_table_ind ++) {
298287
uint32_t *src_ind = (uint32_t *) copy_table_ind->src;
299-
uint32_t *src_end = (uint32_t *) (copy_table_ind->src + copy_table_ind->size);
300-
uint32_t *dst_ind = (uint32_t *) copy_table_ind->dst;
288+
uint32_t *src_end = (uint32_t *) (copy_table_ind->src + copy_table_ind->wlen);
289+
uint32_t *dst_ind = (uint32_t *) copy_table_ind->dest;
301290
if (src_ind != dst_ind) {
302291
for (; src_ind < src_end;) {
303292
*dst_ind ++ = *src_ind ++;
@@ -308,18 +297,12 @@ void Reset_Handler(void)
308297

309298
/* Initialize (multiple) .bss sections to zero */
310299
{
311-
/* Struct of zero table entry which must match linker script */
312-
typedef struct zero_table_entry_ {
313-
uint32_t start; // Address to start zero'ing
314-
uint32_t size; // Zero size in bytes
315-
} zero_table_entry;
316-
317300
zero_table_entry *zero_table_ind = (zero_table_entry *) &__zero_table_start__;
318301
zero_table_entry *zero_table_end = (zero_table_entry *) &__zero_table_end__;
319302

320303
for (; zero_table_ind != zero_table_end; zero_table_ind ++) {
321304
uint32_t *dst_ind = (uint32_t *) zero_table_ind->start;
322-
uint32_t *dst_end = (uint32_t *) (zero_table_ind->start + zero_table_ind->size);
305+
uint32_t *dst_end = (uint32_t *) (zero_table_ind->start + zero_table_ind->wlen);
323306

324307
for (; dst_ind < dst_end; ) {
325308
*dst_ind ++ = 0;

0 commit comments

Comments
 (0)