Re: [riot-devel] Working on port to SODAQ Autonomo (SAMD21)

2016-06-13 Thread Kees Bakker

On 13-06-16 09:56, Peter Kietzmann wrote:

Hi Kees,


Hi Peter,



nice to see your interest in RIOT! Find some comments inline.

Am 12.06.2016 um 21:14 schrieb Kees Bakker:

Hi,

This is a heads up to let you know I'm working on a port of
RIOT to SODAQ Autonomo, which has an Atmel samd21 (like
Arduino Zero).

First I moved the existing cpu/samd21 tree to cpu/samr21. Then


Why? Well *if* there is a need to change the current RIOT code base, 
you should open a separate PR for that.


That seems like a good aproach, but I asked  a related question before 
and I was
stuck with the answer. The answer was something like: the samr21 
processor is the same

as the samd21, so for RIOT that's good enough.



This is a question to all: How comes the Atmel samr21-xplained pro 
board has "samd21" CPU in RIOT?


I don't know the history of how it was added. I like to understand what 
happened
when cpu/samd21 was added. Where did the files come from? I'm guessing 
they're

from ASF 3.18 or 3.19. ASF => Atmel Software Framework




I added the samd21 CMSIS files from Arduino and the board files
for the SODAQ Autonomo. For that, I copied several files from
samr21-xpro.


What was wrong with current CMSIS headers?

https://github.com/RIOT-OS/RIOT/tree/master/cpu/samd21/include


Well, these files are from the samr21 tree in ASF, yes samr21, not samd21

SAMR21 and SAMD21 have the same cpu. But there are tens of derivatives. The
differences are in memory size (RAM, ROM), peripherals, etc. So if you 
select a

board, you also want to select the particular flavor of the SAMx21.

Another issue here is maintenance. How do we want to follow upgrades 
from Atmel?
New cpu variants, bug fixes, etc. The best would be to have the files in 
RIOT as close as

possible to the original. And a description somewhere how to do an upgrade.

To answer the question why I wanted to move cpu/samd21 to cpu/samr21, it is
basically driven by the need for SAMD21J18A.





In the process I learned how to use the Atmel-ICE and how to
debug via openocd. Nice :-)


Yepp :-)



At the moment I can step through the hello world example. But
I have no idea where the output is going. That's my next challenge.


By default the STDIO is mapped to UART_DEV(0) which will generally be 
the first device defined in the periph_conf.h file of the board. E.g.:


https://github.com/RIOT-OS/RIOT/blob/master/boards/samr21-xpro/include/periph_conf.h#L108 



The driver used should be common for samX21 MCUs but is currently not.

https://github.com/RIOT-OS/RIOT/blob/master/cpu/samd21/periph/uart.c

For Kinetis there already is a great code reusability:

https://github.com/RIOT-OS/RIOT/tree/master/cpu/kinetis_common/periph

However, you could try to set up a different STDIO UART device and 
connect an external UART/USB converter to see if it's about 
conflicting pins.


That is more or less already what I did. I filled in uart_config[] with 
two devices
and I have a serial line connect to my PC. This configuration works with 
the Arduino

setup. But not yet with RIOT.





Meanwhile the changes and additions are available in my fork at

 g...@github.com:keestux/RIOT-OS

Branch sodaq-autonomo.



Best
Peter




--
Kees Bakker
Founder
SODAQ
M. 0031617737165
www.sodaq.com

___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Arduino + Riot

2016-06-13 Thread ALESSANDRO NICOLI
Yes, i added arduino.hpp instead of Arduino.h (or WProgram.h).
But it gives me back the "undefined reference error" to the DHT functions :


/RIOT/examples/arduino_DHT/_sketches.cpp:40: undefined reference to
`DHT::readHumidity(bool)'

RIOT/examples/arduino_DHT/_sketches.cpp:42: undefined reference to
`DHT::readTemperature(bool, bool)'

/RIOT/examples/arduino_DHT/_sketches.cpp:44: undefined reference to
`DHT::readTemperature(bool, bool)'

/RIOT/examples/arduino_DHT/_sketches.cpp:53: undefined reference to
`DHT::computeHeatIndex(float, float, bool)'

/RIOT/examples/arduino_DHT/_sketches.cpp:55: undefined reference to
`DHT::computeHeatIndex(float, float, bool)'


*saluti, *
*Alessandro*

2016-06-13 10:12 GMT+02:00 :

> Send devel mailing list submissions to
> devel@riot-os.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.riot-os.org/mailman/listinfo/devel
> or, via email, send a message with subject or body 'help' to
> devel-requ...@riot-os.org
>
> You can reach the person managing the list at
> devel-ow...@riot-os.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of devel digest..."
>
>
> Today's Topics:
>
>1. Running CC110x radio driver with iphc and netdev2_802154
>   (Mateusz Kubaszek)
>2. Re: devel Digest, Vol 40, Issue 14 (ALESSANDRO NICOLI)
>3. Working on port to SODAQ Autonomo (SAMD21) (Kees Bakker)
>4. Re: devel Digest, Vol 40, Issue 14 (Laurent Navet)
>5. Re: Working on port to SODAQ Autonomo (SAMD21) (Peter Kietzmann)
>6. Re: Working on port to SODAQ Autonomo (SAMD21) (Cenk Gündogan)
>
>
> --
>
> Message: 1
> Date: Sun, 12 Jun 2016 19:37:10 +0200
> From: Mateusz Kubaszek 
> To: devel@riot-os.org
> Subject: [riot-devel] Running CC110x radio driver with iphc and
> netdev2_802154
> Message-ID: <575d9dc6.7090...@gmail.com>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> Hello,
> Is there a possibility to run riot node with 6LoWPAN layer and IPHC
> compression with gnrc_netdev2_ieee802154 on CC110x radio driver? If yes,
> how to properly configure project?
>
> I'm making a sample mesh on my custom hardware and without the header
> compression 6LoWPAN network is senseless to make.
>
> Best regards,
> Mateusz Kubaszek
>
>
> --
>
> Message: 2
> Date: Sun, 12 Jun 2016 20:50:17 +0200
> From: ALESSANDRO NICOLI 
> To: RIoT Dev List 
> Subject: Re: [riot-devel] devel Digest, Vol 40, Issue 14
> Message-ID:
> 

Re: [riot-devel] Working on port to SODAQ Autonomo (SAMD21)

2016-06-13 Thread Thomas Eichinger

Hi!

On 13 Jun 2016, at 9:56 CEST(+0200), Peter Kietzmann wrote:


First I moved the existing cpu/samd21 tree to cpu/samr21. Then


Why? Well *if* there is a need to change the current RIOT code base, 
you should open a separate PR for that.


This is a question to all: How comes the Atmel samr21-xplained pro 
board has "samd21" CPU in RIOT?



I added the samd21 CMSIS files from Arduino and the board files
for the SODAQ Autonomo. For that, I copied several files from
samr21-xpro.


What was wrong with current CMSIS headers?


The problem is, the Atmel data sheet calls the samr21-xpro board CPU 
samd21 but then again Atmel maintains separate header file trees.


Best, Thomas
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Working on port to SODAQ Autonomo (SAMD21)

2016-06-13 Thread Peter Kietzmann

Hi Kees,

nice to see your interest in RIOT! Find some comments inline.

Am 12.06.2016 um 21:14 schrieb Kees Bakker:

Hi,

This is a heads up to let you know I'm working on a port of
RIOT to SODAQ Autonomo, which has an Atmel samd21 (like
Arduino Zero).

First I moved the existing cpu/samd21 tree to cpu/samr21. Then


Why? Well *if* there is a need to change the current RIOT code base, you 
should open a separate PR for that.


This is a question to all: How comes the Atmel samr21-xplained pro board 
has "samd21" CPU in RIOT?



I added the samd21 CMSIS files from Arduino and the board files
for the SODAQ Autonomo. For that, I copied several files from
samr21-xpro.


What was wrong with current CMSIS headers?

https://github.com/RIOT-OS/RIOT/tree/master/cpu/samd21/include



In the process I learned how to use the Atmel-ICE and how to
debug via openocd. Nice :-)


Yepp :-)



At the moment I can step through the hello world example. But
I have no idea where the output is going. That's my next challenge.


By default the STDIO is mapped to UART_DEV(0) which will generally be 
the first device defined in the periph_conf.h file of the board. E.g.:


https://github.com/RIOT-OS/RIOT/blob/master/boards/samr21-xpro/include/periph_conf.h#L108

The driver used should be common for samX21 MCUs but is currently not.

https://github.com/RIOT-OS/RIOT/blob/master/cpu/samd21/periph/uart.c

For Kinetis there already is a great code reusability:

https://github.com/RIOT-OS/RIOT/tree/master/cpu/kinetis_common/periph

However, you could try to set up a different STDIO UART device and 
connect an external UART/USB converter to see if it's about conflicting 
pins.




Meanwhile the changes and additions are available in my fork at

 g...@github.com:keestux/RIOT-OS

Branch sodaq-autonomo.



Best
Peter

--
Peter Kietzmann

Hamburg University of Applied Sciences
Dept. Informatik, Internet Technologies Group
Berliner Tor 7, 20099 Hamburg, Germany
Fon: +49-40-42875-8426
Web: http://www.haw-hamburg.de/inet
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] devel Digest, Vol 40, Issue 14

2016-06-13 Thread Laurent Navet
:
> Thanks Laurent,
> I've another question about Arduino on Riot.
> How can i add third-part libraries in my arduino-riot project?
> I tried to add the DHT library (.h , .cpp) to *Rito/sys/Arduino/include/*
> but it depends on *Arduino.h *and the compile process gives me back an
> error about it (library not found).

Have you tried include "arduino.hpp" instead ?
it is located in sys/arduino/include
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel