Arduino Due

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Arduino Due

Goran Mekić
Hello,

Technically, Due is ARM based so the question is not off topic too much, I hope. Anyway, I'm having trouble with Arduino Due. On Debian all works well and the board behaves as expected. On FreeBSD, two things are kindda weird:

1. When ever I start Arduino IDE, L led stops blinking and continues blinking when IDE is closed.
2. I can read board info through IDE until I flash sketch on FreeBSD. After that I can not get the info, and the L led is lit all the time.

Any tip is precious. Thank you!

Regards,
meka

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Arduino Due

Boris Samorodov-2
11.12.2016 06:46, Goran Mekić пишет:

> Technically, Due is ARM based so the question is not off topic too much, I hope. Anyway, I'm having trouble with Arduino Due. On Debian all works well and the board behaves as expected. On FreeBSD, two things are kindda weird:
>
> 1. When ever I start Arduino IDE, L led stops blinking and continues blinking when IDE is closed.
> 2. I can read board info through IDE until I flash sketch on FreeBSD. After that I can not get the info, and the L led is lit all the time.

Do you use a FreeBSD port? Then freebsd-ports@ may be a more
appropriate maillist to ask. And please include the info about
your host OS, platform and port/package version of arduino.

--
WBR, bsam
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Arduino Due

Goran Mekić
On Mon, Dec 12, 2016 at 01:01:19AM +0300, Boris Samorodov wrote:
> Do you use a FreeBSD port? Then freebsd-ports@ may be a more
> appropriate maillist to ask. And please include the info about
> your host OS, platform and port/package version of arduino.

I did write to the port maintainer, as I thought that if it's about the port, maintainer is the one who should hear about it.

I'm running two boxes: laptop and desktop. Laptop has i7 CPU with FreeBSD 11.0-RELEASE and desktop has i5 CPU with FreeBSD 11.0-STABLE. Arduino IDE is arduino16 from the latest snapshot of ports. Thank you!

Regards,
meka

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Arduino Due

Goran Mekić
In reply to this post by Boris Samorodov-2
Hello,

So I did a little checks and I think it's the cross compiling that's faulty. I generated blink led .bin file on Linux and FreeBSD. I can flash any of them from FreeBSD using bossac, and Linux .bin file works, FreeBSD one doesn't (the led is always lit). I checked the commands Arduino IDE is using on Linux and FreeBSD, and they are the same. I tried this with arm-none-eabi-gcc versions 4.9, 5.3 and 6.2. As all those versions are failing, maybe it's not GCC but binutils or something like that (just a wild guess). I would be really grateful if someone could tell me how to pinpoint the error even more. Thank you!

Just for reference, on Arduino Due the MCU is Cortex M3.

Regards,
meka

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Arduino Due

Kyle Evans-2
On Thu, Dec 15, 2016 at 5:11 AM, Goran Mekić <[hidden email]> wrote:
> Hello,
>
> So I did a little checks and I think it's the cross compiling that's faulty. I generated blink led .bin file on Linux and FreeBSD. I can flash any of them from FreeBSD using bossac, and Linux .bin file works, FreeBSD one doesn't (the led is always lit). I checked the commands Arduino IDE is using on Linux and FreeBSD, and they are the same. I tried this with arm-none-eabi-gcc versions 4.9, 5.3 and 6.2. As all those versions are failing, maybe it's not GCC but binutils or something like that (just a wild guess). I would be really grateful if someone could tell me how to pinpoint the error even more. Thank you!
>
> Just for reference, on Arduino Due the MCU is Cortex M3.
>
> Regards,
> meka

 Hi,

That's interesting. I was able to successfully program my Due's with
FreeBSD-compiled projects a couple of times -- generally simple ones
that just connected and tested the serial plotter/monitor.

