Date   

Re: gPTP and usb network device

cpmcparland@...
 

Jukka,

Thanks for your suggestion.  was not aware that zephyr had sntp.  That may
well be a better solution.  We have two applications with very different time
constraints--none of which are at the ns. level.  One app needs roughly 10 ms.
resolution and a second would like to see something on the order of 50 - 100 usec.

BTW, are there any "standard" solutions for time sync (at any resolution) for BLE or
bluetooth 5?

Cheers,
Chuck


Re: gPTP and usb network device

Jukka Rissanen
 

Hi Chuck,

the gPTP is probably not a proper solution for this kind time sync as
it is normally meant to synchronize two devices with nanosecond
accuracy in industrial ethernet environments. The actual time value is
typically not that important in these TSN solutions, main thing is the
time synchronization between devices.

Have you considered using SNTP to synchronize the time, there is
already SNTP client supported in Zephyr? This has lower resolution but
it should be fine in normal applications.


Cheers,
Jukka

On Tue, 2018-10-16 at 12:09 -0700, cpmcparland@rtisys.org wrote:
I'm setting up a IP link between a debian platform and a bluetooth
usb dongle running
zephyr. usb network device interface appears to work fine with the
zephyr IP stack running in
the dongle. I want the dongle zephyr os to be time sync'd with the
linux system and
am thinking gPTP would be a good way to achieve this.....particularly
because its been
implemented on zephyr. There's a note that zephyr gPTP only works on
boards that
have ethernet hardware links. Am wondering if anyone has tried using
gPTP with
usb networking enabled? Since the usb interface will likely run at
1Mb/s+ between
linux and zephyr (on dongle), I would expect it to behave reasonably
well - at least for
my application's timing requirements. Any experience or thoughts?

Regards,
Chuck McP


Re: #nrf52840 #defines #nrf52840 #defines

Ryan Erickson
 

Hello Matthias,

By default the BL654 DVK does not connect the external 32 kHz clock.  In zephyr, the NRF52840 board files are setup to use the external 32 kHz clock.
You have 2 options:
  1. Follow the instructions in teh BL654 DVK user guide to connect the external 32 kHz clock
  2. Create a custom board file (which you should do anyway) and enable the internal 32 kHz RC oscillator 
CONFIG_CLOCK_CONTROL_NRF5_K32SRC_RC=y
# CONFIG_CLOCK_CONTROL_NRF5_K32SRC_XTAL is not set
CONFIG_CLOCK_CONTROL_NRF5_K32SRC_500PPM=y

Regards,

Ryan


gPTP and usb network device

cpmcparland@...
 

I'm setting up a IP link between a debian platform and a bluetooth usb dongle running
zephyr.  usb network device interface appears to work fine with the zephyr IP stack running in
the dongle.  I want the dongle zephyr os to be time sync'd with the linux system and
am thinking gPTP would be a good way to achieve this.....particularly because its been
implemented on zephyr.  There's a note that zephyr gPTP only works on boards that
have ethernet hardware links.  Am wondering if anyone has tried using gPTP with
usb networking enabled?  Since the usb interface will likely run at 1Mb/s+ between
linux and zephyr (on dongle), I would expect it to behave reasonably well - at least for
my application's timing requirements.  Any experience or thoughts?

Regards,
Chuck McP


#nrf52840 #defines #nrf52840 #defines

Matthias Schuh <matthias.schuh@...>
 

Hello fellow mailinglist members,

I'm currently trying to get the samples "hci_uart" and "hci_usb" working on a laird654 module / Laird DVK-BL654-1.0 (nrf52480)
Both samples work on the nrf52480DK (pca10056) but refuse to work on the Laird654 module.

Regarding hci_uart I would like to transfer know-how I gained at the apache mynemt-os project: 
I got the respective sample from the apache newt project "blehci" working after configuring the nrf52480 to use the synthesized clock and modify the sleep clock accuracy:
In the newt world this was achieved via setting syscfg=XTAL_32768=0 syscfg=XTAL_32768_SYNTH=1:BLE_XTAL_SETTLE_TIME=0 syscfg=BLE_LL_OUR_SCA=250:BLE_LL_MASTER_SCA=1
I know these settings are newt specific but how could I achieve this for the zephyr samples ? 

