Skip to content

Commit 3fea439

Browse files
committed
Maxim: ARM alignment, remove unneeded vector space
Unusually, Maxim builds don't have hard-reserved RAM for their vector tables - they just put them the main data section, aligned. This means the main data section needs to be aligned, and it actually wasn't for the ARM toolchain, because space was being unnecessarily reserved for the vectors before it! Strip out the unneeded space reservation so that ARM's main RAM region starts at the start of RAM, like for GCC and IAR. Remove some unused and invalid vector table symbols from IAR. For all MAX32625NEXPAQ builds, move the RAM split base to align it to 512 bytes - necessary for ARM toolchain, and probably wise to do it for all.
1 parent 19efc5a commit 3fea439

File tree

23 files changed

+27
-53
lines changed

23 files changed

+27
-53
lines changed

targets/TARGET_Maxim/TARGET_MAX32600/device/TOOLCHAIN_ARM_STD/MAX32600.sct

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ LR_IROM1 0x00000000 0x40000 { ; load region size_region
1919
.ANY (+RO)
2020
}
2121

22-
; [RAM] Vector table dynamic copy: 79 vectors * 4 bytes = (0x140) - alignment
23-
RW_IRAM1 (0x20000000+0x140) (0x8000-0x140-Stack_Size) { ; RW data
22+
RW_IRAM1 (0x20000000) (0x8000-Stack_Size) { ; RW data
2423
.ANY (+RW +ZI)
2524
}
2625
ARM_LIB_STACK (0x20000000+0x8000) EMPTY -Stack_Size { ; stack

targets/TARGET_Maxim/TARGET_MAX32600/device/TOOLCHAIN_IAR/MAX32600.icf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ define symbol __intvec_start__ = 0x0;
33
define symbol __region_ROM_start__ = 0x0;
44
define symbol __region_ROM_end__ = 0x0003FFFF;
55

6-
/* [RAM] Vector table dynamic copy: 79 vectors * 4 bytes = 316 bytes (0x13C) */
7-
define symbol __NVIC_start__ = 0x00000000;
8-
define symbol __NVIC_end__ = 0x00000140; /* to be aligned on 8 bytes */
6+
/* [RAM] */
97
define symbol __region_RAM_start__ = 0x20000000;
108
define symbol __region_RAM_end__ = 0x20007FFF;
119

targets/TARGET_Maxim/TARGET_MAX32600/device/cmsis_nvic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
extern void (*ramVectorTable[MXC_IRQ_COUNT])(void);
3838

3939
#define NVIC_NUM_VECTORS (MXC_IRQ_COUNT)
40-
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable) // Vectors positioned at start of RAM
40+
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable)
4141

4242
#endif /* MBED_CMSIS_NVIC_H */

targets/TARGET_Maxim/TARGET_MAX32610/device/TOOLCHAIN_ARM_STD/MAX32610.sct

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ LR_IROM1 0x00000000 0x40000 { ; load region size_region
1919
.ANY (+RO)
2020
}
2121

22-
; [RAM] Vector table dynamic copy: 79 vectors * 4 bytes = (0x140) - alignment
23-
RW_IRAM1 (0x20000000+0x140) (0x8000-0x140-Stack_Size) { ; RW data
22+
RW_IRAM1 (0x20000000) (0x8000-Stack_Size) { ; RW data
2423
.ANY (+RW +ZI)
2524
}
2625
ARM_LIB_STACK (0x20000000+0x8000) EMPTY -Stack_Size { ; stack

targets/TARGET_Maxim/TARGET_MAX32610/device/TOOLCHAIN_IAR/MAX32610.icf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ define symbol __intvec_start__ = 0x0;
33
define symbol __region_ROM_start__ = 0x0;
44
define symbol __region_ROM_end__ = 0x0003FFFF;
55

6-
/* [RAM] Vector table dynamic copy: 79 vectors * 4 bytes = 316 bytes (0x13C) */
7-
define symbol __NVIC_start__ = 0x00000000;
8-
define symbol __NVIC_end__ = 0x00000140; /* to be aligned on 8 bytes */
6+
/* [RAM] */
97
define symbol __region_RAM_start__ = 0x20000000;
108
define symbol __region_RAM_end__ = 0x20007FFF;
119

targets/TARGET_Maxim/TARGET_MAX32610/device/cmsis_nvic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
extern void (*ramVectorTable[MXC_IRQ_COUNT])(void);
3838

3939
#define NVIC_NUM_VECTORS (MXC_IRQ_COUNT)
40-
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable) // Vectors positioned at start of RAM
40+
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable)
4141

