| 
									
										
										
										
											2021-03-18 16:28:44 +07:00
										 |  |  | DEPS_SUBMODULES += hw/mcu/sony/cxd56/spresense-exported-sdk | 
					
						
							| 
									
										
										
										
											2021-03-04 22:50:45 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-22 15:56:56 +01:00
										 |  |  | # Platforms are: Linux, Darwin, MSYS, CYGWIN
 | 
					
						
							|  |  |  | PLATFORM := $(firstword $(subst _, ,$(shell uname -s 2>/dev/null))) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ifeq ($(PLATFORM),Darwin) | 
					
						
							|  |  |  |   # macOS | 
					
						
							|  |  |  |   MKSPK = $(TOP)/hw/mcu/sony/cxd56/mkspk/mkspk | 
					
						
							|  |  |  | else ifeq ($(PLATFORM),Linux) | 
					
						
							|  |  |  |   # Linux | 
					
						
							|  |  |  |   MKSPK = $(TOP)/hw/mcu/sony/cxd56/mkspk/mkspk | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |   # Cygwin/MSYS2 | 
					
						
							|  |  |  |   MKSPK = $(TOP)/hw/mcu/sony/cxd56/mkspk/mkspk.exe | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SERIAL ?= /dev/ttyUSB0 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-03 14:22:43 +02:00
										 |  |  | CFLAGS += \
 | 
					
						
							|  |  |  | 	-DCONFIG_HAVE_DOUBLE \
 | 
					
						
							|  |  |  | 	-Dmain=spresense_main \
 | 
					
						
							|  |  |  | 	-pipe \
 | 
					
						
							|  |  |  | 	-std=gnu11 \
 | 
					
						
							|  |  |  | 	-mcpu=cortex-m4 \
 | 
					
						
							|  |  |  | 	-mthumb \
 | 
					
						
							|  |  |  | 	-mfpu=fpv4-sp-d16 \
 | 
					
						
							|  |  |  | 	-mfloat-abi=hard \
 | 
					
						
							|  |  |  | 	-mabi=aapcs \
 | 
					
						
							|  |  |  | 	-fno-builtin \
 | 
					
						
							|  |  |  | 	-fno-strength-reduce \
 | 
					
						
							|  |  |  | 	-fomit-frame-pointer \
 | 
					
						
							| 
									
										
										
										
											2021-01-22 15:56:56 +01:00
										 |  |  | 	-Wno-error=undef \
 | 
					
						
							|  |  |  | 	-Wno-error=cast-align \
 | 
					
						
							|  |  |  | 	-Wno-error=unused-parameter \
 | 
					
						
							| 
									
										
										
										
											2019-10-03 14:22:43 +02:00
										 |  |  | 	-DCFG_TUSB_MCU=OPT_MCU_CXD56 \
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-29 14:06:44 +07:00
										 |  |  | # suppress following warnings from mcu driver
 | 
					
						
							| 
									
										
										
										
											2020-03-09 15:51:29 +07:00
										 |  |  | # lwip/src/core/raw.c:334:43: error: declaration of 'recv' shadows a global declaration
 | 
					
						
							| 
									
										
										
										
											2022-06-29 14:06:44 +07:00
										 |  |  | CFLAGS += -Wno-error=shadow  -Wno-error=redundant-decls | 
					
						
							| 
									
										
										
										
											2021-01-22 15:56:56 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-23 12:43:13 +07:00
										 |  |  | LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-20 16:06:40 +07:00
										 |  |  | SPRESENSE_SDK = $(TOP)/hw/mcu/sony/cxd56/spresense-exported-sdk | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-17 16:52:07 +07:00
										 |  |  | SRC_C += src/portable/sony/cxd56/dcd_cxd56.c | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-20 16:06:40 +07:00
										 |  |  | INC += \
 | 
					
						
							|  |  |  | 	$(SPRESENSE_SDK)/nuttx/include \
 | 
					
						
							|  |  |  | 	$(SPRESENSE_SDK)/nuttx/arch \
 | 
					
						
							|  |  |  | 	$(SPRESENSE_SDK)/nuttx/arch/chip \
 | 
					
						
							| 
									
										
										
										
											2021-01-22 15:56:56 +01:00
										 |  |  | 	$(SPRESENSE_SDK)/nuttx/arch/os \
 | 
					
						
							|  |  |  | 	$(SPRESENSE_SDK)/sdk/include \
 | 
					
						
							| 
									
										
										
										
											2019-11-20 16:06:40 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-03 14:22:43 +02:00
										 |  |  | LIBS += \
 | 
					
						
							| 
									
										
										
										
											2021-01-22 15:56:56 +01:00
										 |  |  | 	$(SPRESENSE_SDK)/nuttx/libs/libapps.a \
 | 
					
						
							|  |  |  | 	$(SPRESENSE_SDK)/nuttx/libs/libnuttx.a \
 | 
					
						
							| 
									
										
										
										
											2019-10-03 14:22:43 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-22 15:56:56 +01:00
										 |  |  | LD_FILE = hw/mcu/sony/cxd56/spresense-exported-sdk/nuttx/scripts/ramconfig.ld | 
					
						
							| 
									
										
										
										
											2019-10-03 14:22:43 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | LDFLAGS += \
 | 
					
						
							|  |  |  | 	-Xlinker --entry=__start \
 | 
					
						
							|  |  |  | 	-nostartfiles \
 | 
					
						
							|  |  |  | 	-nodefaultlibs \
 | 
					
						
							|  |  |  | 	-Wl,--gc-sections \
 | 
					
						
							| 
									
										
										
										
											2021-03-17 16:52:07 +07:00
										 |  |  | 	-u spresense_main | 
					
						
							| 
									
										
										
										
											2019-10-03 14:22:43 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-26 12:46:24 +07:00
										 |  |  | $(MKSPK): $(BUILD)/$(PROJECT).elf | 
					
						
							| 
									
										
										
										
											2021-01-22 15:56:56 +01:00
										 |  |  | 	$(MAKE) -C $(TOP)/hw/mcu/sony/cxd56/mkspk | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-26 12:46:24 +07:00
										 |  |  | $(BUILD)/$(PROJECT).spk: $(MKSPK) | 
					
						
							| 
									
										
										
										
											2020-04-17 11:48:09 +07:00
										 |  |  | 	@echo CREATE $@ | 
					
						
							| 
									
										
										
										
											2021-01-26 12:46:24 +07:00
										 |  |  | 	@$(MKSPK) -c 2 $(BUILD)/$(PROJECT).elf nuttx $@ | 
					
						
							| 
									
										
										
										
											2020-04-17 11:48:09 +07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-03 14:22:43 +02:00
										 |  |  | # flash
 | 
					
						
							| 
									
										
										
										
											2021-01-26 12:46:24 +07:00
										 |  |  | flash: $(BUILD)/$(PROJECT).spk | 
					
						
							| 
									
										
										
										
											2021-09-07 13:30:51 +07:00
										 |  |  | 	@echo FLASH $< | 
					
						
							|  |  |  | 	@$(PYTHON) $(TOP)/hw/mcu/sony/cxd56/tools/flash_writer.py -s -c $(SERIAL) -d -b 115200 -n $< |