Looking forward to your reply.

Best regards


Re: Slip TCP connection between linux host and nrf52840

Serafin Leschke <serafin.leschke@...>
 

Forward to list:

Hi Chuck


I tried this myself (and failed.). There is a separate net-tools repo: https://github.com/zephyrproject-rtos/net-tools


In there you find tunslip6.c which should configure the slip on the host side, but I was not successful in getting the communication to work. (The host did send a packet down the serial line but newer got a response).


So if anybody finds out how to do this, it would be great if it would find it's way into the documentation.


Best regards

Serafin


On 12/10/18 19:39, cpmcparland@... wrote:
Jukka,

Thanks, I was hoping that was the case.  Have found the slip.c code and am looking through it.
Not too many examples for slip and the ones I have seen all point to Qemu.  Any idea or pointers
as to where uart pipe gets created?  I'm guessing its buried somewhere in the Qemu board support
config files. 

Regards,
Chuck McP


Re: nRF5 GPIO stops working after some time

Mieruński, Mieszko <Mieszko.Mierunski@...>
 

Hello,

On nRF52840-DK pin 7 is used as CTS, it can be used freely after HWFC is disabled, for more information please look here

Please check bottom of the board, as there is information on which pins serve specific functions on DK.

 

Best Regards

Mieruński, Mieszko

 

From: Cufi, Carles [mailto:Carles.Cufi@...]
Sent: Saturday, October 13, 2018 2:36 PM
To: Gavrikov Paul <Paul.Gavrikov@...>; zephyr-devel@...
Cc: Lai Matthias <Matthias.Lai@...>; Głąbek, Andrzej <Andrzej.Glabek@...>; Mieruński, Mieszko <Mieszko.Mierunski@...>
Subject: Re: [Zephyr-devel] nRF5 GPIO stops working after some time

 

+ Andrzej, Mieszko

 

From: <devel@...> on behalf of Gavrikov Paul <Paul.Gavrikov@...>
Date: Friday, 12 October 2018 at 20:28
To: "zephyr-devel@..." <zephyr-devel@...>
Cc: Lai Matthias <Matthias.Lai@...>
Subject: [Zephyr-devel] nRF5 GPIO stops working after some time

 

Hi,

 

I have a very weird problem with my nRF52840-DK and Zephyr v1.13.0. Very simple code:

 

dev = device_get_binding(CONFIG_GPIO_P0_DEV_NAME);

 

            gpio_pin_configure(dev, 7, GPIO_PIN_ENABLE  | GPIO_DIR_OUT);

            gpio_pin_configure(dev, 3, GPIO_PIN_ENABLE  | GPIO_DIR_OUT);

 

            while(1) {

                        gpio_pin_write(dev, 3, false);

                        gpio_pin_write(dev, 7, false);

                        k_sleep(10);

                        gpio_pin_write(dev, 3, true);

                        gpio_pin_write(dev, 7, true);

                        k_sleep(10);

            }

 

So all I do is toggle Pin 3 and 7 every 10 msecs. Now if I let this code run it will work, but after some seconds Pin 7 will stop toggling, while Pin 3 keeps running. And after that point Pin 7 will never turn on again (not even if I press Reset). However if I disconnect and then reconnect power, it will start working for some seconds again.

It appears as if there as some Pins that work all the time and some Pins just stop working after some seconds. What is wrong?

 

 

Best,

Paul

 


Re: bt_le_scan of node in Mesh network

Julian, LEDCity.ch
 

Hi Martin,
We needed the same functionality that you are describing.

After some analysis of the BT Mesh subsystem in the Zephryr, we came to the same conclusion as Vinayak. The Mesh system is using the BT 4 features to receive packages itself, i.e. the Mesh subsystem starts scanning with bt_le_scan on initialization and registeres its own callback (bt_mesh_scan_cb in Zephyr/subsys/bluetooth/host/mesh/adv.c). The system does not allow a second (concurrent) call of bt_le_scan.

