Skip to content

Commit 5b08c96

Browse files
committed
Fixed psoc6 test application
1 parent a48bc60 commit 5b08c96

3 files changed

Lines changed: 68 additions & 7 deletions

File tree

test-app/ARM-psoc6.ld

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ SECTIONS
1010
.text :
1111
{
1212
_start_text = .;
13+
__Vectors = .;
1314
KEEP(*(.isr_vector))
15+
KEEP(*(.vectors))
1416
. = ALIGN(0x400);
1517
*(.text*)
1618
*(.rodata*)
1719
*(.init*)
1820
*(.fini*)
1921
. = ALIGN(4);
2022
_end_text = .;
23+
__etext = .;
2124
} > FLASH
2225

2326
.edidx :
@@ -31,25 +34,64 @@ SECTIONS
3134
.data : AT (_stored_data)
3235
{
3336
_start_data = .;
37+
__data_start__ = .;
38+
3439
KEEP(*(.data*))
3540
. = ALIGN(4);
41+
KEEP(*(.ramcode))
42+
. = ALIGN(4);
43+
/* preinit data */
44+
PROVIDE_HIDDEN (__preinit_array_start = .);
45+
KEEP(*(.preinit_array))
46+
PROVIDE_HIDDEN (__preinit_array_end = .);
47+
48+
. = ALIGN(4);
49+
/* init data */
50+
PROVIDE_HIDDEN (__init_array_start = .);
51+
KEEP(*(SORT(.init_array.*)))
52+
KEEP(*(.init_array))
53+
PROVIDE_HIDDEN (__init_array_end = .);
54+
55+
. = ALIGN(4);
56+
/* finit data */
57+
PROVIDE_HIDDEN (__fini_array_start = .);
58+
KEEP(*(SORT(.fini_array.*)))
59+
KEEP(*(.fini_array))
60+
PROVIDE_HIDDEN (__fini_array_end = .);
61+
62+
KEEP(*(.jcr*))
63+
. = ALIGN(4);
64+
65+
KEEP(*(.cy_ramfunc*))
66+
. = ALIGN(4);
67+
3668
_end_data = .;
69+
__data_end__ = .;
70+
3771
} > RAM
3872

3973
.bss (NOLOAD) :
4074
{
4175
_start_bss = .;
4276
__bss_start__ = .;
77+
__zero_table_start__ = .;
4378
*(.bss*)
4479
*(COMMON)
4580
. = ALIGN(4);
4681
_end_bss = .;
4782
__bss_end__ = .;
83+
__zero_table_end__ = .;
4884
_end = .;
85+
. = ALIGN(0x100);
86+
__ramVectors = .;
4987
} > RAM
5088
. = ALIGN(4);
5189
}
5290

5391
END_STACK = ORIGIN(RAM) + LENGTH(RAM);
54-
PROVIDE(_start_heap = _end);
55-
PROVIDE(_end_stack = ORIGIN(RAM) + LENGTH(RAM));
92+
PROVIDE(_end_stack = END_STACK);
93+
PROVIDE(_start_heap = END_STACK);
94+
95+
__StackTop = ORIGIN(RAM) + LENGTH(RAM);
96+
__StackLimit = __StackTop - 0x4000;
97+
PROVIDE(__stack = __StackTop);

test-app/Makefile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ ifeq ($(TARGET),stm32f7)
4646
LSCRIPT_TEMPLATE=ARM-stm32f7.ld
4747
CFLAGS+=-DDUALBANK_SWAP
4848
endif
49-
ifeq ($(TARGET),psoc6)
50-
LSCRIPT_TEMPLATE=ARM-psoc6.ld
51-
endif
52-
5349
LDFLAGS:=$(CFLAGS) -T $(LSCRIPT) -Wl,-gc-sections -Wl,-Map=image.map
5450

5551
ifeq ($(EXT_FLASH),1)
@@ -110,6 +106,22 @@ ifeq ($(TARGET),hifive1)
110106
APP_OBJS+=hifive1_write_page.o
111107
endif
112108

109+
# $(CYPRESS_PDL)/devices/templates/COMPONENT_MTB/COMPONENT_CM0P/system_psoc6_cm0plus.o
110+
111+
ifeq ($(TARGET),psoc6)
112+
LSCRIPT_TEMPLATE:=ARM-psoc6.ld
113+
APP_OBJS+= $(CYPRESS_PDL)/drivers/source/cy_gpio.o \
114+
$(CYPRESS_PDL)/drivers/source/cy_device.o
115+
CFLAGS+=-I$(CYPRESS_PDL)/drivers/include/ \
116+
-I$(CYPRESS_PDL)/devices/include \
117+
-I$(CYPRESS_PDL)/cmsis/include \
118+
-I$(CYPRESS_TARGET_LIB) \
119+
-I$(CYPRESS_CORE_LIB)/include \
120+
-I$(CYPRESS_PDL)/devices/include/ip \
121+
-I$(CYPRESS_PDL)/devices/templates/COMPONENT_MTB \
122+
-DCY8C624ABZI_D44
123+
endif
124+
113125
standalone:CFLAGS+=-DTEST_APP_STANDALONE
114126
standalone:LDFLAGS:=$(CFLAGS) -T standalone.ld -Wl,-gc-sections -Wl,-Map=image.map
115127

test-app/app_psoc6.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,16 @@
2626
#include <string.h>
2727
#include "wolfboot/wolfboot.h"
2828

29+
#include "cy_gpio.h"
30+
31+
#define BOOT_LED P1_5
32+
#define BOOT_D7 P5_7
33+
2934

3035
void main(void) {
31-
/* Wait for reboot */
36+
Cy_PDL_Init(CY_DEVICE_CFG);
37+
Cy_GPIO_Pin_FastInit(P5_7_PORT, P5_7_NUM, CY_GPIO_DM_PULLUP, 0UL, P5_7_GPIO);
38+
Cy_GPIO_Pin_FastInit(P1_5_PORT, P1_5_NUM, CY_GPIO_DM_PULLUP, 0UL, P1_5_GPIO);
3239
while(1)
3340
;
3441
}

0 commit comments

Comments
 (0)