2021-03-01 00:39:48 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								UF2_FAMILY_ID = 0x2abc77ec
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-28 19:53:31 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								SDK_DIR = hw/mcu/nxp/mcux-sdk
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-26 22:10:13 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								DEPS_SUBMODULES += lib/CMSIS_5 lib/sct_neopixel $(SDK_DIR)
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-01 00:39:48 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								include $(TOP)/$(BOARD_PATH)/board.mk
							 | 
						
					
						
							
								
									
										
										
										
											2023-06-24 18:38:41 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								CPU_CORE ?= cortex-m33
							 | 
						
					
						
							
								
									
										
										
										
											2023-11-23 12:43:13 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								MCU_DIR = $(SDK_DIR)/devices/$(MCU_VARIANT)
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-01 00:39:48 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-28 19:53:31 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Default to Highspeed PORT1
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								PORT ?= 1
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-01 12:18:37 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-02 22:53:15 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								CFLAGS += \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -flto \
							 | 
						
					
						
							
								
									
										
										
										
											2024-04-24 22:41:22 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  -D__STARTUP_CLEAR_BSS \
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-02 22:53:15 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -DCFG_TUSB_MCU=OPT_MCU_LPC55XX \
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-01 12:18:37 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  -DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))' \
							 | 
						
					
						
							
								
									
										
										
										
											2024-04-24 22:41:22 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  -DBOARD_TUD_RHPORT=$(PORT) \
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-01 12:18:37 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								ifeq ($(PORT), 1)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  $(info "PORT1 High Speed")
							 | 
						
					
						
							
								
									
										
										
										
											2022-06-01 23:53:40 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  CFLAGS += -DBOARD_TUD_MAX_SPEED=OPT_MODE_HIGH_SPEED
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-24 13:36:05 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  # LPC55 Highspeed Port1 can only write to USB_SRAM region
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  CFLAGS += -DCFG_TUSB_MEM_SECTION='__attribute__((section("m_usb_global")))'
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-01 12:18:37 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								else
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  $(info "PORT0 Full Speed")
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								endif
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-02 22:53:15 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# mcu driver cause following warnings
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								CFLAGS += -Wno-error=unused-parameter -Wno-error=float-equal
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2024-04-24 22:41:22 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								LDFLAGS_GCC += \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  -nostartfiles \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  --specs=nosys.specs --specs=nano.specs \
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-02 22:53:15 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# All source paths should be relative to the top level.
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-01 12:18:37 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								LD_FILE ?= $(MCU_DIR)/gcc/$(MCU_CORE)_flash.ld
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-02 22:53:15 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								SRC_C += \
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-17 16:52:07 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-01 12:18:37 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(MCU_DIR)/system_$(MCU_CORE).c \
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-02 22:53:15 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(MCU_DIR)/drivers/fsl_clock.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(MCU_DIR)/drivers/fsl_power.c \
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-03 18:11:13 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(MCU_DIR)/drivers/fsl_reset.c \
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-28 19:53:31 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(SDK_DIR)/drivers/lpc_gpio/fsl_gpio.c \
							 | 
						
					
						
							
								
									
										
										
										
											2022-10-24 18:43:21 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(SDK_DIR)/drivers/common/fsl_common_arm.c \
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-28 19:53:31 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(SDK_DIR)/drivers/flexcomm/fsl_flexcomm.c \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(SDK_DIR)/drivers/flexcomm/fsl_usart.c \
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-05 22:49:29 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									lib/sct_neopixel/sct_neopixel.c
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-02 22:53:15 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								INC += \
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-01 00:39:48 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(TOP)/$(BOARD_PATH) \
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-10 18:31:40 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(TOP)/lib/sct_neopixel \
							 | 
						
					
						
							
								
									
										
										
										
											2023-04-26 22:10:13 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(TOP)/lib/CMSIS_5/CMSIS/Core/Include \
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-02 22:53:15 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/$(MCU_DIR) \
							 | 
						
					
						
							
								
									
										
										
										
											2021-04-28 19:53:31 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									$(TOP)/$(MCU_DIR)/drivers \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/$(SDK_DIR)/drivers/common \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/$(SDK_DIR)/drivers/flexcomm \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/$(SDK_DIR)/drivers/lpc_iocon \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/$(SDK_DIR)/drivers/lpc_gpio \
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									$(TOP)/$(SDK_DIR)/drivers/sctimer
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-02 22:53:15 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-01 12:18:37 +07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								SRC_S += $(MCU_DIR)/gcc/startup_$(MCU_CORE).S
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-02 22:53:15 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								LIBS += $(TOP)/$(MCU_DIR)/gcc/libpower_hardabi.a
							 |