简体   繁体   中英

Arduino Makefile fails - recipe for target 'reset' failed

I want to use the ArduinoMakefile to push code to the SleepyPi Board via the commandline.

It is part of a Sensor Project with a RaspberryPi3 that has this Arduino power Board attached via GPIO to manage it's power control.

I do this inside a docker container which is deployed with resin.io.

My Makefile looks linke this:

PROJECT_DIR       = /sonah/src/sleepypi/run/script2
ARDMK_DIR         = $(PROJECT_DIR)
ARDUINO_DIR       = /usr/share/arduino
USER_LIB_PATH    :=  /usr/share/arduino/libraries
BOARD_TAG         = sleepypi
MONITOR_BAUDRATE  = 115200
AVR_TOOLS_DIR     = /usr
AVRDUDE          = /usr/bin/avrdude
CFLAGS_STD        = -std=gnu11
CXXFLAGS_STD      = -std=gnu++11
CXXFLAGS         += -pedantic -Wall -Wextra
MONITOR_PORT      = /dev/ttyS0
CURRENT_DIR       = $(shell basename $(CURDIR))
OBJDIR            = $(PROJECT_DIR)/bin/$(BOARD_TAG)/$(CURRENT_DIR)
include $(ARDMK_DIR)/Arduino.mk

And when I run it i get the following message:

root@raspberrypi3-c49223e:/sonah/src/sleepypi/run/script2# make upload
-------------------------
Arduino.mk Configuration:
- [AUTODETECTED]       CURRENT_OS = LINUX
- [USER]               ARDUINO_DIR = /usr/share/arduino
- [USER]               ARDMK_DIR = /sonah/src/sleepypi/run/script2
- [AUTODETECTED]       ARDUINO_VERSION = 105
- [DEFAULT]            ARCHITECTURE =
- [DEFAULT]            ARDMK_VENDOR = arduino
- [DEFAULT]            ARDUINO_SKETCHBOOK =
- [USER]               AVR_TOOLS_DIR = /usr
- [COMPUTED]           ARDUINO_LIB_PATH = /usr/share/arduino/libraries (from ARDUINO_DIR)
- [COMPUTED]           ARDUINO_VAR_PATH = /usr/share/arduino/hardware/arduino//variants (from ARDUINO_DIR)
- [COMPUTED]           BOARDS_TXT = /usr/share/arduino/hardware/arduino//boards.txt (from ARDUINO_DIR)
- [USER]               USER_LIB_PATH = /usr/share/arduino/libraries
- [DEFAULT]            PRE_BUILD_HOOK = pre-build-hook.sh
- [USER]               BOARD_TAG = sleepypi
- [COMPUTED]           CORE = arduino (from build.core)
- [COMPUTED]           VARIANT = standard (from build.variant)
- [USER]               OBJDIR = /sonah/src/sleepypi/run/script2/bin/sleepypi/script2
- [COMPUTED]           ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino//cores/arduino (from ARDUINO_DIR, BOARD_TAG and boards.txt)
-  [USER]              MONITOR_BAUDRATE = 115200
- [DEFAULT]            OPTIMIZATION_LEVEL = s
- [DEFAULT]            MCU_FLAG_NAME = mmcu
- [USER]               CFLAGS_STD = -std=gnu11
- [USER]               CXXFLAGS_STD = -std=gnu++11
- [COMPUTED]           DEVICE_PATH = /dev/ttyS0 (from MONITOR_PORT)
- [DEFAULT]            FORCE_MONITOR_PORT =
- [AUTODETECTED]       Size utility: AVR-aware for enhanced output
- [COMPUTED]           BOOTLOADER_PARENT = /usr/share/arduino/hardware/arduino//bootloaders (from ARDUINO_DIR)
- [COMPUTED]           ARDMK_VERSION = 1.6
- [COMPUTED]           CC_VERSION = 4.8.1 (avr-gcc)
-------------------------
mkdir -p /sonah/src/sleepypi/run/script2/bin/sleepypi/script2
make reset
make[1]: Entering directory '/sonah/src/sleepypi/run/script2'
/sonah/src/sleepypi/run/script2/bin/ard-reset-arduino  /dev/ttyS0
make[1]: /sonah/src/sleepypi/run/script2/bin/ard-reset-arduino: Command not found
/sonah/src/sleepypi/run/script2/Arduino.mk:1600: recipe for target 'reset' failed
make[1]: *** [reset] Error 127
make[1]: Leaving directory '/sonah/src/sleepypi/run/script2'
/sonah/src/sleepypi/run/script2/Arduino.mk:1558: recipe for target 'upload' failed
make: *** [upload] Error 

I would love to get some insight in what I did wrong and how I can fix it. I have to confess I am not an expert with arduino and serial communication.

The Arduino-Makefile project comes with that binary:

$ ls -alh ~/dev/Arduino-Makefile/bin/
total 32K
drwxr-xr-x 2 kotori kotori 4.0K Aug 11 20:11 .
drwxr-xr-x 7 kotori kotori 4.0K Aug 11 20:11 ..
-rwxr-xr-x 1 kotori kotori  10K Aug 11 20:11 ardmk-init
-rwxr-xr-x 1 kotori kotori 4.1K Aug 11 20:11 ard-reset-arduino
-rwxr-xr-x 1 kotori kotori 2.4K Aug 11 20:11 robotis-loader

Its checking the location it is, because your ARDMK_DIR variable is set to /sonah/src/sleepypi/run/script2. This needs to point to wherever you downloaded the Arduino-Makefile project to.

If you set this variable in your ~/.bashrc file it will work properly. Here is how mine is set in that file:

export ARDMK_DIR="~/dev/Arduino-Makefile"

or put it at the top of every project Makefile:

ARDMK_DIR="/where/you/downloaded/Arduino-Makefile"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM