Bug 232991

Summary: devel/arduino18: Can't upload a sketch to a Leonardo Board
Product: Ports & Packages Reporter: ui <uii>
Component: Individual Port(s)Assignee: Larry Rosenman <ler>
Status: Closed FIXED    
Severity: Affects Only Me CC: emaste, kevans, ler, w.schwarzenfeld
Priority: ---    
Version: Latest   
Hardware: amd64   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230843
Attachments:
Description Flags
svn(1) diff against the ports tree kevans: maintainer-approval+

Description ui 2018-11-05 15:29:09 UTC
% uname -r
11.2-RELEASE-p4

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 freebsd_triage 2018-11-22 23:26:05 UTC
(In reply to ui from comment #0)

Hi,

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

Thanks,

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 freebsd_triage 2018-11-24 12:53:25 UTC
Hi,

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 freebsd_triage 2019-02-23 00:26:08 UTC
Patch from PR 230843 has been committed
Comment 5 Kyle Evans freebsd_committer freebsd_triage 2019-03-13 01:51:33 UTC
Created attachment 202833 [details]
svn(1) diff against the ports tree

Hi,

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 freebsd_triage 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

Log:
  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

Changes:
  head/comms/java-simple-serial-connector/Makefile
  head/comms/java-simple-serial-connector/files/patch-src_java_jssc_SerialPortList.java
  head/devel/arduino-core/distinfo
  head/devel/arduino18/Makefile
  head/devel/arduino18/files/patch-arduino-core_src_processing_app_SerialPortList.java
Comment 7 Larry Rosenman freebsd_committer freebsd_triage 2019-03-13 03:06:54 UTC
Committed.  Thanks!