Re: [riot-devel] Implementing rng

2016-02-21 Thread Ludwig Knüpfer
Hi,

The Makefile.features defines the features of a board, that's why it lives in 
the boards directory. So yes, it is intended to declare the RNG in there even 
if it is not part of the CPU/SoC.

It would be architecturally nicer to have such files in various places (eg CPU, 
radio, board) and let them be included, but that has not been done for any 
board as far as I know. Also, I can't remember if there was a discussion about 
this possibility.

Cheers,
Ludwig

Am 21. Februar 2016 20:56:51 MEZ, schrieb Mathias Tausig 
:
>Unfortunately, it doesn't. My problems are:
>
>a) In the case of my board, the hardware RNG is not part of the CPU but
>instead of the radio chip, which is accessed by the code in
>driver/at86rf2xx.
>
>b) If I implement the hwrng interface in the at86rf2xx code, how does
>the samr21-xpro board learn of this? I couldn't find the
>code/configuration, where the at86rf2xx driver is attached to that
>board.
>
>c) Can I simply put the periph_hwrng feature in the board's
>Makefile.features if I know that that interface is implemented in some
>of its parts?
>
>Thanks a lot for your assistance, I just want to create a good patch
>for this, which can easily be integrated with the upstream code.
>
>cheers
>Mathias
>
>Am 21.02.2016 7:29 nachm. schrieb Peter Kietzmann
>:
>>
>> Hi Mathias,
>>
>> [1] is the interface that should be implemented by your driver. The
>driver is CPU specific and should be placed in
>RIOT/cpu/*/periph/hwrng.c like e.g. here [2].
>>
>> Does that reduce your confusion or did I get you wrong :-) ?
>>
>> Best
>> Peter
>>
>> [1]
>https://github.com/RIOT-OS/RIOT/blob/master/drivers/include/periph/hwrng.h
>> [2]
>https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32f4/periph/hwrng.c
>>
>> Am 18.02.2016 um 13:46 schrieb Tausig Mathias:
>>>
>>> I am a bit confused, where to put that code. As far as I can tell,
>all current
>>>
>>> implementations of the hwrng functions are implemented on the cpu
>and not on the
>>>
>>> board level. While my rng is on the at86rf2xx chip, which is a
>driver. Can I put
>>>
>>> the feature in the driver?
>>>
>>>
>>>
>>>
>>>
>>> Am Mittwoch, den 17.02.2016, 17:22 +0100 schrieb Hauke Petersen:
>>>
 Hi Mathias,



 I think the way to go here is to implement the

 `drivers/include/periph/hwrng.h` interface. For this I think it
>makes sense to

 add a function that reads the random data from the radio to the
>at86rf2xx

 driver and call this function from the hwrng driver.



 Cheers,

 Hauke











 On 16.02.2016 17:14, Tausig Mathias wrote:

> Hy!
>
>
>
> I would like to use the hardware RNG from my samr1-xpro board. It
>should be
>
> available by reading out a certain register, according to the
>AT86RF233
>
> documentation.
>
> My problem is, that I don't how to do that (I am pretty new to
>this stuff).
>
> Is there some documentation available for this kind of task, or
>could you
>
> point me in the right
>
> direction?
>
>
>
> cheers
>
> Mathias
>
>
>
> ___
>
> devel mailing list
>
> devel@riot-os.org
>
> https://lists.riot-os.org/mailman/listinfo/devel
>
>>
>> -- 
>>
>> 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

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


Re: [riot-devel] Implementing rng

2016-02-21 Thread Mathias Tausig
Unfortunately, it doesn't. My problems are:

a) In the case of my board, the hardware RNG is not part of the CPU but instead 
of the radio chip, which is accessed by the code in driver/at86rf2xx.

b) If I implement the hwrng interface in the at86rf2xx code, how does the 
samr21-xpro board learn of this? I couldn't find the code/configuration, where 
the at86rf2xx driver is attached to that board.

c) Can I simply put the periph_hwrng feature in the board's Makefile.features 
if I know that that interface is implemented in some of its parts?

Thanks a lot for your assistance, I just want to create a good patch for this, 
which can easily be integrated with the upstream code.

cheers
Mathias

Am 21.02.2016 7:29 nachm. schrieb Peter Kietzmann 
:
>
> Hi Mathias,
>
> [1] is the interface that should be implemented by your driver. The driver is 
> CPU specific and should be placed in RIOT/cpu/*/periph/hwrng.c like e.g. here 
> [2].
>
> Does that reduce your confusion or did I get you wrong :-) ?
>
> Best
> Peter
>
> [1] https://github.com/RIOT-OS/RIOT/blob/master/drivers/include/periph/hwrng.h
> [2] https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32f4/periph/hwrng.c
>
> Am 18.02.2016 um 13:46 schrieb Tausig Mathias:
>>
>> I am a bit confused, where to put that code. As far as I can tell, all 
>> current
>>
>> implementations of the hwrng functions are implemented on the cpu and not on 
>> the
>>
>> board level. While my rng is on the at86rf2xx chip, which is a driver. Can I 
>> put
>>
>> the feature in the driver?
>>
>>
>>
>>
>>
>> Am Mittwoch, den 17.02.2016, 17:22 +0100 schrieb Hauke Petersen:
>>
>>> Hi Mathias,
>>>
>>>
>>>
>>> I think the way to go here is to implement the
>>>
>>> `drivers/include/periph/hwrng.h` interface. For this I think it makes sense 
>>> to
>>>
>>> add a function that reads the random data from the radio to the at86rf2xx
>>>
>>> driver and call this function from the hwrng driver.
>>>
>>>
>>>
>>> Cheers,
>>>
>>> Hauke
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On 16.02.2016 17:14, Tausig Mathias wrote:
>>>
 Hy!



 I would like to use the hardware RNG from my samr1-xpro board. It should be

 available by reading out a certain register, according to the AT86RF233

 documentation.

 My problem is, that I don't how to do that (I am pretty new to this stuff).

 Is there some documentation available for this kind of task, or could you

 point me in the right

 direction?



 cheers

 Mathias



 ___

 devel mailing list

 devel@riot-os.org

 https://lists.riot-os.org/mailman/listinfo/devel