4242
#endif /* MBED_CMSIS_NVIC_H */

targets/TARGET_Maxim/TARGET_MAX32620/device/TOOLCHAIN_ARM_STD/MAX32620.sct

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ LR_IROM1 0x00000000 0x200000 { ; load region size_region
2020
.ANY (+RO)
2121
}
2222

23-
; [RAM] Vector table dynamic copy: 65 vectors * 4 bytes = 260 (0x104) + 4
24-
; for 8 byte alignment
25-
RW_IRAM1 (0x20000000+0x108) (0x40000-0x108-Stack_Size) { ; RW data
23+
RW_IRAM1 (0x20000000) (0x40000-Stack_Size) { ; RW data
2624
.ANY (+RW +ZI)
2725
}
2826
ARM_LIB_STACK (0x20000000+0x40000) EMPTY -Stack_Size { ; stack

targets/TARGET_Maxim/TARGET_MAX32620/device/TOOLCHAIN_IAR/MAX32620.icf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ define symbol __intvec_start__ = 0x0;
33
define symbol __region_ROM_start__ = 0x0;
44
define symbol __region_ROM_end__ = 0x001FFFFF;
55

6-
/* [RAM] Vector table dynamic copy: 65 vectors * 4 bytes = 260 (0x104) bytes + 4 for 8 byte align */
7-
define symbol __NVIC_start__ = 0x00000000;
8-
define symbol __NVIC_end__ = 0x00000108; /* to be aligned on 8 bytes */
6+
/* [RAM] */
97
define symbol __region_RAM_start__ = 0x20000000;
108
define symbol __region_RAM_end__ = 0x2003FFFF;
119

targets/TARGET_Maxim/TARGET_MAX32620/device/cmsis_nvic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@
3737
extern void (*ramVectorTable[MXC_IRQ_COUNT])(void);
3838

3939
#define NVIC_NUM_VECTORS (MXC_IRQ_COUNT)
40-
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable) // Vectors positioned at start of RAM
40+
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable)
4141

4242
#endif /* MBED_CMSIS_NVIC_H */

targets/TARGET_Maxim/TARGET_MAX32620C/device/TOOLCHAIN_ARM_STD/MAX32620.sct

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ LR_IROM1 0x00000000 0x200000 { ; load region size_region
2020
.ANY (+RO)
2121
}
2222

23-
; [RAM] Vector table dynamic copy: 65 vectors * 4 bytes = 260 (0x104) + 4
24-
; for 8 byte alignment
25-
RW_IRAM1 (0x20000000+0x108) (0x40000-0x108-Stack_Size) { ; RW data
23+
RW_IRAM1 (0x20000000) (0x40000-Stack_Size) { ; RW data
2624
.ANY (+RW +ZI)
2725
}
2826
ARM_LIB_STACK (0x20000000+0x40000) EMPTY -Stack_Size { ; stack

targets/TARGET_Maxim/TARGET_MAX32620C/device/TOOLCHAIN_IAR/MAX32620.icf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ define symbol __intvec_start__ = 0x0;
33
define symbol __region_ROM_start__ = 0x0;
44
define symbol __region_ROM_end__ = 0x001FFFFF;
55

6-
/* [RAM] Vector table dynamic copy: 65 vectors * 4 bytes = 260 (0x104) bytes + 4 for 8 byte align */
7-
define symbol __NVIC_start__ = 0x00000000;
8-
define symbol __NVIC_end__ = 0x00000108; /* to be aligned on 8 bytes */
6+
/* [RAM] */
97
define symbol __region_RAM_start__ = 0x20000000;
108
define symbol __region_RAM_end__ = 0x2003FFFF;
119

targets/TARGET_Maxim/TARGET_MAX32620C/mxc/nvic_table.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646
extern void (*ramVectorTable[MXC_IRQ_COUNT])(void);
4747

4848
#define NVIC_NUM_VECTORS (MXC_IRQ_COUNT)
49-
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable) // Vectors positioned at start of RAM
49+
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable)
5050

