-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload fails on avr:leonardo #54
Comments
This board needs to be switched to bootloader mode by hitting the reset button twice before attempting to upload. Edit: I'm leaving this ticket open and let you decide if this project needs to be updated to address the issue. |
I needed to reset the Leonardo in an automated way, because I'm flashing and testing various Arduinos from a CI pipeline in the cloud. As @zeechs says, you need to open the serial port (probably Here's my GitHub Actions yaml for my flashing and testing: jobs:
build:
steps:
- name: Upload Ardino hex to /dev/ttyACM0
run: |
./scripts/reset_leonardo.py /dev/ttyACM0
sleep 2
cmake --build ./build --target upload -- TARGET=leonardo_node SERIAL_PORT=/dev/ttyACM0
sleep 2
- name: Test Ardino
run: |
./firmware_test.py And here's the contents of #!/usr/bin/env python3
################################################################################
#
# Copyright (C) 2021 Garrett Brown
# SPDX-License-Identifier: Apache-2.0
#
################################################################################
import serial
import sys
# Environment parameters
SERIAL_PORT = sys.argv[1]
# Open the Leonardo tty at 1200 baud and then close to reset into programming
# mode
print(f"Opening {SERIAL_PORT} at 1200 baud")
ser = serial.Serial(SERIAL_PORT, 1200)
print(f"Closing {SERIAL_PORT}")
ser.close()
print("Arduino Leonardo is now in reset mode for 8 seconds") |
Hello,
First, thank you for sharing your work, it is very useful and appreciated. I used it successfully with an Arduino Uno board.
I am having trouble finding the cause of the upload failure using a Leonardo board. I am following these simple steps to configure, build and upload your hello_world example:
cmake .. -D CMAKE_TOOLCHAIN_FILE=path/to/Arduino-toolchain.cmake
BoardOptions.cmake
and uncomment the following line:cmake .
make
I'm not sure where to go from here.
Uploading a sketch with
arduino-cli
works well.The text was updated successfully, but these errors were encountered: