Re: Arduino Due (Atmel SAM3) port - got eLua running

classic Classic list List threaded Threaded
5 messages Options
scdr scdr
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Arduino Due (Atmel SAM3) port - got eLua running


I did not use the Arduino IDE, but I did borrow the boot loader (bossac) to load the code.
e.g., if the programming port is connected as COM8 (on windows)

bossac.exe -Ufalse -pCOM8 -e -w -v -b elua_lua_arduinodue.bin -R

(For the device USB port, change -U to true).
So far I have it using UART over the programming port, haven't got the USB CDC going yet.

Compiling using codesourcery, building using the eLua build system, debugging using gdb and print statements.
(I used Atmel Studio just enough to generate get a copy of the relevant libraries from ASF.)

> ----- Original Message -----
> From: Gabriel Duarte
> Sent: 11/01/13 12:51 PM
> To: eLua Users and Development List (www.eluaproject.net)
> Subject: Re: [eLua-dev] Arduino Due (Atmel SAM3) port - got eLua running
>
> Cool!! You have used libsam coming with Arduino IDE? 2 days ago I had
> started a script to compile pure C to Arduino DUE, in order to start
> porting eLua as soon as possible.
>
>
> 2013/11/1 <[hidden email]>
>
> > Just a quick note, I got eLua running on the Atmel SAM3X8E (Arduino DUE).
> > Using Atmel Software Framework libraries.
> >
> > Do not have support for much working in platform.c yet.
> > Support for other devices (PIO, Timer, etc.) is in various states of draft.
> > Now that have serial port working, so I can run the interpreter, that
> > should facilitate
> > debugging support for various modules.
> >
> > Will put up on github when I get chance.
> > _______________________________________________
> > eLua-dev mailing list
> > [hidden email]
> > https://lists.berlios.de/mailman/listinfo/elua-dev
> >
>
>
>
> --
> Gabriel Duarte
> Linux User #471185
> Rio de Janeiro / RJ
> http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
scdr scdr
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Arduino Due (Atmel SAM3) port - got eLua running


I uploaded the Atmel SAM3 port to github.
https://github.com/ecdr/elua
Branch SAM

Built using codesourcery (though I expect any supported toolchain would do).
You will get a bunch of warnings, mostly in platform.c - reminders of things that still need doing.

See below for programming instructions using bossac boot loader (or use jtag or SWD programmer).

Although it compiles and runs, it is very rough/early draft.

The console UART works (through the programming port on Arduino DUE).
Usual settings 115200 baud, N, 8, 1
You may need to set your terminal program to send a CR and LF as end of line.

I added a feature so the shell welcome would give free memory and clock speed (can be turned off macro in board file).

I have tested the term module
PIO - can blink the onboard LED (pio.PB_27) but have not tested input or other pins.

I wrote a module for the Random Number Generator, which works.  (sam34.rand.next() for u32 or nextf() for float between 0.0 to 1.0)
Wrote a real time clock module, which does not work.
XModem does not work (probably needs timers).
Have not tested USARTs other than console.

Platform support for other modules in various states of being partially written, but not tested.
Would welcome feedback, fixes, etc.


Thank you to Sergio at simplemachines.it

  Michael


> ----- Original Message -----
> From: FP AB
> Sent: 11/02/13 06:25 PM
> To: eLua Users and Development List (www.eluaproject.net)
> Subject: Re: [eLua-dev] Arduino Due (Atmel SAM3) port - got eLua running
>
> I did not use the Arduino IDE, but I did borrow the boot loader (bossac) to load the code.
> e.g., if the programming port is connected as COM8 (on windows)
>
> bossac.exe -Ufalse -pCOM8 -e -w -v -b elua_lua_arduinodue.bin -R
>
> (For the device USB port, change -U to true).
> So far I have it using UART over the programming port, haven't got the USB CDC going yet.
>
> Compiling using codesourcery, building using the eLua build system, debugging using gdb and print statements.
> (I used Atmel Studio just enough to generate get a copy of the relevant libraries from ASF.)
>
> > ----- Original Message -----
> > From: Gabriel Duarte
> > Sent: 11/01/13 12:51 PM
> > To: eLua Users and Development List (www.eluaproject.net)
> > Subject: Re: [eLua-dev] Arduino Due (Atmel SAM3) port - got eLua running
> >
> > Cool!! You have used libsam coming with Arduino IDE? 2 days ago I had
> > started a script to compile pure C to Arduino DUE, in order to start
> > porting eLua as soon as possible.
> >
> >
> > 2013/11/1 <[hidden email]>
> >
> > > Just a quick note, I got eLua running on the Atmel SAM3X8E (Arduino DUE).
> > > Using Atmel Software Framework libraries.
> > >
> > > Do not have support for much working in platform.c yet.
> > > Support for other devices (PIO, Timer, etc.) is in various states of draft.
> > > Now that have serial port working, so I can run the interpreter, that
> > > should facilitate
> > > debugging support for various modules.
> > >
> > > Will put up on github when I get chance.
> > > _______________________________________________
> > > eLua-dev mailing list
> > > [hidden email]
> > > https://lists.berlios.de/mailman/listinfo/elua-dev
> > >
> >
> >
> >
> > --
> > Gabriel Duarte
> > Linux User #471185
> > Rio de Janeiro / RJ
> > http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
scdr scdr
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Arduino Due (Atmel SAM3) port - got eLua running

