2019-08-24 00:52:46 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								CFLAGS += \
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-20 16:06:40 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  -flto \
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-24 00:52:46 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -mthumb \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -mabi=aapcs \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -mcpu=cortex-m0plus \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -DCPU_LPC51U68JBD64 \
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-03 13:25:36 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  -DCFG_TUSB_MCU=OPT_MCU_LPC51UXX \
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 14:51:40 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  -DCFG_TUSB_MEM_SECTION='__attribute__((section(".data")))' \
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-24 00:52:46 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-27 00:15:43 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# mcu driver cause following warnings
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								CFLAGS += -Wno-error=nested-externs -Wno-error=unused-parameter
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-03 13:25:36 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-11 11:51:51 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								MCU_DIR = hw/mcu/nxp/sdk/devices/LPC51U68
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 15:11:09 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-24 00:52:46 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# All source paths should be relative to the top level.
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 15:11:09 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								LD_FILE = $(MCU_DIR)/gcc/LPC51U68_flash.ld
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-24 00:52:46 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								SRC_C += \
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 15:11:09 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(MCU_DIR)/system_LPC51U68.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(MCU_DIR)/drivers/fsl_clock.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(MCU_DIR)/drivers/fsl_gpio.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(MCU_DIR)/drivers/fsl_power.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(MCU_DIR)/drivers/fsl_reset.c
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-24 00:52:46 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								INC += \
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-05 16:12:13 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(TOP)/$(MCU_DIR)/../../CMSIS/Include \
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 15:11:09 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(TOP)/$(MCU_DIR) \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/$(MCU_DIR)/drivers
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-24 00:52:46 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 15:11:09 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								SRC_S += $(MCU_DIR)/gcc/startup_LPC51U68.S
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-24 00:52:46 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 15:11:09 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower.a
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-31 22:44:08 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-24 00:52:46 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# For TinyUSB port source
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								VENDOR = nxp
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 16:44:40 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								CHIP_FAMILY = lpc_ip3511
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-24 00:52:46 +07:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# For freeRTOS port source
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								FREERTOS_PORT = ARM_CM0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# For flash-jlink target
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								JLINK_DEVICE = LPC51U68
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								JLINK_IF = swd
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-01 21:04:43 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# flash using pyocd (51u68 is not supported yet)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								flash: $(BUILD)/$(BOARD)-firmware.hex
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									pyocd flash -t LPC51U68 $<
							 |