Hence, the only option is a small adaptation of  the Zephyr source.
The Mesh scan callback only recognises Mesh specific scan packages and ignores the rest. Introducing an extra callback enabled us to receive all scan packages that are ignored by Mesh (see code snipped below).

Best,
Julian

Here is a code snippet of our adaptations of adv.c starting on line 253:
///////////////////changes here
//callback function pointer to be set from project code
void (*bt_mesh_scan_unprocressed_nonconn_ad_cb)(const bt_addr_le_t *addr, s8_t rssi,
        struct net_buf_simple *buf, u8_t type_from_buf, u8_t data_len) = NULL;
/////////////////

static void bt_mesh_scan_cb(const bt_addr_le_t *addr, s8_t rssi,
                u8_t adv_type, struct net_buf_simple *buf)
{
    if (adv_type != BT_LE_ADV_NONCONN_IND) {
        return;
    }

    BT_DBG("len %u: %s", buf->len, bt_hex(buf->data, buf->len));

    while (buf->len > 1) {
        struct net_buf_simple_state state;
        u8_t len, type;

        len = net_buf_simple_pull_u8(buf);
        /* Check for early termination */
        if (len == 0) {
            return;
        }

        if (len > buf->len) {
            BT_WARN("AD malformed");
            return;
        }

        net_buf_simple_save(buf, &state);

        type = net_buf_simple_pull_u8(buf);

        buf->len = len - 1;

        switch (type) {
        case BT_DATA_MESH_MESSAGE:
            bt_mesh_net_recv(buf, rssi, BT_MESH_NET_IF_ADV);
            break;
#if defined(CONFIG_BT_MESH_PB_ADV)
        case BT_DATA_MESH_PROV:
            bt_mesh_pb_adv_recv(buf);
            break;
#endif
        case BT_DATA_MESH_BEACON:
            bt_mesh_beacon_recv(buf);
            break;
///////////////////changes here
        default:
            if (bt_mesh_scan_unprocressed_nonconn_ad_cb != NULL)       
                bt_mesh_scan_unprocressed_nonconn_ad_cb(addr,rssi,buf,type,len-1);
            break;
/////////////////
        }

        net_buf_simple_restore(buf, &state);
        net_buf_simple_pull(buf, len);
    }
}


Re: Slip TCP connection between linux host and nrf52840

Andrei Emeltchenko <andrei.emeltchenko@...>
 

On Fri, Oct 12, 2018 at 10:35:23AM -0700, cpmcparland@rtisys.org wrote:
Andrei,

THanks for the note....unfortuately, the USB interface is peripheral only.
Your device can be USB Ethernet dongle itself, no need to connect extra
stuff.

Best regards
Andrei Emeltchenko


Re: bt_le_scan of node in Mesh network

Chettimada, Vinayak Kariappa
 

Hi Martin,

Adding Johan.

The controller does not support multiple scan state instances. This is something in the works.

Mesh stack implementation utilizes standard BT 4.0+ controller features, and no proprietary implementations are present in Zephyr.

That said, there are plans to add Mesh vendor specific extensions, some investigatory work was done before but postposed for later implementation:
https://github.com/zephyrproject-rtos/zephyr/pull/5500

Regards,
Vinayak

-----Original Message-----
From: <devel@lists.zephyrproject.org> on behalf of Martin <ma@jgs-wg.de>
Date: Friday, 12 October 2018 at 2:44 PM
To: "devel@lists.zephyrproject.org" <devel@lists.zephyrproject.org>
Subject: [Zephyr-devel] bt_le_scan of node in Mesh network

Hi,
I am wondering if (and how) it is possible to fire off a bt_le_scan
(scan for nearby devices) from a Zephyr OS device which is a node in a
BLE mesh network at the same time.
From my current research I have found out that timing possibly is
important (and that Nordic provides a Timeslot API), but I did not
find a timing API or suchlike in the Zephyr OS documentation..

Could someone point me into the right direction?

Thanks!
Martin


Re: nRF5 GPIO stops working after some time

Carles Cufi
 

+ Andrzej, Mieszko

 

