Makefile.psoc62 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # Makefile for CW308T-PSOC62 Target, with CY8C6247BZI-D44 device
  2. VPATH += :$(HALPATH)/psoc62
  3. VPATH += :$(HALPATH)/psoc62/psoc6sw-1.1/components/psoc6pdl/devices/psoc6/startup/gcc
  4. VPATH += :$(HALPATH)/psoc62/psoc6sw-1.1/components/psoc6pdl/devices/psoc6/startup
  5. VPATH += :$(HALPATH)/psoc62/generated_source
  6. VPATH += :$(HALPATH)/psoc62/psoc6sw-1.1/components/psoc6pdl/drivers/source
  7. VPATH += :$(HALPATH)/psoc62/psoc6sw-1.1/components/psoc6pdl/drivers/source/TOOLCHAIN_GCC_ARM
  8. VPATH += :$(HALPATH)/psoc62/COMPONENT_CM0P_CRYPTO
  9. EXTRAINCDIRS += $(HALPATH)/psoc62 $(HALPATH)/psoc62/generated_source
  10. EXTRAINCDIRS += $(HALPATH)/psoc62/psoc6sw-1.1/components/psoc6pdl/cmsis/include
  11. EXTRAINCDIRS += $(HALPATH)/psoc62/psoc6sw-1.1/components/psoc6pdl/devices/psoc6/include
  12. EXTRAINCDIRS += $(HALPATH)/psoc62/psoc6sw-1.1/components/psoc6pdl/drivers/include
  13. SRC += system_psoc6_cm4.c psoc62_hal.c
  14. ASRC += startup_psoc6_01_cm4.S cy_syslib_gcc.S
  15. SRC += cycfg_clocks.c \
  16. cycfg_peripherals.c \
  17. cycfg_pins.c \
  18. cycfg_platform.c \
  19. cycfg_routing.c \
  20. cycfg.c
  21. # Only 1 of these gets actually included
  22. SRC += psoc6_01_cm0p_crypto.c
  23. SRC += psoc6_02_cm0p_crypto.c
  24. SRC += psoc6_03_cm0p_crypto.c
  25. SRC += cy_crypto_core_hw.c \
  26. cy_crypto_core_hw_v1.c \
  27. cy_crypto_core_aes_v1.c \
  28. cy_crypto_core_aes_v2.c \
  29. cy_crypto_core_mem_v1.c \
  30. cy_crypto_core_mem_v2.c \
  31. cy_device.c \
  32. cy_efuse.c \
  33. cy_flash.c \
  34. cy_gpio.c \
  35. cy_ipc_drv.c \
  36. cy_ipc_pipe.c \
  37. cy_ipc_sema.c \
  38. cy_prot.c \
  39. cy_scb_common.c \
  40. cy_scb_uart.c \
  41. cy_sysclk.c \
  42. cy_syslib.c \
  43. cy_sysint.c \
  44. cy_syspm.c \
  45. cy_systick.c
  46. MCU_FLAGS = -mcpu=cortex-m4
  47. CC = arm-none-eabi-gcc
  48. OBJCOPY = arm-none-eabi-objcopy
  49. OBJDUMP = arm-none-eabi-objdump
  50. SIZE = arm-none-eabi-size
  51. AR = arm-none-eabi-ar rcs
  52. NM = arm-none-eabi-nm
  53. #Output Format = Binary for this target
  54. FORMAT = binary
  55. CFLAGS += -fdata-sections -ffunction-sections -mthumb -mlong-calls -ffat-lto-objects -mfloat-abi=soft
  56. CPPFLAGS += $(CFLAGS)
  57. ASFLAGS += -mthumb -mfloat-abi=soft
  58. CDEFS += -DCY8C6247BZI_D44
  59. CDEFS += -DAPP_NAME='"CustomApp_cm4"'
  60. CDEFS += -DDEBUG
  61. CPPDEFS += $(CDEFS)
  62. #TODO - somehow with 's' optimization causes a fault later (!)
  63. OPT = 1
  64. LDFLAGS += -specs=nano.specs -T $(HALPATH)/psoc62/cy8c6xx7_cm4_dual.ld -Xlinker --gc-sections -lm
  65. ### Special signing needed for image to actually load
  66. MCUELFTOOL = $(HALPATH)/psoc62/tools/win_x64/cymcuelftool.exe
  67. #Check if still needed
  68. #signed: all
  69. # $(MCUELFTOOL) --sign $(TARGET-PLAT).elf --output $(TARGET-PLAT)_cm4_signed.elf
  70. # $(MCUELFTOOL) --merge $(TARGET-PLAT)_cm4_signed.elf $(HALPATH)/psoc62/psoc6_01_cm0p_sleep_signed.elf --output $(TARGET-PLAT)_cm4_final.elf