Skip to content

Commit 37e0c5e

Browse files
hennadiykytsunadbridge
authored andcommitted
PSOC6: add ARMC6 support (fix issue #9830)
Update PDL syslib driver to 2.30. Update startup assembly and linker scripts.
1 parent 2f29ce6 commit 37e0c5e

File tree

30 files changed

+316
-49
lines changed

30 files changed

+316
-49
lines changed
Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! armcc -E
1+
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
22
; The first line specifies a preprocessor command that the linker invokes
33
; to pass a scatter file through a C preprocessor.
44

@@ -268,5 +268,31 @@ CYMETA 0x90500000
268268
.cymeta +0 { * (.cymeta) }
269269
}
270270

271+
/* The following symbols used by the cymcuelftool. */
272+
/* Flash */
273+
#define __cy_memory_0_start 0x10000000
274+
#define __cy_memory_0_length 0x00200000
275+
#define __cy_memory_0_row_size 0x200
276+
277+
/* Emulated EEPROM Flash area */
278+
#define __cy_memory_1_start 0x14000000
279+
#define __cy_memory_1_length 0x8000
280+
#define __cy_memory_1_row_size 0x200
281+
282+
/* Supervisory Flash */
283+
#define __cy_memory_2_start 0x16000000
284+
#define __cy_memory_2_length 0x8000
285+
#define __cy_memory_2_row_size 0x200
286+
287+
/* XIP */
288+
#define __cy_memory_3_start 0x18000000
289+
#define __cy_memory_3_length 0x08000000
290+
#define __cy_memory_3_row_size 0x200
291+
292+
/* eFuse */
293+
#define __cy_memory_4_start 0x90700000
294+
#define __cy_memory_4_length 0x100000
295+
#define __cy_memory_4_row_size 1
296+
271297

272298
/* [] END OF FILE */

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_4343W/device/system_psoc6.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***************************************************************************//**
22
* \file system_psoc6.h
3-
* \version 2.30
3+
* \version 2.40
44
*
55
* \brief Device system header file.
66
*
@@ -322,6 +322,7 @@
322322
* <tr>
323323
* <td>2.40</td>
324324
* <td>Updated assembler files, C files, linker scripts.</td>
325+
* <td>Added Arm Compiler 6 support.</td>
325326
* </tr>
326327
* <tr>
327328
* <td rowspan="2">2.30</td>
@@ -543,7 +544,11 @@ extern "C" {
543544
* \addtogroup group_system_config_system_functions
544545
* \{
545546
*/
546-
extern void SystemInit(void);
547+
#if defined(__ARMCC_VERSION)
548+
extern void SystemInit(void) __attribute__((constructor));
549+
#else
550+
extern void SystemInit(void);
551+
#endif /* (__ARMCC_VERSION) */
547552

548553
extern void SystemCoreClockUpdate(void);
549554
/** \} group_system_config_system_functions */

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_4343W/device/system_psoc6_cm4.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ void Cy_SysIpcPipeIsrCm4(void)
526526
}
527527
#endif
528528

529+
529530
/*******************************************************************************
530531
* Function Name: Cy_MemorySymbols
531532
****************************************************************************//**
@@ -535,7 +536,7 @@ void Cy_SysIpcPipeIsrCm4(void)
535536
* linker configuration files. The following symbols used by the cymcuelftool.
536537
*
537538
*******************************************************************************/
538-
#if defined (__ARMCC_VERSION)
539+
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
539540
__asm void Cy_MemorySymbols(void)
540541
{
541542
/* Flash */
@@ -588,8 +589,7 @@ __cy_memory_4_start EQU __cpp(0x90700000)
588589
__cy_memory_4_length EQU __cpp(0x100000)
589590
__cy_memory_4_row_size EQU __cpp(1)
590591
}
591-
592-
#endif /* defined (__ARMCC_VERSION) */
592+
#endif /* defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050) */
593593

594594

595595
/* [] END OF FILE */
Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! armcc -E
1+
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
22
; The first line specifies a preprocessor command that the linker invokes
33
; to pass a scatter file through a C preprocessor.
44

@@ -268,5 +268,31 @@ CYMETA 0x90500000
268268
.cymeta +0 { * (.cymeta) }
269269
}
270270

271+
/* The following symbols used by the cymcuelftool. */
272+
/* Flash */
273+
#define __cy_memory_0_start 0x10000000
274+
#define __cy_memory_0_length 0x00100000
275+
#define __cy_memory_0_row_size 0x200
276+
277+
/* Emulated EEPROM Flash area */
278+
#define __cy_memory_1_start 0x14000000
279+
#define __cy_memory_1_length 0x8000
280+
#define __cy_memory_1_row_size 0x200
281+
282+
/* Supervisory Flash */
283+
#define __cy_memory_2_start 0x16000000
284+
#define __cy_memory_2_length 0x8000
285+
#define __cy_memory_2_row_size 0x200
286+
287+
/* XIP */
288+
#define __cy_memory_3_start 0x18000000
289+
#define __cy_memory_3_length 0x08000000
290+
#define __cy_memory_3_row_size 0x200
291+
292+
/* eFuse */
293+
#define __cy_memory_4_start 0x90700000
294+
#define __cy_memory_4_length 0x100000
295+
#define __cy_memory_4_row_size 1
296+
271297

272298
/* [] END OF FILE */

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/device/system_psoc6.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@
322322
* <tr>
323323
* <td>2.40</td>
324324
* <td>Updated assembler files, C files, linker scripts.</td>
325+
* <td>Added Arm Compiler 6 support.</td>
325326
* </tr>
326327
* <tr>
327328
* <td rowspan="2">2.30</td>
@@ -543,7 +544,11 @@ extern "C" {
543544
* \addtogroup group_system_config_system_functions
544545
* \{
545546
*/
546-
extern void SystemInit(void);
547+
#if defined(__ARMCC_VERSION)
548+
extern void SystemInit(void) __attribute__((constructor));
549+
#else
550+
extern void SystemInit(void);
551+
#endif /* (__ARMCC_VERSION) */
547552

548553
extern void SystemCoreClockUpdate(void);
549554
/** \} group_system_config_system_functions */

targets/TARGET_Cypress/TARGET_PSOC6/TARGET_CY8CKIT_062_BLE/device/system_psoc6_cm4.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ void Cy_SysIpcPipeIsrCm4(void)
526526
}
527527
#endif
528528

529+
529530
/*******************************************************************************
530531
* Function Name: Cy_MemorySymbols
531532
****************************************************************************//**
@@ -535,7 +536,7 @@ void Cy_SysIpcPipeIsrCm4(void)
535536
* linker configuration files. The following symbols used by the cymcuelftool.
536537
*
537538
*******************************************************************************/
538-
#if defined (__ARMCC_VERSION)
539+
#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
539540
__asm void Cy_MemorySymbols(void)
540541
{
541542
/* Flash */
@@ -588,8 +589,7 @@ __cy_memory_4_start EQU __cpp(0x90700000)
588589
__cy_memory_4_length EQU __cpp(0x100000)
589590
__cy_memory_4_row_size EQU __cpp(1)
590591
}
591-
592-
#endif /* defined (__ARMCC_VERSION) */
592+
#endif /* defined (__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050) */
593593

594594

595595
/* [] END OF FILE */
Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! armcc -E
1+
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m0
22
; The first line specifies a preprocessor command that the linker invokes
33
; to pass a scatter file through a C preprocessor.
44

@@ -46,10 +46,26 @@
4646
#define MBED_ROM_START 0x10000000
4747
#endif
4848

49+
;* MBED_APP_START is being used by the bootloader build script and
50+
;* will be calculate by the system. Without bootloader the MBED_APP_START
51+
;* is equal to MBED_ROM_START
52+
;*
53+
#if !defined(MBED_APP_START)
54+
#define MBED_APP_START MBED_ROM_START
55+
#endif
56+
4957
#if !defined(MBED_ROM_SIZE)
5058
#define MBED_ROM_SIZE 0x80000
5159
#endif
5260

61+
;* MBED_APP_SIZE is being used by the bootloader build script and
62+
;* will be calculate by the system. Without bootloader the MBED_APP_SIZE
63+
;* is equal to MBED_ROM_SIZE
64+
;*
65+
#if !defined(MBED_APP_SIZE)
66+
#define MBED_APP_SIZE MBED_ROM_SIZE
67+
#endif
68+
5369
#if !defined(MBED_RAM_START)
5470
#define MBED_RAM_START 0x08000000
5571
#endif
@@ -88,8 +104,8 @@
88104
#define PUBLIC_RAM_START MBED_PUBLIC_RAM_START
89105
#define PUBLIC_RAM_SIZE MBED_PUBLIC_RAM_SIZE
90106
; Flash
91-
#define FLASH_START MBED_ROM_START
92-
#define FLASH_SIZE MBED_ROM_SIZE
107+
#define FLASH_START MBED_APP_START
108+
#define FLASH_SIZE MBED_APP_SIZE
93109

94110
; The following defines describe a 32K flash region used for EEPROM emulation.
95111
; This region can also be used as the general purpose flash.
@@ -164,7 +180,7 @@ LR_IROM1 FLASH_START (FLASH_SIZE - 0x8000)
164180
{
165181
* (.noinit)
166182
}
167-
183+
168184
RW_IRAM2 PUBLIC_RAM_START UNINIT
169185
{
170186
* (.cy_sharedmem)
@@ -177,7 +193,7 @@ LR_IROM1 FLASH_START (FLASH_SIZE - 0x8000)
177193
}
178194

179195
; Stack region growing down
180-
ARM_LIB_STACK RAM_START+RAM_SIZE -Stack_Size
196+
ARM_LIB_STACK RAM_START+RAM_SIZE -Stack_Size
181197
{
182198
* (STACK)
183199
}
@@ -264,5 +280,31 @@ CYMETA 0x90500000
264280
.cymeta +0 { * (.cymeta) }
265281
}
266282

283+
/* The following symbols used by the cymcuelftool. */
284+
/* Flash */
285+
#define __cy_memory_0_start 0x10000000
286+
#define __cy_memory_0_length 0x00100000
287+
#define __cy_memory_0_row_size 0x200
288+
289+
/* Emulated EEPROM Flash area */
290+
#define __cy_memory_1_start 0x14000000
291+
#define __cy_memory_1_length 0x8000
292+
#define __cy_memory_1_row_size 0x200
293+
294+
/* Supervisory Flash */
295+
#define __cy_memory_2_start 0x16000000
296+
#define __cy_memory_2_length 0x8000
297+
#define __cy_memory_2_row_size 0x200
298+
299+
/* XIP */
300+
#define __cy_memory_3_start 0x18000000
301+
#define __cy_memory_3_length 0x08000000
302+
#define __cy_memory_3_row_size 0x200
303+
304+
/* eFuse */
305+
#define __cy_memory_4_start 0x90700000
306+
#define __cy_memory_4_length 0x100000
307+
#define __cy_memory_4_row_size 1
308+
267309

268310
/* [] END OF FILE */

0 commit comments

Comments
 (0)