2019-07-01 22:57:23 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								CFLAGS += \
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-20 16:06:40 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  -flto \
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-01 22:57:23 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -mthumb \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -mabi=aapcs-linux \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -mcpu=cortex-m4 \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -mfloat-abi=hard \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -mfpu=fpv4-sp-d16 \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -nostdlib -nostartfiles \
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-20 16:06:40 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  -D__SAMD51J19A__ \
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-01 22:57:23 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -DCFG_TUSB_MCU=OPT_MCU_SAMD51
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								CFLAGS += -Wno-error=undef
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# All source paths should be relative to the top level.
							 | 
						
					
						
							
								
									
										
										
										
											2020-03-07 17:49:30 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								LD_FILE = hw/bsp/$(BOARD)/samd51g19a_flash.ld
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-01 22:57:23 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								SRC_C += \
							 | 
						
					
						
							
								
									
										
										
										
											2020-11-08 18:09:53 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/asf4/samd51/gcc/gcc/startup_samd51.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/asf4/samd51/gcc/system_samd51.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/asf4/samd51/hpl/gclk/hpl_gclk.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/asf4/samd51/hpl/mclk/hpl_mclk.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/asf4/samd51/hpl/osc32kctrl/hpl_osc32kctrl.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/asf4/samd51/hpl/oscctrl/hpl_oscctrl.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/asf4/samd51/hal/src/hal_atomic.c
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-01 22:57:23 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								INC += \
							 | 
						
					
						
							
								
									
										
										
										
											2020-11-08 18:09:53 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/asf4/samd51/ \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/asf4/samd51/config \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/asf4/samd51/include \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/asf4/samd51/hal/include \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/asf4/samd51/hal/utils/include \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/asf4/samd51/hpl/port \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/asf4/samd51/hri \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/asf4/samd51/CMSIS/Include
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-01 22:57:23 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# For TinyUSB port source
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								VENDOR = microchip
							 | 
						
					
						
							
								
									
										
										
										
											2019-12-26 21:46:59 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								CHIP_FAMILY = samd
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-01 22:57:23 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# For freeRTOS port source
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								FREERTOS_PORT = ARM_CM4F
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# For flash-jlink target
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								JLINK_DEVICE = ATSAMD51J19
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-07-23 01:39:15 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# flash using bossac at least version 1.8
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# can be found in arduino15/packages/arduino/tools/bossac/
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Add it to your PATH or change BOSSAC variable to match your installation
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								BOSSAC = bossac
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								flash: $(BUILD)/$(BOARD)-firmware.bin
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyACM0)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(BOSSAC) --port=$(SERIAL) -U -i --offset=0x4000 -e -w $^ -R
							 |