Bug 232991 - devel/arduino18: Can't upload a sketch to a Leonardo Board
Summary: devel/arduino18: Can't upload a sketch to a Leonardo Board
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Larry Rosenman
Depends on:
Reported: 2018-11-05 15:29 UTC by ui
Modified: 2019-03-13 03:07 UTC (History)
4 users (show)

See Also:

svn(1) diff against the ports tree (3.02 KB, patch)
2019-03-13 01:51 UTC, Kyle Evans
kevans: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ui 2018-11-05 15:29:09 UTC
% uname -r

I am using binary packages.

It's not possible to upload a sketch to Arduino Leonardo (m32U4) 

error message inside the GUI
Couldn't find a Board on the selected port. Check that you have the correct port selected.  If it is correct, try pressing the board's reset button after initiating the upload.

With arduino-1.0.6_3,1 and the same settings it's no problem to upload a sketch to a Arduino Leonardo (m32U4)

(Thank you for porting Arduino on FreeBSD)
Comment 1 Kyle Evans freebsd_committer 2018-11-22 23:26:05 UTC
(In reply to ui from comment #0)


I've ordered a Leonardo and will look into this when it arrives.


Kyle Evans
Comment 2 ui 2018-11-24 12:46:39 UTC
Hi Kyle,

thanks a lot for your efforts.

I managed to upload a sketch to the Leonardo (m32U4) with a terminal.

First I exported a compiled binary with the Arduino18 IDE and then I executed the following commands: 
% stty -f "/dev/cuaU0" 1200 && sleep 3 && arduino-avrdude -patmega32u4 -cavr109 -P /dev/cuaU0 -U flash:w:foo.ino.leonardo.hex

Also I'm wondering why the Arduino Nano and Leonardo constantly start to blink as soon as I start the Arduino18 IDE? The LED's stop flashing as soon as I quit the Arduino IDE.
Comment 3 Kyle Evans freebsd_committer 2018-11-24 12:53:25 UTC

Ah, the patch from Issue 230843 is what you need there -- I need to poke bsam again, since it's been a couple months.
Comment 4 Ed Maste freebsd_committer 2019-02-23 00:26:08 UTC
Patch from PR 230843 has been committed
Comment 5 Kyle Evans freebsd_committer 2019-03-13 01:51:33 UTC
Created attachment 202833 [details]
svn(1) diff against the ports tree


Attached patch fixes it -- turns out, Arduino copied jssc's SerialPortList and I didn't notice to fix it. This patch is tested good, the 1200bps reset works and my upload of Blink to the Leonardo succeeds.
Comment 6 commit-hook freebsd_committer 2019-03-13 03:04:16 UTC
A commit references this bug:

Author: ler
Date: Wed Mar 13 03:03:57 UTC 2019
New revision: 495537
URL: https://svnweb.freebsd.org/changeset/ports/495537

  comms/java-simple-serial-connector, devel/arduino18, devel/arduino-core: fix serial communication for leonardo
     and re-rolled distribution for arduino-core.

  PR:		232991
  Submitted by:	kevans

Comment 7 Larry Rosenman freebsd_committer 2019-03-13 03:06:54 UTC
Committed.  Thanks!