2019-09-01 11:10:28 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								CFLAGS += \
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-20 16:06:40 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  -flto \
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 11:10:28 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -mthumb \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -mabi=aapcs-linux \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -mcpu=cortex-m0plus \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -nostdlib -nostartfiles \
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-20 16:06:40 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  -D__SAMD21G18A__ \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -DCONF_DFLL_OVERWRITE_CALIBRATION=0 \
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 11:10:28 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -DCFG_TUSB_MCU=OPT_MCU_SAMD21
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# All source paths should be relative to the top level.
							 | 
						
					
						
							
								
									
										
										
										
											2020-03-07 17:49:30 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								LD_FILE = hw/bsp/$(BOARD)/samd21g18a_flash.ld
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 11:10:28 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								SRC_C += \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/samd/asf4/samd21/gcc/gcc/startup_samd21.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/samd/asf4/samd21/gcc/system_samd21.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/samd/asf4/samd21/hpl/gclk/hpl_gclk.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/samd/asf4/samd21/hpl/pm/hpl_pm.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/samd/asf4/samd21/hpl/sysctrl/hpl_sysctrl.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									hw/mcu/microchip/samd/asf4/samd21/hal/src/hal_atomic.c
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								INC += \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/samd/asf4/samd21/ \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/samd/asf4/samd21/config \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/samd/asf4/samd21/include \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/samd/asf4/samd21/hal/include \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/samd/asf4/samd21/hal/utils/include \
							 | 
						
					
						
							
								
									
										
										
										
											2020-01-11 18:25:38 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/samd/asf4/samd21/hpl/pm/ \
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 11:10:28 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/samd/asf4/samd21/hpl/port \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/samd/asf4/samd21/hri \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/hw/mcu/microchip/samd/asf4/samd21/CMSIS/Include
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# For TinyUSB port source 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								VENDOR = microchip
							 | 
						
					
						
							
								
									
										
										
										
											2019-12-26 21:46:59 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								CHIP_FAMILY = samd
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 11:10:28 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# For freeRTOS port source
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								FREERTOS_PORT = ARM_CM0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# For flash-jlink target
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								JLINK_DEVICE = ATSAMD21G18
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											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=0x2000 -e -w $^ -R
							 |