In reply to this post by scdr

Afraid I did not use libsam, hope that doesn't cause problems.
I sent an e-mail in August (not to whole list) asking how to coordinate on arduino due port, but never got response.
I did poke around in the Arduino source code some, but somehow didn't find the libsam directory.
Atmel software framework (ASF) seemed to be the main library I could find mentioned in relation to Atmel SAM3/4, so went ahead and used it.

I am not sure what the relation is between libsam and ASF - looking at a couple of the driver files, there seem to be similar functions, but some of the function names may be different?

ASF has drivers in a ton of directories (I copied the ASF directory structure in the SAM platform to make it easier to
update the drivers as new versions come out, or to integrate additional drivers to support extra hardware).


> ----- Original Message -----
> From: Gabriel Duarte
> Sent: 11/01/13 12:51 PM
> To: eLua Users and Development List (www.eluaproject.net)
> Subject: Re: [eLua-dev] Arduino Due (Atmel SAM3) port - got eLua running
>
> Cool!! You have used libsam coming with Arduino IDE? 2 days ago I had
> started a script to compile pure C to Arduino DUE, in order to start
> porting eLua as soon as possible.
>
>
> 2013/11/1 <[hidden email]>
>
> > Just a quick note, I got eLua running on the Atmel SAM3X8E (Arduino DUE).
> > Using Atmel Software Framework libraries.
> >
> > Do not have support for much working in platform.c yet.
> > Support for other devices (PIO, Timer, etc.) is in various states of draft.
> > Now that have serial port working, so I can run the interpreter, that
> > should facilitate
> > debugging support for various modules.
> >
> > Will put up on github when I get chance.
> > _______________________________________________
> > eLua-dev mailing list
> > [hidden email]
> > https://lists.berlios.de/mailman/listinfo/elua-dev
> >
>
>
>
> --
> Gabriel Duarte
> Linux User #471185
> Rio de Janeiro / RJ
> http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
gduarte gduarte
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Arduino Due (Atmel SAM3) port - got eLua running

I got and Arduino DUE here and would like to help on the port, improve it!


2013/11/4 FP AB <[hidden email]>

Afraid I did not use libsam, hope that doesn't cause problems.
I sent an e-mail in August (not to whole list) asking how to coordinate on arduino due port, but never got response.
I did poke around in the Arduino source code some, but somehow didn't find the libsam directory.
Atmel software framework (ASF) seemed to be the main library I could find mentioned in relation to Atmel SAM3/4, so went ahead and used it.

I am not sure what the relation is between libsam and ASF - looking at a couple of the driver files, there seem to be similar functions, but some of the function names may be different?

ASF has drivers in a ton of directories (I copied the ASF directory structure in the SAM platform to make it easier to
update the drivers as new versions come out, or to integrate additional drivers to support extra hardware).


> ----- Original Message -----
> From: Gabriel Duarte
> Sent: 11/01/13 12:51 PM
> To: eLua Users and Development List (www.eluaproject.net)
> Subject: Re: [eLua-dev] Arduino Due (Atmel SAM3) port - got eLua running
>
> Cool!! You have used libsam coming with Arduino IDE? 2 days ago I had
> started a script to compile pure C to Arduino DUE, in order to start
> porting eLua as soon as possible.
>
>
> 2013/11/1 <[hidden email]>
>
> > Just a quick note, I got eLua running on the Atmel SAM3X8E (Arduino DUE).
> > Using Atmel Software Framework libraries.
> >
> > Do not have support for much working in platform.c yet.
> > Support for other devices (PIO, Timer, etc.) is in various states of draft.
> > Now that have serial port working, so I can run the interpreter, that
> > should facilitate
> > debugging support for various modules.
> >
> > Will put up on github when I get chance.
> > _______________________________________________
> > eLua-dev mailing list
> > [hidden email]
> > https://lists.berlios.de/mailman/listinfo/elua-dev
> >
>
>
>
> --
> Gabriel Duarte
> Linux User #471185
> Rio de Janeiro / RJ
> http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



--
Gabriel Duarte
Linux User #471185
Rio de Janeiro / RJ
http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
scdr scdr
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Arduino Due (Atmel SAM3) port - got eLua running

In reply to this post by scdr

> ----- Original Message -----
> From: Gabriel Duarte
> Sent: 11/05/13 07:24 AM
> To: eLua Users and Development List (www.eluaproject.net)
> Subject: Re: [eLua-dev] Arduino Due (Atmel SAM3) port - got eLua running
>
> I got and Arduino DUE here and would like to help on the port, improve it!
>

Others working on the Arduino Due port would be great.  
I offered to help with the port, but did not intend to do it all.  Many hands make light work, etc.

I have pushed almost all the code I have written to github.
Since my last post I finally got PWM working (at least sort of - there are a few bugs I know of, which I will address).

To help reduce chance of duplicated effort if you want to let me know what portion of the
platform you are working on, and I will try to do likewise.  (e.g. right now I am still working on PWM).

If you have devices/shields to easily test I2C, SPI, or CAN, any of those would be good.
Timers needs more work (at the moment the systimer is only one that works).
There is almost nothing written in the ADC section, although testing that may require getting timers working.
Then there is also getting the console going over the native USB CDC.  
Whatever takes your fancy.

The sections that do work can use more testing (e.g. I have only tested console UART, and I haven't tested PIO input at all,
or if one fancies debugging one could try to figure out why using the clock crystal doesn't work in the RTC module.)

Several of sections of platform have some code (which is a mix of material from examples, material from other
platform ports, etc.), but most of them need additional work before they have any chance of working.
So do not assume that the code that is there makes sense or belongs there, etc.

One of the challenges of working with the SAM3 seems to be a lack of documentation - at least I haven't found
much beyond the datasheet for the cpu.  ASF documentation seems to just be a list of function names with
very terse descriptions, and one has to look at examples or at the code to figure out what arguments do, etc.

I assume we should do coordination by e-mail not on the development list (anybody else is welcome to participate,
just don't want to create too much chatter on the list).

  Michael

>
> 2013/11/4 FP AB <[hidden email]>
>
> >
> > Afraid I did not use libsam, hope that doesn't cause problems.
> > I sent an e-mail in August (not to whole list) asking how to coordinate on
> > arduino due port, but never got response.
> > I did poke around in the Arduino source code some, but somehow didn't find
> > the libsam directory.
> > Atmel software framework (ASF) seemed to be the main library I could find
> > mentioned in relation to Atmel SAM3/4, so went ahead and used it.
> >
> > I am not sure what the relation is between libsam and ASF - looking at a
> > couple of the driver files, there seem to be similar functions, but some of
> > the function names may be different?
> >
> > ASF has drivers in a ton of directories (I copied the ASF directory
> > structure in the SAM platform to make it easier to
> > update the drivers as new versions come out, or to integrate additional
> > drivers to support extra hardware).
> >
> >
> > > ----- Original Message -----
> > > From: Gabriel Duarte
> > > Sent: 11/01/13 12:51 PM
> > > To: eLua Users and Development List (www.eluaproject.net)
> > > Subject: Re: [eLua-dev] Arduino Due (Atmel SAM3) port - got eLua running
> > >
> > > Cool!! You have used libsam coming with Arduino IDE? 2 days ago I had
> > > started a script to compile pure C to Arduino DUE, in order to start
> > > porting eLua as soon as possible.
> > >
> > >
> > > 2013/11/1 <[hidden email]>
> > >
> > > > Just a quick note, I got eLua running on the Atmel SAM3X8E (Arduino
> > DUE).
> > > > Using Atmel Software Framework libraries.
> > > >
> > > > Do not have support for much working in platform.c yet.
> > > > Support for other devices (PIO, Timer, etc.) is in various states of
> > draft.
> > > > Now that have serial port working, so I can run the interpreter, that
> > > > should facilitate
> > > > debugging support for various modules.
> > > >
> > > > Will put up on github when I get chance.
> > > > _______________________________________________
> > > > eLua-dev mailing list
> > > > [hidden email]
> > > > https://lists.berlios.de/mailman/listinfo/elua-dev
> > > >
> > >
> > >
> > >
> > > --
> > > Gabriel Duarte
> > > Linux User #471185
> > > Rio de Janeiro / RJ
> > > http://genericdev.wordpress.com/
> >
> > _______________________________________________
> > eLua-dev mailing list
> > [hidden email]
> > https://lists.berlios.de/mailman/listinfo/elua-dev
> >
>
>
>
> --
> Gabriel Duarte
> Linux User #471185
> Rio de Janeiro / RJ
> http://genericdev.wordpress.com/

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Loading...