From: <devel@...> on behalf of Gavrikov Paul <Paul.Gavrikov@...>
Date: Friday, 12 October 2018 at 20:28
To: "zephyr-devel@..." <zephyr-devel@...>
Cc: Lai Matthias <Matthias.Lai@...>
Subject: [Zephyr-devel] nRF5 GPIO stops working after some time

 

Hi,

 

I have a very weird problem with my nRF52840-DK and Zephyr v1.13.0. Very simple code:

 

dev = device_get_binding(CONFIG_GPIO_P0_DEV_NAME);

 

            gpio_pin_configure(dev, 7, GPIO_PIN_ENABLE  | GPIO_DIR_OUT);

            gpio_pin_configure(dev, 3, GPIO_PIN_ENABLE  | GPIO_DIR_OUT);

 

            while(1) {

                        gpio_pin_write(dev, 3, false);

                        gpio_pin_write(dev, 7, false);

                        k_sleep(10);

                        gpio_pin_write(dev, 3, true);

                        gpio_pin_write(dev, 7, true);

                        k_sleep(10);

            }

 

So all I do is toggle Pin 3 and 7 every 10 msecs. Now if I let this code run it will work, but after some seconds Pin 7 will stop toggling, while Pin 3 keeps running. And after that point Pin 7 will never turn on again (not even if I press Reset). However if I disconnect and then reconnect power, it will start working for some seconds again.

It appears as if there as some Pins that work all the time and some Pins just stop working after some seconds. What is wrong?

 

 

Best,

Paul

 


nRF5 GPIO stops working after some time

Gavrikov Paul <Paul.Gavrikov@...>
 

Hi,

 

I have a very weird problem with my nRF52840-DK and Zephyr v1.13.0. Very simple code:

 

dev = device_get_binding(CONFIG_GPIO_P0_DEV_NAME);

 

            gpio_pin_configure(dev, 7, GPIO_PIN_ENABLE  | GPIO_DIR_OUT);

            gpio_pin_configure(dev, 3, GPIO_PIN_ENABLE  | GPIO_DIR_OUT);

 

            while(1) {

                        gpio_pin_write(dev, 3, false);

                        gpio_pin_write(dev, 7, false);

                        k_sleep(10);

                        gpio_pin_write(dev, 3, true);

                        gpio_pin_write(dev, 7, true);

                        k_sleep(10);

            }

 

So all I do is toggle Pin 3 and 7 every 10 msecs. Now if I let this code run it will work, but after some seconds Pin 7 will stop toggling, while Pin 3 keeps running. And after that point Pin 7 will never turn on again (not even if I press Reset). However if I disconnect and then reconnect power, it will start working for some seconds again.

It appears as if there as some Pins that work all the time and some Pins just stop working after some seconds. What is wrong?

 

 

Best,

Paul

 


Re: Slip TCP connection between linux host and nrf52840

cpmcparland@...
 

Jukka,

Thanks, I was hoping that was the case.  Have found the slip.c code and am looking through it.
Not too many examples for slip and the ones I have seen all point to Qemu.  Any idea or pointers
as to where uart pipe gets created?  I'm guessing its buried somewhere in the Qemu board support
config files. 

Regards,
Chuck McP


Re: Slip TCP connection between linux host and nrf52840

cpmcparland@...
 

Andrei,

THanks for the note....unfortuately, the USB interface is peripheral only. So, as I
understand it, I can't control USB/WiFi dongles which are also peripheral mode
devices. 

Cheers,
Chuck McP


bt_le_scan of node in Mesh network

Martin <ma@...>
 

Hi,
I am wondering if (and how) it is possible to fire off a bt_le_scan
(scan for nearby devices) from a Zephyr OS device which is a node in a
BLE mesh network at the same time.
From my current research I have found out that timing possibly is
important (and that Nordic provides a Timeslot API), but I did not
find a timing API or suchlike in the Zephyr OS documentation..

Could someone point me into the right direction?

Thanks!
Martin


Re: How to add GPS / location in Zephyr?

Carles Cufi
 

Hi all,

 

A PR is available now here:

https://github.com/zephyrproject-rtos/zephyr/pull/10376

 

All feedback welcome.

 

Thanks,

 

Carles

 

