board.mk 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. DEPS_SUBMODULES += hw/mcu/microchip
  2. CFLAGS += \
  3. -mthumb \
  4. -mabi=aapcs \
  5. -mcpu=cortex-m7 \
  6. -mfloat-abi=hard \
  7. -mfpu=fpv4-sp-d16 \
  8. -nostdlib -nostartfiles \
  9. -D__SAME70Q21B__ \
  10. -DCFG_TUSB_MCU=OPT_MCU_SAMX7X
  11. # suppress following warnings from mcu driver
  12. CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=cast-qual -Wno-error=redundant-decls
  13. ASF_DIR = hw/mcu/microchip/same70
  14. # All source paths should be relative to the top level.
  15. LD_FILE = $(ASF_DIR)/same70b/gcc/gcc/same70q21b_flash.ld
  16. SRC_C += \
  17. src/portable/microchip/samx7x/dcd_samx7x.c \
  18. $(ASF_DIR)/same70b/gcc/gcc/startup_same70q21b.c \
  19. $(ASF_DIR)/same70b/gcc/system_same70q21b.c \
  20. $(ASF_DIR)/hpl/core/hpl_init.c \
  21. $(ASF_DIR)/hpl/usart/hpl_usart.c \
  22. $(ASF_DIR)/hpl/pmc/hpl_pmc.c \
  23. $(ASF_DIR)/hal/src/hal_usart_async.c \
  24. $(ASF_DIR)/hal/src/hal_io.c \
  25. $(ASF_DIR)/hal/src/hal_atomic.c \
  26. $(ASF_DIR)/hal/utils/src/utils_ringbuffer.c
  27. INC += \
  28. $(TOP)/hw/bsp/$(BOARD) \
  29. $(TOP)/$(ASF_DIR) \
  30. $(TOP)/$(ASF_DIR)/config \
  31. $(TOP)/$(ASF_DIR)/same70b/include \
  32. $(TOP)/$(ASF_DIR)/hal/include \
  33. $(TOP)/$(ASF_DIR)/hal/utils/include \
  34. $(TOP)/$(ASF_DIR)/hpl/core \
  35. $(TOP)/$(ASF_DIR)/hpl/pio \
  36. $(TOP)/$(ASF_DIR)/hpl/pmc \
  37. $(TOP)/$(ASF_DIR)/hri \
  38. $(TOP)/$(ASF_DIR)/CMSIS/Core/Include
  39. # For freeRTOS port source
  40. FREERTOS_PORT = ARM_CM7
  41. # For flash-jlink target
  42. JLINK_DEVICE = SAME70Q21B
  43. # flash using edbg from https://github.com/ataradov/edbg
  44. # Note: SAME70's GPNVM1 must be set to 1 to boot from flash with
  45. # edbg -t same70 -F w0,1,1
  46. flash: $(BUILD)/$(PROJECT).bin
  47. edbg --verbose -t same70 -pv -f $<