sudar / Arduino-Makefile

Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.
http://hardwarefun.com/tutorials/compiling-arduino-sketches-using-makefile
GNU Lesser General Public License v2.1
2.02k stars 449 forks source link

Seeduino XIAO not building. #672

Open mikijov opened 2 years ago

mikijov commented 2 years ago

Hi. I am trying to use Arduino-Makefile to build Seeduino XIAO code. While having years of programming experience, I am 1 day old on arduino, so I am stumbling a bit. I am on Arch linux BTW.

I made a simple blink.ino, and Makefile.

ARDUINO_DIR = /usr/share/arduino
ARDMK_DIR = ~/project/Arduino-Makefile
ARDUINO_PACKAGE_DIR = /home/miki/.arduino15/packages

ARDMK_VENDOR = Seeeduino
BOARD_TAG    = seeed_XIAO_m0
ARDUINO_LIBS =

include $(ARDMK_DIR)/Sam.mk

This does not build as several directories are properly calculated/detected. Please see the diff below that allowed me to build.

I was thinking of submitting this as a PR, but I fear this will break other configurations. Can someone suggest how Arduino-Makefile usually deal with differences in directory structures.

diff --git a/Sam.mk b/Sam.mk
index 2e19730..41f8333 100644
--- a/Sam.mk
+++ b/Sam.mk
@@ -72,7 +72,7 @@ else
 endif

 ifndef CMSIS_VER
-    CMSIS_VER := $(wildcard $(ARDUINO_PACKAGE_DIR)/$(ARDMK_VENDOR)/tools/CMSIS/4.*)
+    CMSIS_VER := $(wildcard $(ARDUINO_PACKAGE_DIR)/$(ARDMK_VENDOR)/tools/CMSIS/5.*)
     ifneq ($(CMSIS_VER),)
         CMSIS_VER := $(shell basename $(CMSIS_VER))
         $(call show_config_variable,CMSIS_VER,[AUTODETECTED],(from ARDUINO_PACKAGE_DIR))
@@ -104,7 +104,7 @@ endif

 ifndef CMSIS_ATMEL_DIR
     ifeq ($(findstring samd, $(strip $(ARCHITECTURE))), samd)
-        CMSIS_ATMEL_DIR := $(ARDUINO_PACKAGE_DIR)/$(ARDMK_VENDOR)/tools/CMSIS-Atmel/$(CMSIS_ATMEL_VER)/CMSIS
+        CMSIS_ATMEL_DIR := $(ARDUINO_PACKAGE_DIR)/$(ARDMK_VENDOR)/tools/CMSIS-Atmel/$(CMSIS_ATMEL_VER)/CMSIS-Atmel/CMSIS
     else
         CMSIS_ATMEL_DIR = $(ALTERNATE_CORE_PATH)/system/CMSIS
     endif
@@ -137,7 +137,7 @@ endif
 CPPFLAGS += -I$(CMSIS_DIR)/Include/
 CPPFLAGS += -I$(CMSIS_ATMEL_DIR)/Device/ATMEL
 # path for Cortex library
-LIB_PATH  =  $(CMSIS_DIR)/Lib/GCC
+LIB_PATH  =  $(CMSIS_DIR)/DSP/Lib/GCC
 BOOTLOADER_PARENT = $(ALTERNATE_CORE_PATH)/bootloaders

 ifndef VARIANT