From: devel@... <devel@...> On Behalf Of jantore.guggedal@...
Sent: 12 September 2018 10:02
To: devel@...
Subject: [Zephyr-devel] How to add GPS / location in Zephyr?

 

Hi,

 

I'm working on a project in Zephyr that will use GPS to get the location of a device. 

Until now the GPS data has been fethed using serial drivers directly, but we're looking into the possibility of using the sensor API to interface with the GPS and make it appear like a "normal" sensor in Zephyr. 

And this is where we run into some issues:

 

The sensor_value data type in the sensor API is for numbers with an integer and a fractional part. A typical GPS sensor provides NMEA strings of various types, and for us it would be useful for the application to receive these strings unparsed.

In many cases it would be fine to get parsed longitude, latitude, altitude and other values using respective channels in the sensor API, but the option to receive the raw data string would still be preferable in our case as we intend to forward it unparsed.

A fair number of channels (~20) would have to be added to the API to be able to get the most detailed data from the GPS sensor that is available in the NMEA strings, but that's perhaps not a problem? 

For the most essential GPS information (latitude, longitude, altitude, speed, heading, time), fewer channels are needed.

We could parse the strings in GPS driver, send the strings over a sensor channel, and then in the application put the data back into a string equal to the original one, but it would be good to not need to do this unncessary processing.

 

  • If using the sensor API, can we get strings from a sensor channel by somehow expanding the current sensor_value data type without breaking existing code? Just adding extra fields to the struct is maybe not a preferable solution?
  • Do you think that GPS fits within the sensor API, or should we look in another direction?

 

We appreciate all feedback on how to approach the task of integrating GPS/location into Zephyr. 

 

Best regards

Jan Tore Guggedal

 


Re: MIPS architecture support

Kumar Gala
 

On Oct 11, 2018, at 10:30 PM, Alex Nemirovsky <alex.nemirovsky@gmail.com> wrote:

Hi Kumar,

Its been a long time.
On Oct 11, 2018, at 8:04 PM, Kumar Gala <kumar.gala@linaro.org> wrote:


On Oct 11, 2018, at 8:14 PM, Alex Nemirovsky <alex.nemirovsky@gmail.com> wrote:

Hello,

I’m new here, so please be gentle. ;-)

I’d like to contribute my private MIPS architecture support upstream.
Is this for a customer SoC or some generally available MIPS SoC?
The company that I currently work for makes SoCs. However, they are not ready to
release the SoC specific code upstream.

For now, they would like to support a generic QEMU-MIPS board based on standard MIPS R3k architecture (ISA I, II) with generic QEMU drivers (i.e. serial port)
However, before I begin the process, I’ll like to know if anyone else is working on this as well so that we could coordinate our efforts.
There was some MIPS support contributed but never finished off. Here’s a link to the GitHub PR:

https://github.com/zephyrproject-rtos/zephyr/pull/1576

Its pretty stale at this point, but gives you a starting point.
I’m been maintaining MIPS support here since Zephyr 1.7. I’ll look over the code to see if there is anything we should reuse.
btw, Most of our support is similar to the Zephyr RISCV implementation from an architecture point of view. i.e. swap() function using syscall exception.

For testing purposes, we really need at least a port to an SoC/board that is generally available and probably has support in qemu.
The Zephyr SDK has a mips toolchain for mips32r2-zephyr-elf.

Also, would you be able to act as a maintainer for the port?
I have a private Zephyr SDK 0.9.3 built for our MIPS SoC with some custom instructions. However, for upstream
management would just like to support stock MIPS ISA I, II, etc without adding our custom instructions to the toolchain.
Other stock ISA like MIPS32, MIPS64 is fine also.

I could act as a maintainer for the MIPS architecture, if you like.

What do you think about the generic MIPS support using QEMU for now instead of physical HW?
That sounds perfect, its actually ideal to have the first targeted SoC/Board be something supported in Qemu. I’m not familiar enough with the differences between ISA I/II. What QEMU MIPS board do you think you’d select?

- k


Re: Slip TCP connection between linux host and nrf52840

Jukka Rissanen
 

Hi Chuck,

there is nothing qemu specific in SLIP driver found in drivers/net/slip
directory. It only uses uart_pipe to transfer data. So if you manage to
configure the uart_pipe to use physical uart interface, then it should
work just fine.

Cheers,
Jukka

On Thu, 2018-10-11 at 16:01 -0700, cpmcparland@rtisys.org wrote:
Hi,

I need to get a sensor data stream flowing from a BT network into a
linux host. Have tried
to setup BT HCI interface but no luck getting hci0 interface to move
from DOWN to UP.
So, thought I would take a different approach and put a dual stack on
the nrf52 with the
ip link to the host going through a serial port.

So, I would like to set up a slip tcp/ip connection between a linux
host and a nrf52840. I know
slip can be used to connect to a qemu simulation. Has anyone used
slip to talk to a physical
uart interface? If so, can I use the nrf52840's console port or do I
need to use a seperate
uart and interface via a FTDI usb cable?

Echo_server sample code seems to be a good base to start with....Any
suggestions would help.

Regards,
Chuck McP


Re: Slip TCP connection between linux host and nrf52840

Andrei
 

Hi

On Thu, Oct 11, 2018 at 04:01:05PM -0700, cpmcparland@rtisys.org wrote:
Hi,

I need to get a sensor data stream flowing from a BT network into a linux
host.  Have tried
to setup BT HCI interface but no luck getting hci0 interface to move from
DOWN to UP.
So, thought I would take a different approach and put a dual stack on the
nrf52 with the
ip link to the host going through a serial port.
BTW, if you have USB you can enable Ethernet over USB and connect to
your PC.

Best regards
Andrei Emeltchenko


So, I would like to set up a slip tcp/ip connection between a linux host
and a nrf52840.  I know
slip can be used to connect to a qemu simulation.  Has anyone used slip to
talk to a physical
uart interface?  If so, can I use the nrf52840's console port or do I need
to use a seperate
uart and interface via a FTDI usb cable?

Echo_server sample code seems to be a good base to start with....Any
suggestions would help.

Regards,
Chuck McP


Re: MIPS architecture support

Benjamin Lindqvist
 

I would do heinous things for a AR9331 port...
Den fre 12 okt. 2018 kl 05:30 skrev Alex Nemirovsky <alex.nemirovsky@gmail.com>:


Hi Kumar,

Its been a long time.
On Oct 11, 2018, at 8:04 PM, Kumar Gala <kumar.gala@linaro.org> wrote:


On Oct 11, 2018, at 8:14 PM, Alex Nemirovsky <alex.nemirovsky@gmail.com> wrote:

Hello,

I’m new here, so please be gentle. ;-)

I’d like to contribute my private MIPS architecture support upstream.
Is this for a customer SoC or some generally available MIPS SoC?
The company that I currently work for makes SoCs. However, they are not ready to
release the SoC specific code upstream.

For now, they would like to support a generic QEMU-MIPS board based on standard MIPS R3k architecture (ISA I, II) with generic QEMU drivers (i.e. serial port)
However, before I begin the process, I’ll like to know if anyone else is working on this as well so that we could coordinate our efforts.
There was some MIPS support contributed but never finished off. Here’s a link to the GitHub PR:

https://github.com/zephyrproject-rtos/zephyr/pull/1576

Its pretty stale at this point, but gives you a starting point.
I’m been maintaining MIPS support here since Zephyr 1.7. I’ll look over the code to see if there is anything we should reuse.
btw, Most of our support is similar to the Zephyr RISCV implementation from an architecture point of view. i.e. swap() function using syscall exception.

For testing purposes, we really need at least a port to an SoC/board that is generally available and probably has support in qemu.
The Zephyr SDK has a mips toolchain for mips32r2-zephyr-elf.

Also, would you be able to act as a maintainer for the port?
I have a private Zephyr SDK 0.9.3 built for our MIPS SoC with some custom instructions. However, for upstream
management would just like to support stock MIPS ISA I, II, etc without adding our custom instructions to the toolchain.
Other stock ISA like MIPS32, MIPS64 is fine also.

I could act as a maintainer for the MIPS architecture, if you like.

What do you think about the generic MIPS support using QEMU for now instead of physical HW?

- k


2861 - 2880 of 8118