5151
#endif /* _NVIC_TABLE_H */

targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625NEXPAQ/MAX32625.sct

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! armcc -E
22
; MAX32625
3-
; 512KB FLASH (0x70000) @ 0x000010000
4-
; 160KB RAM (0x24F00) @ 0x20003100
3+
; 448KB FLASH (0x70000) @ 0x00010000
4+
; 147.5KB RAM (0x24E00) @ 0x20003200
55

66
#if !defined(MBED_BOOT_STACK_SIZE)
77
#define MBED_BOOT_STACK_SIZE 0x800
@@ -16,10 +16,9 @@ LR_IROM1 0x000010000 0x70000 { ; load region size_region
1616
.ANY (+RO)
1717
}
1818

19-
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
20-
RW_IRAM1 (0x20003100+0x110) (0x24F00-0x110-Stack_Size) { ; RW data
19+
RW_IRAM1 (0x20003200) (0x24E00-Stack_Size) { ; RW data
2120
.ANY (+RW +ZI)
2221
}
23-
ARM_LIB_STACK (0x20003100+0x24F00) EMPTY -Stack_Size { ; stack
22+
ARM_LIB_STACK (0x20003200+0x24E00) EMPTY -Stack_Size { ; stack
2423
}
2524
}

targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_BOOT/MAX32625.sct

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
2424
.ANY (+RO)
2525
}
2626

27-
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
28-
RW_IRAM1 (0x20000000+0x110) (0x28000-0x110-Stack_Size) { ; RW data
27+
RW_IRAM1 (0x20000000) (0x28000-Stack_Size) { ; RW data
2928
.ANY (+RW +ZI)
3029
}
3130
ARM_LIB_STACK (0x20000000+0x28000) EMPTY -Stack_Size { ; stack

targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_ARM_STD/TARGET_MAX32625_NO_BOOT/MAX32625.sct

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ LR_IROM1 0x000000000 0x80000 { ; load region size_region
1616
.ANY (+RO)
1717
}
1818

19-
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
20-
RW_IRAM1 (0x20000000+0x110) (0x28000-0x110-Stack_Size) { ; RW data
19+
RW_IRAM1 (0x20000000) (0x28000-Stack_Size) { ; RW data
2120
.ANY (+RW +ZI)
2221
}
2322
ARM_LIB_STACK (0x20000000+0x28000) EMPTY -Stack_Size { ; stack

targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_GCC_ARM/TARGET_MAX32625NEXPAQ/max32625.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ STACK_SIZE = MBED_BOOT_STACK_SIZE;
4040
MEMORY
4141
{
4242
FLASH (rx) : ORIGIN = 0x00010000, LENGTH = 0x00070000
43-
RAM (rwx) : ORIGIN = 0x20003100, LENGTH = 0x00024F00
43+
RAM (rwx) : ORIGIN = 0x20003200, LENGTH = 0x00024E00
4444
}
4545

4646
/* Linker script to place sections and symbol values. Should be used together

targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_IAR/TARGET_MAX32625NEXPAQ/MAX32625.icf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ define symbol __intvec_start__ = 0x00010000;
33
define symbol __region_ROM_start__ = 0x00010000;
44
define symbol __region_ROM_end__ = 0x0007FFFF;
55

6-
/* [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110) bytes */
7-
define symbol __NVIC_start__ = 0x00010000;
8-
define symbol __NVIC_end__ = 0x00010110; /* to be aligned on 8 bytes */
9-
define symbol __region_RAM_start__ = 0x20003100;
6+
/* [RAM] */
7+
define symbol __region_RAM_start__ = 0x20003200;
108
define symbol __region_RAM_end__ = 0x20027FFF;
119

1210
/* Memory regions */

targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_IAR/TARGET_MAX32625_BOOT/MAX32625.icf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ define symbol __intvec_start__ = MBED_APP_START;
1010
define symbol __region_ROM_start__ = MBED_APP_START;
1111
define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
1212

13-
/* [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110) bytes */
14-
define symbol __NVIC_start__ = 0x00010000;
15-
define symbol __NVIC_end__ = 0x00010110; /* to be aligned on 8 bytes */
13+
/* [RAM] */
1614
define symbol __region_RAM_start__ = 0x20000000;
1715
define symbol __region_RAM_end__ = 0x20027FFF;
1816

targets/TARGET_Maxim/TARGET_MAX32625/device/TOOLCHAIN_IAR/TARGET_MAX32625_NO_BOOT/MAX32625.icf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ define symbol __intvec_start__ = 0x00000000;
33
define symbol __region_ROM_start__ = 0x00000000;
44
define symbol __region_ROM_end__ = 0x0007FFFF;
55

6-
/* [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110) bytes */
7-
define symbol __NVIC_start__ = 0x00000000;
8-
define symbol __NVIC_end__ = 0x00000110; /* to be aligned on 8 bytes */
6+
/* [RAM] */
97
define symbol __region_RAM_start__ = 0x20000000;
108
define symbol __region_RAM_end__ = 0x20027FFF;
119

targets/TARGET_Maxim/TARGET_MAX32625/device/cmsis_nvic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
extern void (*ramVectorTable[MXC_IRQ_COUNT])(void);
3838

3939
#define NVIC_NUM_VECTORS (MXC_IRQ_COUNT)
40-
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable) // Vectors positioned at start of RAM
40+
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable)
4141

4242
#endif /* MBED_CMSIS_NVIC_H */
4343

targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_ARM_STD/MAX3263x.sct

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ LR_IROM1 0x000000000 0x200000 { ; load region size_region
1616
.ANY (+RO)
1717
}
1818

19-
; [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110)
20-
RW_IRAM1 (0x20000000+0x110) (0x80000-0x110-Stack_Size) { ; RW data
19+
RW_IRAM1 (0x20000000) (0x80000-Stack_Size) { ; RW data
2120
.ANY (+RW +ZI)
2221
}
2322
ARM_LIB_STACK (0x20000000+0x80000) EMPTY -Stack_Size { ; stack

targets/TARGET_Maxim/TARGET_MAX32630/device/TOOLCHAIN_IAR/MAX3263x.icf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ define symbol __intvec_start__ = 0x00000000;
33
define symbol __region_ROM_start__ = 0x00000000;
44
define symbol __region_ROM_end__ = 0x001FFFFF;
55

6-
/* [RAM] Vector table dynamic copy: 68 vectors * 4 bytes = 272 (0x110) bytes */
7-
define symbol __NVIC_start__ = 0x00000000;
8-
define symbol __NVIC_end__ = 0x00000110; /* to be aligned on 8 bytes */
6+
/* [RAM] */
97
define symbol __region_RAM_start__ = 0x20000000;
108
define symbol __region_RAM_end__ = 0x2007FFFF;
119

targets/TARGET_Maxim/TARGET_MAX32630/mxc/nvic_table.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@
4646
extern void (*ramVectorTable[MXC_IRQ_COUNT])(void);
4747

4848
#define NVIC_NUM_VECTORS (MXC_IRQ_COUNT)
49-
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable) // Vectors positioned at start of RAM
49+
#define NVIC_RAM_VECTOR_ADDRESS (ramVectorTable)
5050

5151
#endif /* _NVIC_TABLE_H */

0 commit comments

Comments
 (0)