>
> -- 
>
> 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] Implementing rng

2016-02-21 Thread Martine Lenders
Hi Mathias,
I think (but I never implemented any device drivers so take this with a
grain of salt) the most sensible solution would be to add a function to the
`at86rf2xx` driver that returns a result from the RNG and then wrap it with
`periph_hwrng` on all boards that come with this device.

Hope this was helpful,
Martine

2016-02-21 19:29 GMT+01:00 Peter Kietzmann :

> Hi Mathias,
>
> [1] is the interface that should be implemented by your driver. The driver
> is CPU specific and should be placed in RIOT/cpu/*/periph/hwrng.c like e.g.
> here [2].
>
> Does that reduce your confusion or did I get you wrong :-) ?
>
> Best
> Peter
>
> [1]
> https://github.com/RIOT-OS/RIOT/blob/master/drivers/include/periph/hwrng.h
> [2] https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32f4/periph/hwrng.c
>
>
> Am 18.02.2016 um 13:46 schrieb Tausig Mathias:
>
> I am a bit confused, where to put that code. As far as I can tell, all current
> implementations of the hwrng functions are implemented on the cpu and not on 
> the
> board level. While my rng is on the at86rf2xx chip, which is a driver. Can I 
> put
> the feature in the driver?
>
>
> Am Mittwoch, den 17.02.2016, 17:22 +0100 schrieb Hauke Petersen:
>
> Hi Mathias,
>
> I think the way to go here is to implement the
> `drivers/include/periph/hwrng.h` interface. For this I think it makes sense to
> add a function that reads the random data from the radio to the at86rf2xx
> driver and call this function from the hwrng driver.
>
> Cheers,
> Hauke
>
>
>
>
>
> On 16.02.2016 17:14, Tausig Mathias wrote:
>
> Hy!
>
> I would like to use the hardware RNG from my samr1-xpro board. It should be
> available by reading out a certain register, according to the AT86RF233
> documentation.
> My problem is, that I don't how to do that (I am pretty new to this stuff).
> Is there some documentation available for this kind of task, or could you
> point me in the right
> direction?
>
> cheers
> Mathias
>
>
>
> ___
> devel mailing 
> listdevel@riot-os.orghttps://lists.riot-os.org/mailman/listinfo/devel
>
>
> --
> 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
>
>
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Implementing rng

2016-02-21 Thread Peter Kietzmann

Hi Mathias,

[1] is the interface that should be implemented by your driver. The 
driver is CPU specific and should be placed in RIOT/cpu/*/periph/hwrng.c 
like e.g. here [2].


Does that reduce your confusion or did I get you wrong :-) ?

Best
Peter

[1] 
https://github.com/RIOT-OS/RIOT/blob/master/drivers/include/periph/hwrng.h

[2] https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32f4/periph/hwrng.c

Am 18.02.2016 um 13:46 schrieb Tausig Mathias:

I am a bit confused, where to put that code. As far as I can tell, all current
implementations of the hwrng functions are implemented on the cpu and not on the
board level. While my rng is on the at86rf2xx chip, which is a driver. Can I put
the feature in the driver?


Am Mittwoch, den 17.02.2016, 17:22 +0100 schrieb Hauke Petersen:

Hi Mathias,

I think the way to go here is to implement the
`drivers/include/periph/hwrng.h` interface. For this I think it makes sense to
add a function that reads the random data from the radio to the at86rf2xx
driver and call this function from the hwrng driver.

Cheers,
Hauke





On 16.02.2016 17:14, Tausig Mathias wrote:

Hy!

I would like to use the hardware RNG from my samr1-xpro board. It should be
available by reading out a certain register, according to the AT86RF233
documentation.
My problem is, that I don't how to do that (I am pretty new to this stuff).
Is there some documentation available for this kind of task, or could you
point me in the right
direction?

cheers
Mathias


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


--
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] Implementing rng

2016-02-17 Thread Hauke Petersen

Hi Mathias,

I think the way to go here is to implement the 
`drivers/include/periph/hwrng.h` interface. For this I think it makes 
sense to add a function that reads the random data from the radio to the 
at86rf2xx driver and call this function from the hwrng driver.


Cheers,
Hauke





On 16.02.2016 17:14, Tausig Mathias wrote:

Hy!

I would like to use the hardware RNG from my samr1-xpro board. It should be 
available by reading out a certain register, according to the AT86RF233 
documentation.
My problem is, that I don't how to do that (I am pretty new to this stuff). Is 
there some documentation available for this kind of task, or could you point me 
in the right
direction?

cheers
Mathias


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


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


Re: [riot-devel] Implementing rng

2016-02-17 Thread Tausig Mathias
OK, I have managed the first step myself and wrote the code which reads out the
random values from the RNG.
What would be the next step, that would allow me to set the periph_random
feature for the samr21-xpro board?

cheers
Mathias

On Die, 2016-02-16 at 16:14 +, Tausig Mathias wrote:
> Hy!
> 
> I would like to use the hardware RNG from my samr1-xpro board. It should be
> available by reading out a certain register, according to the AT86RF233
> documentation.
> My problem is, that I don't how to do that (I am pretty new to this stuff). Is
> there some documentation available for this kind of task, or could you point
> me in the right
> direction?
> 
> cheers
> Mathias
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel



signature.asc
Description: This is a digitally signed message part
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


[riot-devel] Implementing rng

2016-02-16 Thread Tausig Mathias
Hy!

I would like to use the hardware RNG from my samr1-xpro board. It should be 
available by reading out a certain register, according to the AT86RF233 
documentation.
My problem is, that I don't how to do that (I am pretty new to this stuff). Is 
there some documentation available for this kind of task, or could you point me 
in the right
direction?

cheers
Mathias

signature.asc
Description: This is a digitally signed message part
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel