Date   

Re: [Zephyr-users] Help wanted with Atmel SAM ADC (AFEC) driver

Justin
 

I will work on this for the SAM ADC since I've written some of the other SAM drivers.


On Tue, Jul 3, 2018 at 10:09 AM Cufi, Carles <carles.cufi@...> wrote:
Hi all,

A rework of the ADC driver API is now ready and existing ADC implementations are being ported to the new API. You can check out the PR [1] with the API and a reference implementation for more details.

However, the Atmel SAM ADC (AFEC) driver [2] is currently orphan of a maintainer and we are asking for help to port this driver to the new API. If you have experience with this SoC family and want to contribute a port, you can do so in a PR or branch that we can later include when the new API and adapted implementations are merged.

Thanks in advance on behalf of the Zephyr TSC.

Regards,

Carles

[1] https://github.com/zephyrproject-rtos/zephyr/pull/7691
[2] https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/adc/adc_sam_afec.c





Help wanted with Atmel SAM ADC (AFEC) driver

Carles Cufi
 

Hi all,

A rework of the ADC driver API is now ready and existing ADC implementations are being ported to the new API. You can check out the PR [1] with the API and a reference implementation for more details.

However, the Atmel SAM ADC (AFEC) driver [2] is currently orphan of a maintainer and we are asking for help to port this driver to the new API. If you have experience with this SoC family and want to contribute a port, you can do so in a PR or branch that we can later include when the new API and adapted implementations are merged.

Thanks in advance on behalf of the Zephyr TSC.

Regards,

Carles

[1] https://github.com/zephyrproject-rtos/zephyr/pull/7691
[2] https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/adc/adc_sam_afec.c


Re: Bluetooth: Mesh: about avoiding cloud storage

laczenJMS
 

Hi Vikrant,

I think it is a bad idea to have this kind message to put the device
back into unprovisioned state. Anyone who is using this app with your
devices could take over all your devices by using your procedure, and
this person even does not need physical access to the devices.

I would say every device has some kind of hardware mechanism available
to put it into an unprovisioned state. Even if you have no physical
button you could work as follows: to put the device in unprovisioned
state you need to cycle the power to it for at least 10 times. The
power should stay on for 2 seconds but less than 4 seconds. After 2
seconds you increment the counter, after 4 seconds you reset it to 0.
When the counter reaches 10 the device goes into unprovisioned state.
You can change the counter and times to fit your needs.

Hope this helps,

Jehudi


Re: Debug on Eclipse with NXP FRDM-K64F

Carles Cufi
 

-----Original Message-----
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> On
Behalf Of clemence
Sent: 03 July 2018 12:56
To: devel@lists.zephyrproject.org
Subject: [Zephyr-devel] Debug on Eclipse with NXP FRDM-K64F

Hi,


I am using the board  NXP FRDM-K64F.

I would like to debug my code on eclise. How can I do it ?


Thanks

Clemence



Debug on Eclipse with NXP FRDM-K64F

clemence
 

Hi,


I am using the board  NXP FRDM-K64F.

I would like to debug my code on eclise. How can I do it ?


Thanks

Clemence


Bluetooth: Mesh: about avoiding cloud storage service

vikrant8051 <vikrant8051@...>
 


Hi,
Assume 

1) #BluetoothMesh provisioner App is creating NET & APP key using end-user @username & some unforgettable pass-phrase.

2) as app get un-installed, no relevant file will present on local storage. 

3) no hardware mechanism to push NODE into factory reset mode.

In this case, even app get un-installed then fresh one could create same NET-APP key pair.

Can I send encrypted message on ADV-Bearer to unprovisioned all NODEs in vicinity to their configuration Server (by selecting destination addr. as 0xFFFF) using freshly installed App?

Is there any chance so that we could avoid cloud storage with "ANY" Bluetooth Mesh implementation without going against SIG specification for above mentioned assumptions ?

Thank You !!


Bluetooth: Mesh: about avoiding cloud storage

vikrant8051 <vikrant8051@...>
 

Hi,
Assume 

1) #BluetoothMesh provisioner App is creating NET & APP key using end-user @username & some unforgettable pass-phrase.

2) as app get un-installed, no relevant file will present on local storage. 

3) no hardware mechanism to push NODE into factory reset mode.

In this case, even app get un-installed then fresh one could create same NET-APP key pair.

Can I send encrypted message on ADV-Bearer to unprovisioned all NODEs in vicinity to their configuration Server (by selecting destination addr. as 0xFFFF) using freshly installed App?

Is there any chance so that we could avoid cloud storage with "ANY" Bluetooth Mesh implementation without going against SIG specification for above mentioned assumptions ?

Thank You !!


Re: Adding new DTS binding for SAM0 I2C

m.lainani@...
 

Hi Léonard,

I've been working on adding I2C support for the SAMD21 but I don't feel it is in a state where making a pull request would be relevant: this is my first foray in Zephyr development plus I didn't know much about I2C until a few weeks ago. Still, my driver compiles properly and I was able to validate basic read/write operation. You can check the two commits below. The first is for the driver implementation while the second is for the addition of a new board using the driver in question.

https://github.com/mlainani/zephyr/commit/81919b689cf20b1c51d25ef51171fb1d69750e7f
https://github.com/mlainani/zephyr/commit/b3b0902620deecc14e881627bde471cb19025c9a

Rgds,

Madani.


Re: Adding new DTS binding for SAM0 I2C

Erwan Gouriou
 

Thanks for the additional info. It would be nice to see what at line 164 in file sodaq_one_v3.dts.pre.tmp.
Anyway, my first guess would be that you miss i2c.h binding file inclusion in your dtsi file.
#include <dt-bindings/i2c/i2c.h>

Erwan


On Mon, 2 Jul 2018 at 10:10, Léonard Bise <leonard.bise@...> wrote:
Hello Erwan,

Thanks for your help.
Well the thing is that is one of my problem, I don't have much to go by.
All I get is a syntax error message from dtc when running cmake:

-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.5", minimum required is "3.4") 
-- Selected BOARD sodaq_one_v3
Zephyr version: 1.12.99
Parsing Kconfig tree in /home/leonard/gitrepo/zephyr_fork/Kconfig
Using /home/leonard/gitrepo/TravailBachelor/src/Zephyr_sodaq_one_v3/boards/arm/sodaq_one_v3/sodaq_one_v3_defconfig as base
Merging /home/leonard/gitrepo/TravailBachelor/src/Zephyr_sodaq_one_v3/prj.conf
-- Generating zephyr/include/generated/generated_dts_board.h
Error: sodaq_one_v3.dts.pre.tmp:164.21-22 syntax error
FATAL ERROR: Unable to parse input tree
CMake Error at /home/leonard/gitrepo/zephyr_fork/cmake/dts.cmake:83 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /home/leonard/gitrepo/zephyr_fork/cmake/app/boilerplate.cmake:275 (include)
  CMakeLists.txt:9 (include)

As soon as I comment the following block in my dts file it works again. So I assume that it is related to the new atmel,sam0-i2c binding I added.
I added the atmel,sam0-i2c.yaml file in dts/bindings/i2c but I'm not sure if I missed something elsewhere?

&sercom3 {
status = "ok";
compatible = "atmel,sam0-i2c";
clock-frequency = <I2C_BITRATE_FAST>;
#address-cells = <1>;
#size-cells = <0>;
};

Thank you,
Léonard.

On 2 July 2018 at 09:13, Erwan Gouriou <erwan.gouriou@...> wrote:
Hi Léonard,

Some additional information on build error would help to provide you support.

Cheers
Erwan

On Sun, 1 Jul 2018 at 13:37, Léonard Bise <leonard.bise@...> wrote:
I'm trying to add support for SAM0 I2C. Currently my code is compiling as I see warnings in my i2c_sam0.c file. 
However I'm trying to add a new binding for that in zephyr/dts/bindings/i2c/atmel,sam0-i2c.yaml and hitting a wall.

---
title: Atmel SAM0 SERCOM I2C driver
id: atmel,sam0-i2c
version: 0.1
 
description: >
    This binding gives a base representation of the Atmel SAM0 SERCOM I2C driver
 
inherits:
    !include i2c.yaml
 
properties:
    compatible:
      type: string
      category: required
      description: compatible strings
      constraint: "atmel,sam0-i2c"
 
    reg:
      type: array
      description: mmio register space
      generation: define
      category: required
 
...

Then in my board dts I added the following:

&sercom3 {
status = "ok";
compatible = "atmel,sam0-i2c";
clock-frequency = <I2C_BITRATE_FAST>;
#address-cells = <1>;
#size-cells = <0>;
};

But something is missing because I keep getting an error when building that it cannot parse the device tree.
I looked around how the other SAM0 device are setup but I didn't find what I'm missing.

Any pointer on how I should go about setting up this binding ?

Best regards,
Léonard.




Re: Adding new DTS binding for SAM0 I2C

Léonard Bise <leonard.bise@...>
 

Hello Erwan,

Thanks for your help.
Well the thing is that is one of my problem, I don't have much to go by.
All I get is a syntax error message from dtc when running cmake:

-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.5", minimum required is "3.4") 
-- Selected BOARD sodaq_one_v3
Zephyr version: 1.12.99
Parsing Kconfig tree in /home/leonard/gitrepo/zephyr_fork/Kconfig
Using /home/leonard/gitrepo/TravailBachelor/src/Zephyr_sodaq_one_v3/boards/arm/sodaq_one_v3/sodaq_one_v3_defconfig as base
Merging /home/leonard/gitrepo/TravailBachelor/src/Zephyr_sodaq_one_v3/prj.conf
-- Generating zephyr/include/generated/generated_dts_board.h
Error: sodaq_one_v3.dts.pre.tmp:164.21-22 syntax error
FATAL ERROR: Unable to parse input tree
CMake Error at /home/leonard/gitrepo/zephyr_fork/cmake/dts.cmake:83 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /home/leonard/gitrepo/zephyr_fork/cmake/app/boilerplate.cmake:275 (include)
  CMakeLists.txt:9 (include)

As soon as I comment the following block in my dts file it works again. So I assume that it is related to the new atmel,sam0-i2c binding I added.
I added the atmel,sam0-i2c.yaml file in dts/bindings/i2c but I'm not sure if I missed something elsewhere?

&sercom3 {
status = "ok";
compatible = "atmel,sam0-i2c";
clock-frequency = <I2C_BITRATE_FAST>;
#address-cells = <1>;
#size-cells = <0>;
};

Thank you,
Léonard.

On 2 July 2018 at 09:13, Erwan Gouriou <erwan.gouriou@...> wrote:
Hi Léonard,

Some additional information on build error would help to provide you support.

Cheers
Erwan

On Sun, 1 Jul 2018 at 13:37, Léonard Bise <leonard.bise@...> wrote:
I'm trying to add support for SAM0 I2C. Currently my code is compiling as I see warnings in my i2c_sam0.c file. 
However I'm trying to add a new binding for that in zephyr/dts/bindings/i2c/atmel,sam0-i2c.yaml and hitting a wall.

---
title: Atmel SAM0 SERCOM I2C driver
id: atmel,sam0-i2c
version: 0.1
 
description: >
    This binding gives a base representation of the Atmel SAM0 SERCOM I2C driver
 
inherits:
    !include i2c.yaml
 
properties:
    compatible:
      type: string
      category: required
      description: compatible strings
      constraint: "atmel,sam0-i2c"
 
    reg:
      type: array
      description: mmio register space
      generation: define
      category: required
 
...

Then in my board dts I added the following:

&sercom3 {
status = "ok";
compatible = "atmel,sam0-i2c";
clock-frequency = <I2C_BITRATE_FAST>;
#address-cells = <1>;
#size-cells = <0>;
};

But something is missing because I keep getting an error when building that it cannot parse the device tree.
I looked around how the other SAM0 device are setup but I didn't find what I'm missing.

Any pointer on how I should go about setting up this binding ?

Best regards,
Léonard.




Re: Adding new DTS binding for SAM0 I2C

Erwan Gouriou
 

Hi Léonard,

Some additional information on build error would help to provide you support.

Cheers
Erwan


On Sun, 1 Jul 2018 at 13:37, Léonard Bise <leonard.bise@...> wrote:
I'm trying to add support for SAM0 I2C. Currently my code is compiling as I see warnings in my i2c_sam0.c file. 
However I'm trying to add a new binding for that in zephyr/dts/bindings/i2c/atmel,sam0-i2c.yaml and hitting a wall.

---
title: Atmel SAM0 SERCOM I2C driver
id: atmel,sam0-i2c
version: 0.1
 
description: >
    This binding gives a base representation of the Atmel SAM0 SERCOM I2C driver
 
inherits:
    !include i2c.yaml
 
properties:
    compatible:
      type: string
      category: required
      description: compatible strings
      constraint: "atmel,sam0-i2c"
 
    reg:
      type: array
      description: mmio register space
      generation: define
      category: required
 
...

Then in my board dts I added the following:

&sercom3 {
status = "ok";
compatible = "atmel,sam0-i2c";
clock-frequency = <I2C_BITRATE_FAST>;
#address-cells = <1>;
#size-cells = <0>;
};

But something is missing because I keep getting an error when building that it cannot parse the device tree.
I looked around how the other SAM0 device are setup but I didn't find what I'm missing.

Any pointer on how I should go about setting up this binding ?

Best regards,
Léonard.



Adding new DTS binding for SAM0 I2C

Léonard Bise <leonard.bise@...>
 

I'm trying to add support for SAM0 I2C. Currently my code is compiling as I see warnings in my i2c_sam0.c file. 
However I'm trying to add a new binding for that in zephyr/dts/bindings/i2c/atmel,sam0-i2c.yaml and hitting a wall.

---
title: Atmel SAM0 SERCOM I2C driver
id: atmel,sam0-i2c
version: 0.1
 
description: >
    This binding gives a base representation of the Atmel SAM0 SERCOM I2C driver
 
inherits:
    !include i2c.yaml
 
properties:
    compatible:
      type: string
      category: required
      description: compatible strings
      constraint: "atmel,sam0-i2c"
 
    reg:
      type: array
      description: mmio register space
      generation: define
      category: required
 
...

Then in my board dts I added the following:

&sercom3 {
status = "ok";
compatible = "atmel,sam0-i2c";
clock-frequency = <I2C_BITRATE_FAST>;
#address-cells = <1>;
#size-cells = <0>;
};

But something is missing because I keep getting an error when building that it cannot parse the device tree.
I looked around how the other SAM0 device are setup but I didn't find what I'm missing.

Any pointer on how I should go about setting up this binding ?

Best regards,
Léonard.



Re: SAMD21 I2C support

Léonard Bise <leonard.bise@...>
 

Hello Michael,
 
I would be willing to try at least. Hopefully with some guidance it wouldn't be too hard.
I'm currently setting up my fork to have a clean dev env.
 
Just so I'm clear on what exactly needs to be done.
  • I need to write an I2C driver (i2c_sam0.c) that provides the required functionalities to the i2c driver API
  • Provide a binding dts file for atmel,sam0-i2c
  • Add fixups of the form CONFIG_I2C_SAM0_SERCOMX in zephyr/arch/arm/soc/atmel_sam0/samd21/dts.fixup
Anything else I'm missing?
 
Do you think I should open an issue regarding this ?
 
Best regards,
Léonard.


SAMD21 I2C support

Léonard Bise <leodido99@...>
 

I'm currently working on the board configuration for the SODAQ One which is very similar to the Adafruit Feather M0 already supported by Zephyr.

Console is working and I setup the SPI bus. I also managed to operate the RN2483 LoRa chip through UART.

This board has an uBlox EVA 8M GPS and LSM303AGR Accelerometer connected to the I2C bus (SERCOM3) which I'm trying to configure properly.

My problem is that the other SAM0 Family boards supported don't mention any I2C in their configuration.
I was expecting of finding something like for the UART/SPI i.e. CONFIG_I2C_SAM0 but it doesn't exist. I found however a generic SAM one, can I use this one? (CONFIG_I2C_SAM_TWI).

Any pointer on how to configure the i2c device please?

Thank you,
Léonard.


Re: SAMD21 I2C support

Michael Hope
 

Hi Leonard. I did a bit of the original SAMD21 bring up. There's no support for I2C ATM but you're welcome to add it.


On Fri, 29 Jun 2018, 12:45 , <leonard.bise@...> wrote:
I'm currently working on the board configuration for the SODAQ One which is very similar to the Adafruit Feather M0 already supported by Zephyr.
 
Console is working and I setup the SPI bus. I also managed to operate the RN2483 LoRa chip through UART.
 
This board has an uBlox EVA 8M GPS and LSM303AGR Accelerometer connected to the I2C bus (SERCOM3) which I'm trying to configure properly.
 
My problem is that the other SAM0 Family boards supported don't mention any I2C in their configuration.
I was expecting of finding something like for the UART/SPI i.e. CONFIG_I2C_SAM0 but it doesn't exist. I found however a generic SAM one, can I use this one? (CONFIG_I2C_SAM_TWI).
 
Any pointer on how to configure the i2c device please?
 
Thank you,
Léonard.


SAMD21 I2C support

leonard.bise@...
 

I'm currently working on the board configuration for the SODAQ One which is very similar to the Adafruit Feather M0 already supported by Zephyr.
 
Console is working and I setup the SPI bus. I also managed to operate the RN2483 LoRa chip through UART.
 
This board has an uBlox EVA 8M GPS and LSM303AGR Accelerometer connected to the I2C bus (SERCOM3) which I'm trying to configure properly.
 
My problem is that the other SAM0 Family boards supported don't mention any I2C in their configuration.
I was expecting of finding something like for the UART/SPI i.e. CONFIG_I2C_SAM0 but it doesn't exist. I found however a generic SAM one, can I use this one? (CONFIG_I2C_SAM_TWI).
 
Any pointer on how to configure the i2c device please?
 
Thank you,
Léonard.


Bluetooth: Mesh: How to reduce provisioning time ?

vikrant8051 <vikrant8051@...>
 

Hi,
How to reduce time required to "provisioning + reconnection to proxy service" (in case of OOB authentication disabled) compared to default configuration ?

Thank You !!


Re: Sleep current on #nrf52480

ismael fillonneau
 

 Hi 
You could also try following patch which is currently under review:

Regards,
Ismael






Re: SODAQ One V3 porting

Léonard Bise <leodido99@...>
 

Back again!

So this is weird because I got it working but without TX interrupts. RX interrupts work fine however as soon as I enable TX interrupts with uart_irq_tx_enable I enter an interruption loop.
Using uart_poll_out to send data works properly.

Also I just noticed that the example (samples/subsys/usb/cdc_arm) on which I was basing my test code doesn't respect what is written in the documentation. 
It is said that uart_fifo_read must only be used from within an interruption which is not the case in the test sample.

Does anyone know why I would enter the interruption loop on UART TX?

Best regards,
Léonard.

On 28 June 2018 at 10:42, Léonard Bise <leodido99@...> wrote:
I'm having difficulties trying to communicate with the LoRa UART interface.

I set it up like so:

pinmux.c

#if CONFIG_UART_SAM0_SERCOM2_BASE_ADDRESS
/* SERCOM2 LoRa UART on RX=PA13/pad 1, TX=PA12/pad 0 */
pinmux_pin_set(muxa, 12, PINMUX_FUNC_C);
pinmux_pin_set(muxa, 13, PINMUX_FUNC_C);
#endif

board.h

/* SERCOM2 LoRa UART on RX=PA13/pad 1, TX=PA12/pad 0 */
#define CONFIG_UART_SAM0_SERCOM2_PADS \
(SERCOM_USART_CTRLA_RXPO(1) | SERCOM_USART_CTRLA_TXPO(0))

sodaq_one_v3.dts

&sercom2 {
status = "ok";
compatible = "atmel,sam0-uart";
current-speed = <57600>;
};

I created a test program similar to samples/subsys/usb/cdc_arm
In my test program I get the device like so.

lora = device_get_binding(ATMEL_SAM0_UART_42001000_LABEL);

I didn't find any documentation on how to determine the device names and I'm not sure it's the correct one, could someone enlighten me?

However as soon as I enable the RX or TX IRQ I'm stuck in an interruption loop so I guess something must be off with my configuration.

Best regards,
Léonard.



On 1 June 2018 at 19:03, Henrik Brix Andersen <henrik@...> wrote:
Hi Léonard

> On 18 May 2018, at 11.56, Léonard Bise <leodido99@...> wrote:
> I'm going to work on a project which is going to use the SODAQ One board (https://shop.sodaq.com/en/sodaq-one-eu-rn2483-v3.html).

Sweet.

> In the supported hardware I see that the Adafruit Feather M0 Basic Prot is listed, which has this exact same microcontroller. I also read the Board Porting Guide and as I understand it basically I'd need to take the Adafruit configuration as a base and add these new components to the kconfiguration. All of the aspects related to the microcontroller are already there.

I did the port to the Adafruit Feather M0 Basic Proto. Let me know if I can help with the port for the SODAQ board.

> In particular I'm also wondering how to handle the LoRa microchip, since Zephyr has no LoRaWAN stack what would be the best way to handle the porting of this part?

Perhaps a simple solution could be to just add a sample application using the LoRaWAN chip over UART from the application layer?

Best regards,
Brix
-- 
Henrik Brix Andersen





Re: Sleep current on #nrf52480

Sebastian Boe
 

550uA usually means that the HFCLK is running.

The HFCLK will run when something (peripheral) needs it.

You need to find out what is using it, unfortunately neither the HW
or the SW is able to tell you this, so if I was you I would manually (using CMSIS)
start turning everything off until the current died down.

Timers, etc.

NRF_TIMER0->TASKS_STOP = 1;

etc.

after finding the peripheral that is requesting HFCLK I would find out which SW
module turned it on and if it makes sense for it be on (is this a bug or not).
________________________________________
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> on behalf of Fabien Lepoutre <fabien@culvertengineering.com>
Sent: Friday, 29 June 2018 1:28:45 AM
To: zephyr-devel@lists.zephyrproject.org
Subject: [Zephyr-devel] Sleep current on #nRF52480

Hi all,

I've ran some power consumption tests with Zephyr 1.12 #... a00646a5

Using the samples/boards/nrf52/pwr_mgr at lowest power mode, I find that the nrf52840 has a sleep current of ~550uA.

When I run simple power management code with Nordic SDK in sleep mode, I get about ~30uA.

To run these tests, I used the PCA52840 PDK board and measured the current using the Nordic Power Profiler Kit and also a third party solution. I'm confident the current numbers are right.

Has anyone ran sleep power measurements on the nrf52840 and have different results?
I would like to understand the discrepancy between Zephyr OS and nordic SDK to bring down my current power numbers to the SDK ones.

Thanks a lot!

3681 - 3700 of 8517