However, we do differ from upstream a bit in that upstream seems to be
sticking to arm-none-eabi-gcc 4.8.3 -- I kind of wonder if we're
missing some flags in compilation/linking, but that wouldn't really
explain why my simple tests worked out. =(
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Arduino Due

Adrian Chadd-4
hiya,

can people upload example working / not working code and generated
binaries? Surely this is something a bit of disassembly should quickly
show. (eg, some mismatch ABI between runtimes and generated code,.)


-a


On 15 December 2016 at 06:36, Kyle Evans <[hidden email]> wrote:

> On Thu, Dec 15, 2016 at 5:11 AM, Goran Mekić <[hidden email]> wrote:
>> Hello,
>>
>> So I did a little checks and I think it's the cross compiling that's faulty. I generated blink led .bin file on Linux and FreeBSD. I can flash any of them from FreeBSD using bossac, and Linux .bin file works, FreeBSD one doesn't (the led is always lit). I checked the commands Arduino IDE is using on Linux and FreeBSD, and they are the same. I tried this with arm-none-eabi-gcc versions 4.9, 5.3 and 6.2. As all those versions are failing, maybe it's not GCC but binutils or something like that (just a wild guess). I would be really grateful if someone could tell me how to pinpoint the error even more. Thank you!
>>
>> Just for reference, on Arduino Due the MCU is Cortex M3.
>>
>> Regards,
>> meka
>
>  Hi,
>
> That's interesting. I was able to successfully program my Due's with
> FreeBSD-compiled projects a couple of times -- generally simple ones
> that just connected and tested the serial plotter/monitor.
>
> However, we do differ from upstream a bit in that upstream seems to be
> sticking to arm-none-eabi-gcc 4.8.3 -- I kind of wonder if we're
> missing some flags in compilation/linking, but that wouldn't really
> explain why my simple tests worked out. =(
> _______________________________________________
> [hidden email] mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "[hidden email]"
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Arduino Due

Kyle Evans-2
On Sun, Dec 18, 2016 at 1:14 AM, Adrian Chadd <[hidden email]> wrote:

> hiya,
>
> can people upload example working / not working code and generated
> binaries? Surely this is something a bit of disassembly should quickly
> show. (eg, some mismatch ABI between runtimes and generated code,.)
>
>
> -a
>
>
Hi,

I'm attaching some files that Goran has sent me off list, which I'm
still working up some time to sit down with and examine. Included are
compiled binaries and their associated build logs. I don't think he
explicitly stated and I haven't been able to check, but I assume these
are from the Blink example packaged with the IDE.

His other problem, not being able to program the Due from the IDE, is
one that I've experienced intermittently and have yet to pin down the
exact cause for. In my experiences, it was that the IDE seemingly
wouldn't perform the 1200 bps open/close after the first time I'd
programmed it. Closing and re-opening the IDE or reconnecting the Due
was fine. It does occur to me that I didn't think to ask if he was
using the native port or the programming port -- I don't think I've
ever had any luck with programming via the native port.

I would have liked it if this detail was completely moved into
devel/bossa, which is actually programming the device, but that idea
has since been rejected upstream. I'm not entirely convinced that it's
really doing the open/close properly or that there's not simply too
much delay between triggering the bootloader and devel/bossa connecting.

Thanks,

Kyle Evans

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"

arduino-freebsd.txt (51K) Download Attachment
arduino-linux.txt (57K) Download Attachment
blink.freebsd.ino.bin (41K) Download Attachment
blink.linux.ino.bin (32K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Arduino Due

Bernd Walter-4
On Sun, Dec 18, 2016 at 01:41:52AM -0600, Kyle Evans wrote:

> On Sun, Dec 18, 2016 at 1:14 AM, Adrian Chadd <[hidden email]> wrote:
> > hiya,
> >
> > can people upload example working / not working code and generated
> > binaries? Surely this is something a bit of disassembly should quickly
> > show. (eg, some mismatch ABI between runtimes and generated code,.)
> >
> >
> > -a
> >
> >
>
> Hi,
>
> I'm attaching some files that Goran has sent me off list, which I'm
> still working up some time to sit down with and examine. Included are
> compiled binaries and their associated build logs. I don't think he
> explicitly stated and I haven't been able to check, but I assume these
> are from the Blink example packaged with the IDE.
>
> His other problem, not being able to program the Due from the IDE, is
> one that I've experienced intermittently and have yet to pin down the
> exact cause for. In my experiences, it was that the IDE seemingly
> wouldn't perform the 1200 bps open/close after the first time I'd
> programmed it. Closing and re-opening the IDE or reconnecting the Due
> was fine. It does occur to me that I didn't think to ask if he was
> using the native port or the programming port -- I don't think I've
> ever had any luck with programming via the native port.

I'm pretty amazed that people even got so far.
The arduino IDE (which I really hate to be honest) and avr-gcc is in the
ports.
But how do you install the arm toolchain matching with the arduino
expectations?

> I would have liked it if this detail was completely moved into
> devel/bossa, which is actually programming the device, but that idea
> has since been rejected upstream. I'm not entirely convinced that it's
> really doing the open/close properly or that there's not simply too
> much delay between triggering the bootloader and devel/bossa connecting.

Not sure about the arduino case, but with the ESP8266 I saw some USB
uarts worked fine (CP2102) and others (CH340) failed to start programming.
Adding some retries for the init handshake helped.
No idea what happens exactly, because the data itself looked fine when I'd
traced it with another USB uart.
There might be some timing differences.

--
B.Walter <[hidden email]> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Arduino Due

Kyle Evans-2
On Dec 18, 2016 03:42, "Bernd Walter" <[hidden email]> wrote:

On Sun, Dec 18, 2016 at 01:41:52AM -0600, Kyle Evans wrote:
> On Sun, Dec 18, 2016 at 1:14 AM, Adrian Chadd <[hidden email]>
wrote:

> > hiya,
> >
> > can people upload example working / not working code and generated
> > binaries? Surely this is something a bit of disassembly should quickly
> > show. (eg, some mismatch ABI between runtimes and generated code,.)
> >
> >
> > -a
> >
> >
>
> Hi,
>
> I'm attaching some files that Goran has sent me off list, which I'm
> still working up some time to sit down with and examine. Included are
> compiled binaries and their associated build logs. I don't think he
> explicitly stated and I haven't been able to check, but I assume these
> are from the Blink example packaged with the IDE.
>
> His other problem, not being able to program the Due from the IDE, is
> one that I've experienced intermittently and have yet to pin down the
> exact cause for. In my experiences, it was that the IDE seemingly
> wouldn't perform the 1200 bps open/close after the first time I'd
> programmed it. Closing and re-opening the IDE or reconnecting the Due
> was fine. It does occur to me that I didn't think to ask if he was
> using the native port or the programming port -- I don't think I've
> ever had any luck with programming via the native port.

I'm pretty amazed that people even got so far.
The arduino IDE (which I really hate to be honest) and avr-gcc is in the
ports.
But how do you install the arm toolchain matching with the arduino
expectations?


devel/arm-none-eabi-gcc and devel/arm-none-eabi-newlib pretty much covers
it (we use a newer version of both than upstream, though). CMSIS is bundled
with devel/arduino-core.


> I would have liked it if this detail was completely moved into
> devel/bossa, which is actually programming the device, but that idea
> has since been rejected upstream. I'm not entirely convinced that it's
> really doing the open/close properly or that there's not simply too
> much delay between triggering the bootloader and devel/bossa connecting.

Not sure about the arduino case, but with the ESP8266 I saw some USB
uarts worked fine (CP2102) and others (CH340) failed to start programming.
Adding some retries for the init handshake helped.
No idea what happens exactly, because the data itself looked fine when I'd
traced it with another USB uart.
There might be some timing differences.

--
B.Walter <[hidden email]> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.


The ESP8266 is devel/bossa supported as well, yeah? That's an interesting
datapoint. Does it require the 1200 bps init to erase and reboot in
bootloader mode?
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Arduino Due

Bernd Walter-4
On Sun, Dec 18, 2016 at 09:13:43AM -0600, Kyle Evans wrote:

> On Dec 18, 2016 03:42, "Bernd Walter" <[hidden email]> wrote:
>
> > On Sun, Dec 18, 2016 at 01:41:52AM -0600, Kyle Evans wrote:
> > > On Sun, Dec 18, 2016 at 1:14 AM, Adrian Chadd <[hidden email]>
> > wrote:
> >
> > > I would have liked it if this detail was completely moved into
> > > devel/bossa, which is actually programming the device, but that idea
> > > has since been rejected upstream. I'm not entirely convinced that it's
> > > really doing the open/close properly or that there's not simply too
> > > much delay between triggering the bootloader and devel/bossa connecting.
> >
> > Not sure about the arduino case, but with the ESP8266 I saw some USB
> > uarts worked fine (CP2102) and others (CH340) failed to start programming.
> > Adding some retries for the init handshake helped.
> > No idea what happens exactly, because the data itself looked fine when I'd
> > traced it with another USB uart.
> > There might be some timing differences.
>
> The ESP8266 is devel/bossa supported as well, yeah? That's an interesting
> datapoint. Does it require the 1200 bps init to erase and reboot in
> bootloader mode?

In my case I'm using esptool.py for the ESP8266.
From memory it just opens the tty without anything fancy and tries to
handshake with 115200bps.
I even traced the signals on the line and nothing was wrong.
Still it almost always failed with the CH340 and always worked with a
CP2102.
I've never found out what exactly went wrong, just that a few more
retries (well I'd raised it to 100) helped.

When I first had to programm Atmel ARMs bossa wasn't available.
I'd used a Linux programm called sam7_pgm, which I had to fix to be
compiled on FreeBSD, but it worked fine for all the AT91SAM7*.
With the newer Atmel ARMs I'd switched over to the Atmel-ICE and
openocd.

--
B.Walter <[hidden email]> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-arm
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Arduino Due

Goran Mekić
In reply to this post by Kyle Evans-2
Just to confirm, these are the logs and binaries of blink led example program on Linux and FreeBSD.

signature.asc (849 bytes) Download Attachment