Date   

Securing BLE device Services & Characteristics from unauthorized user

Vikrant More <vikrant8051@...>
 

Hello World !!

Suppose there is BLE device with following custom characteristics -
1. main
2. enc_text
3. plain_text
4. aes_key

"enc_text" characteristic receives 16 bytes of encrypted string.

"plain_text" characteristic receives 16 bytes of plain string.

"aes_key" characteristic receives 16 bytes of AES key.

int bt_encrypt_le(constu8_t key[16], const8_t plaintext[16], u8_t enc_data[16])

Using this function I'm planning to encrypting received plain string & gonna compare its output with
received encrypted string.

If both matches, then only "main" characteristic accepts data from client.

But what type of AES encryption is used behind this bt_encrypt_le( ) ?

How to disconnect BLE connection from BLE Device side ?

I wanna show "aes_key" characteristic only after device is in factory-reset mode.
Once it receive AES key from user, it should disappear. How to do that ?


Thanks !!




Re: Introduction of Youtube video, "Bluetooth Mesh Demo at ELCE Prague 2017"

Johan Hedberg
 

Hi Kai,

On Mon, Feb 12, 2018, Kai Ren wrote:
I have two micro:bit boards, I built the firmware,
./sample/bluetooth/mesh_demo/ and flashed it on these two boards.
After completing it, I could see that:
1. one micro:bit address is 0x0b01, the other is 0x0b02;
Note that button B cycles the destination address from 0x0001 to
0x0009, then jumps to the group address and then back to 0x0001 again,
so nodes with 0x0b.. addresses will only be able to receive on the group
address but you can never send to their unicasts with the demo. I'd
therefore recommend sticking to the 0x0001-0x0009 range.

2. when the boards powered up, I could see the unique address floating on LED matrix;
3. attached is the UART console screenshot, the board initialization
was successful, when I press buttonA, button callback function seemed
to work well.

But I couldn't capture heartbeat and when I press buttonA, I couldn't
see that message broadcasting. Is there anything wrong for my
configuration?
Button A is not supposed to send a heartbeat message, rather it should
send a kind of dummy vendor model message which should trigger the
recipient to print the least significant digit of the address of the
sender.

If you want to make one node send period heartbeat messages you need to
give it the unicast address 0x000f, which is treated in a special way
with the demo. If you haven't done so already I suggest you try to
explore a bit the following source files, which should hopefully give a
better idea of the logic and possibilities with the demo:

samples/bluetooth/mesh_demo/src/main.c
samples/bluetooth/mesh_demo/src/microbit.c

These two files communicate with each other through the exported
functions in samples/bluetooth/mesh_demo/src/board.h.

Johan


Re: Introduction of Youtube video, "Bluetooth Mesh Demo at ELCE Prague 2017"

Kai Ren
 

Hi Johan,
Thanks for your answers!
I have two micro:bit boards, I built the firmware, ./sample/bluetooth/mesh_demo/ and flashed it on these two boards. After completing it, I could see that:
1. one micro:bit address is 0x0b01, the other is 0x0b02;
2. when the boards powered up, I could see the unique address floating on LED matrix;
3. attached is the UART console screenshot, the board initialization was successful, when I press buttonA, button callback function seemed to work well.

But I couldn't capture heartbeat and when I press buttonA, I couldn't see that message broadcasting. Is there anything wrong for my configuration?


Regards,
Kai

-----Original Message-----
From: Johan Hedberg [mailto:johan.hedberg@intel.com]
Sent: Wednesday, January 3, 2018 5:44 PM
To: Kai Ren <kren@bluetooth.com>
Cc: zephyr-devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] Introduction of Youtube video, "Bluetooth Mesh Demo at ELCE Prague 2017"

Hi Kai,

On Wed, Jan 03, 2018, Kai Ren wrote:
* How many devices (micro:bit) do I need to prepare?
At least two. The demo is designed to show only the last digit of the sending devices's address, so anything more than 9 devices and you start seeing hex characters :)

* What device would be the Provisioner?
No device. The way this particular demo works is that the nodes self-provision themselves, and you assing a unique unicast address at build-time (i.e. each device is flashed with a unique build image).

* What firmware do I need to use? Under $ZEPHYR_BASE/sample or $ZEPHYR_BASE/test?
It's samples/bluetooth/mesh_demo. The unique unicast for each build is given by passing e.g. NODE_ADDR=0x0001 as a build variable.

Johan


SFCB to save persistence data for #bluetoothmesh

Vikrant More <vikrant8051@...>
 

Hi Johan,

Is SFCB better option than NFFS to save #BluetoothMesh's persistence data ?
Will it help us in case of nRF51 series which has limited flash storage ?

Thank You !!



---------- Forwarded message ----------
From: Laczen JMS <laczenjms@...>
Date: Sat, Feb 10, 2018 at 2:30 PM
Subject: Re: [Zephyr-devel] [Zephyr-users] Power Configuration of nrf52840 (Vikrant More)
To: zephyr-devel@...


Hi Vikrant,

NFFS file system might not be a good choice to store frequently changing data.

For this case I have created a library called sfcb that you can find
in my zephyr project fork: https://github.com/Laczen/zephyr. The sfcb
(simple flash circular buffer) allows you to store data in a series of
sectors in flash.

All data is stored as a identifier-value pair, the identifier is a 16
bit value, the data can be anything from a byte to a very long string
of bytes (limited by the sector size). By writing a new
identifier-value pair the previous pair with the same identifier is
considered overwritten.

When all the available sectors have been used the library does a
garbage collection phase before erasing a sector. In this phase it
makes sure that there is at least one identifier-value pair for each
identifier.

The library allows you to combine almost constant data: node address,
netkeys, groups together with frequently changing data: sequence
number, iv_index into one storage solution, without wearing out flash
to fast. The almost constant data could be stored into one
identifier-value pair, the frequently changing in a different
identifier-value pair. Of course for the sequence number you will need
to avoid storing it for every change.

It can also be used in different cases where you would like to combine
the storage of network address, device name, ... in combination with
the device state (e.g. light switched on) in the same storage
solution.

Another use of the library is to consider the identifier as a file
name and the value as file contents.

In my zephyr project fork you can find a simple example in samples/subsys/sfcb.

Kind regards,

Jehudi



Re: [Bluetooth] Is BT 5.0 specific features supported by Zephyr for nRF52840 board yet?

Anupam Roy
 

Hi Vinayak,

 Sure, I shall work on sending a patch to upstream soon.

Additionally, 'HCI LE Set Random Address'  works well in my setup. Much thanks!

 

BR,

-Anupam Roy

 

--------- Original Message ---------

Sender : Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...>

Date : 2018-02-10 14:50 (GMT+9)

Title : Re: [Zephyr-devel] [Bluetooth] Is BT 5.0 specific features supported by Zephyr for nRF52840 board yet?

 

Hi Anupam,

Your changes to list out the PHY commands as supported is welcome, please send a PR to upstream repo.

Nordic chip do not own any Bluetooth device address space, no public addresses and the device shall use privacy features in all cases.
That said, every chip comes with an unique byte stream hint usable as the identity if required, and Zephyr host+controller combined sample use this entropy as default.
This number can be retrieved for standalone HCI controller using the vendor specific command: BT_HCI_OP_VS_READ_STATIC_ADDRS

Your host can choose to use HCI LE Set Random Address with its chosen address (as your design standards mandate wrt security).

Regards,
Vinayak

On 9 Feb 2018, at 14:30, Anupam Roy <anupam.r@...> wrote:


Hi Cufi,

 Thanks for fast response. With the help of your pointer, now I am able to at-least verify the basic HCI LE 2M PHY commands like - Read PHY, LE Set Default PHY, LE Set PHY

By the way, the reason for the "btmon" tool not being able to list up the 2M PHY commands was probably some checks getting missed out in Bluetooth controller code.


 

After I made following changes, now LE 2M PHY commands are listed out properly.

+++ b/subsys/bluetooth/controller/hci/hci.c
@@ -530,6 +530,15 @@ static void read_supported_commands(struct net_buf *buf, struct net_buf **evt)
        /* LE Enhanced TX Test. */
        rp->commands[36] |= BIT(0);
 #endif /* CONFIG_BT_CTLR_DTM_HCI */
+#if defined(CONFIG_BT_CTLR_PHY)
+       /* LE Read PHY Command. */
+       rp->commands[35] |= BIT(4);
+       /* LE Set Default PHY Command. */
+       rp->commands[35] |= BIT(5);
+       /* LE Set PHY Command. */
+       rp->commands[35] |= BIT(6);
+#endif

 


 

Please share your opinion about the same.

By the way, one issue I am encountering is with Bluetooth public address.

After I run btattach from RPI3 terminal, BT address turns out to be ALL zeroes.


 

 pi@raspberrypi:~ $ sudo hciconfig hci1
hci1: Type: Primary  Bus: UART
 BD Address: 00:00:00:00:00:00  ACL MTU: 27:7  SCO MTU: 0:0
 UP RUNNING 
 RX bytes:1649 acl:36 sco:0 events:89 errors:0
 TX bytes:916 acl:31 sco:0 commands:50 errors:0


 

Any insight to this will be really great. Much thanks.


 

BR,

-Anupam Roy


 

--------- Original Message ---------

Sender : Cufi, Carles <Carles.Cufi@...>

Date : 2018-02-09 05:05 (GMT+9)

Title : RE: [Zephyr-devel] [Bluetooth] Is BT 5.0 specific features supported by Zephyr for nRF52840 board yet?


 
Hi Anupam,

 

All the features you mention are supported on the nRF52840 *except* LE Extended Advertising.
I suggest you take a look at the controller feature list in order to enable/disable particular features. You can do that by editing your prj.conf and adding the missing options.

 

 

LE Extended Advertising will probably come after some additional required refactoring that is going on at the moment.

 

Contributions welcome!

 

Regards,

 

Carles

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Anupam Roy
Sent: 08 February 2018 14:16
To: zephyr-devel@...
Cc: SACHIN DEV SHARMA <sachin.dev@...>
Subject: [Zephyr-devel] [Bluetooth] Is BT 5.0 specific features supported by Zephyr for nRF52840 board yet?

 

Hello Zephyr Developers,

 I am looking for zephyr based application for verifying BT 5.0 specific features like LE Extended Advertising, LE Long Range (2M PHY), LE High Speed (2M PHY) etc. on my nRF52840 PDK board.

Currently, I have compiled samples/bluetooth/hci_uart and burnt the zephyr.hex in nRF52840 PDK board.

However, it does not support BT 5.0 specific features mentioned above. My intention is to use Bluez upstream in my Host PC (RPI3 with Raspbian Distribution) and nRF52840 SOC as my BT controller.

Could someone provide some insights if such support is available somewhere or if not, then when will such support be available?

When I use hciconfig hci1 commands, I get following list of Supported commands in btmon

  HCI Command: Read Local Supported Commands (0x04|0x0002) plen 0                                                                                                                                           #1 [hci1] 17.880862
> HCI Event: Command Complete (0x0e) plen 68                                                                                                                                                                #2 [hci1] 17.882136
      Read Local Supported Commands (0x04|0x0002) ncmd 1
        Status: Success (0x00)
        Commands: 62 entries
          Disconnect (Octet 0 - Bit 5)
          Read Remote Version Information (Octet 2 - Bit 7)
          Set Event Mask (Octet 5 - Bit 6)
          Reset (Octet 5 - Bit 7)
          Read Transmit Power Level (Octet 10 - Bit 2)
          Set Controller To Host Flow Control (Octet 10 - Bit 5)
          Host Buffer Size (Octet 10 - Bit 6)
          Host Number of Completed Packets (Octet 10 - Bit 7)
          Read Local Version Information (Octet 14 - Bit 3)
          Read Local Supported Features (Octet 14 - Bit 5)
          Read BD ADDR (Octet 15 - Bit 1)
          Set Event Mask Page 2 (Octet 22 - Bit 2)
          LE Set Event Mask (Octet 25 - Bit 0)
          LE Read Buffer Size (Octet 25 - Bit 1)
          LE Read Local Supported Features (Octet 25 - Bit 2)
          LE Set Random Address (Octet 25 - Bit 4)
          LE Set Advertising Parameters (Octet 25 - Bit 5)
          LE Read Advertising Channel TX Power (Octet 25 - Bit 6)
          LE Set Advertising Data (Octet 25 - Bit 7)
          LE Set Scan Response Data (Octet 26 - Bit 0)
          LE Set Advertise Enable (Octet 26 - Bit 1)
          LE Set Scan Parameters (Octet 26 - Bit 2)
          LE Set Scan Enable (Octet 26 - Bit 3)
          LE Create Connection (Octet 26 - Bit 4)
          LE Create Connection Cancel (Octet 26 - Bit 5)
          LE Read White List Size (Octet 26 - Bit 6)
          LE Clear White List (Octet 26 - Bit 7)
          LE Add Device To White List (Octet 27 - Bit 0)
          LE Remove Device From White List (Octet 27 - Bit 1)
          LE Connection Update (Octet 27 - Bit 2)
          LE Set Host Channel Classification (Octet 27 - Bit 3)
          LE Read Channel Map (Octet 27 - Bit 4)
          LE Read Remote Used Features (Octet 27 - Bit 5)
          LE Encrypt (Octet 27 - Bit 6)
          LE Rand (Octet 27 - Bit 7)
          LE Start Encryption (Octet 28 - Bit 0)
          LE Long Term Key Request Reply (Octet 28 - Bit 1)
          LE Long Term Key Request Neg Reply (Octet 28 - Bit 2)
          LE Read Supported States (Octet 28 - Bit 3)
          LE Receiver Test (Octet 28 - Bit 4)
          LE Transmitter Test (Octet 28 - Bit 5)
          LE Test End (Octet 28 - Bit 6)
          Read Authenticated Payload Timeout (Octet 32 - Bit 4)
          Write Authenticated Payload Timeout (Octet 32 - Bit 5)
          LE Remote Connection Parameter Request Reply (Octet 33 - Bit 4)
          LE Remote Connection Parameter Request Negative Reply (Octet 33 - Bit 5)
          LE Set Data Length (Octet 33 - Bit 6)
          LE Read Suggested Default Data Length (Octet 33 - Bit 7)
          LE Write Suggested Default Data Length (Octet 34 - Bit 0)
          LE Add Device To Resolving List (Octet 34 - Bit 3)
          LE Remove Device From Resolving List (Octet 34 - Bit 4)
          LE Clear Resolving List (Octet 34 - Bit 5)
          LE Read Resolving List Size (Octet 34 - Bit 6)
          LE Read Peer Resolvable Address (Octet 34 - Bit 7)
          LE Read Local Resolvable Address (Octet 35 - Bit 0)
          LE Set Address Resolution Enable (Octet 35 - Bit 1)
          LE Set Resolvable Private Address Timeout (Octet 35 - Bit 2)
          LE Read Maximum Data Length (Octet 35 - Bit 3)
          LE Enhanced Receiver Test (Octet 35 - Bit 7)
          LE Enhanced Transmitter Test (Octet 36 - Bit 0)
          LE Read Transmit Power (Octet 38 - Bit 7)
          LE Set Privacy Mode (Octet 39 - Bit 2)
@ RAW Close: hciconfig                                                                                                                                                                                {0x0006} [hci1] 17.886419
@ RAW Close: hciconfig


 
BR,

-Anupam Roy

BR,

-Anupam Roy

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

BR,

-Anupam Roy


Re: [Zephyr-users] Power Configuration of nrf52840

Chettimada, Vinayak Kariappa
 

1. Correction, values in UICR are at fixed location, changing them is not needed on every power up of the board.That said, after a change, a power cycle is need for h/w to load the new values. And yes, if you erase and flash UICR, its same as erase and flash a new firmware.
2. For your use case of storing frequently changing data, you need some sort of wear leveling. 


On 10 Feb 2018, at 07:17, Vikrant More <vikrant8051@...> wrote:

But nrf52 flash support 10K write cycle. And it is like normal programming, isn't it ?

Worrying after reading your this statement, since I'm now trying to save persistent data which generate during working of #BluetoothMesh on flash of nRF52.

I used NFFS file system for testing. 

On Feb 10, 2018 10:57 AM, "Chettimada, Vinayak Kariappa" <vinayak.kariappa.chettimada@...> wrote:
Hope you are doing it “only once per board’s life time” else you could be degrading the flash. Hence, my advice is to use nrfjprog to make the change "only once" per each board or use the design in soc.c wherein the value is first compared before writing.

-Vinayak

On 9 Feb 2018, at 07:20, ashish.shukla@... wrote:

Thanks everyone !!!

Adding these lines does the job. 

 NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    }

    NRF_UICR->EXTSUPPLY = 0x01;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    } 

    NRF_UICR->REGOUT0 = 0x05;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    }

    NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
    {
    }


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Thu, Feb 8, 2018 at 12:17 AM, Vinayak Kariappa <vinayak.kariappa@gmail.com> wrote:
Hi Ashish,

UICR is Flash, you need to do something similar to in soc.c done for reset pin config. Or use nrfjprog to write values to UICR


On 7 Feb 2018, at 12:04, "ashish.shukla@..." <ashish.shukla@...> wrote:

Hi,

Yes, I'm working in high voltage mode.  VDDH = 3.6V 

Then, I added following lines 

NRF_POWER->DCDCEN0 = 0x01;  // Enabling DC/DC for stage REG0
NRF_POWER->DCDCEN = 0x01;   // Enabling DC/DC for stage REG1 

Again, as you suggested 

NRF_UICR->EXTSUPPLY = 0x01;  
NRF_UICR->REGOUT0 = 0x05;

After adding these lines at starting of main() function, It still measures 1.8V. 


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Wed, Feb 7, 2018 at 4:16 PM, Puzdrowski, Andrzej <Andrzej.Puzdrowski@nordicsemi.no> wrote:

Hi

So you must have supplied nRF52840 from VDDH pin – so it power regulator circuit works in high voltage mode.

 

Then internal regulator generate the GPIO output voltage:

You need to set UICR->REGOUT0 properly, 5 is proper value for select 3.3 V

 

For more info see nRF52840 OPS, especjali POWER chapter

 

Andrzej

 

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of ashish.shukla@...
Sent: Wednesday, February 07, 2018 8:22 AM
To: zephyr-devel@lists.zephyrproject.org; zephyr-users@...
Subject: [Zephyr-devel] Power Configuration of nrf52840

 

Hello everyone !!! 

I'm working with custom PCB of nrf52840. I need to set VDD voltage which is also GPIO high level voltage equals to 3.3V, otherwise it's 1.8V by default.


How can I configure this? 

or 

How can I access registers of nrf52840 in zephyr architecture?    

 

 

--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

 

Please consider the environment before printing this e-mail or its attachments.

 

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

 


_______________________________________________
Zephyr-users mailing list
Zephyr-users@...ct.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users



Re: [Zephyr-users] Power Configuration of nrf52840 (Vikrant More)

laczenJMS
 

Hi Vikrant,

NFFS file system might not be a good choice to store frequently changing data.

For this case I have created a library called sfcb that you can find
in my zephyr project fork: https://github.com/Laczen/zephyr. The sfcb
(simple flash circular buffer) allows you to store data in a series of
sectors in flash.

All data is stored as a identifier-value pair, the identifier is a 16
bit value, the data can be anything from a byte to a very long string
of bytes (limited by the sector size). By writing a new
identifier-value pair the previous pair with the same identifier is
considered overwritten.

When all the available sectors have been used the library does a
garbage collection phase before erasing a sector. In this phase it
makes sure that there is at least one identifier-value pair for each
identifier.

The library allows you to combine almost constant data: node address,
netkeys, groups together with frequently changing data: sequence
number, iv_index into one storage solution, without wearing out flash
to fast. The almost constant data could be stored into one
identifier-value pair, the frequently changing in a different
identifier-value pair. Of course for the sequence number you will need
to avoid storing it for every change.

It can also be used in different cases where you would like to combine
the storage of network address, device name, ... in combination with
the device state (e.g. light switched on) in the same storage
solution.

Another use of the library is to consider the identifier as a file
name and the value as file contents.

In my zephyr project fork you can find a simple example in samples/subsys/sfcb.

Kind regards,

Jehudi

2018-02-10 7:17 GMT+01:00 <zephyr-devel-request@lists.zephyrproject.org>:

Send Zephyr-devel mailing list submissions to
zephyr-devel@lists.zephyrproject.org

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel
or, via email, send a message with subject or body 'help' to
zephyr-devel-request@lists.zephyrproject.org

You can reach the person managing the list at
zephyr-devel-owner@lists.zephyrproject.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Zephyr-devel digest..."


Today's Topics:

1. Re: [Zephyr-users] Power Configuration of nrf52840 (Vikrant More)


----------------------------------------------------------------------

Message: 1
Date: Sat, 10 Feb 2018 11:47:25 +0530
From: Vikrant More <vikrant8051@gmail.com>
To: "Chettimada, Vinayak Kariappa"
<vinayak.kariappa.chettimada@nordicsemi.no>,
zephyr-devel@lists.zephyrproject.org,
zephyr-users@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] [Zephyr-users] Power Configuration of
nrf52840
Message-ID:
<CAOMoz5q5ax4czmOdxXEQxcEmFRq4dHEFpcoT7P3cZAN7cNs2CQ@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

But nrf52 flash support 10K write cycle. And it is like normal programming,
isn't it ?

Worrying after reading your this statement, since I'm now trying to save
persistent data which generate during working of #BluetoothMesh on flash of
nRF52.

I used NFFS file system for testing.

On Feb 10, 2018 10:57 AM, "Chettimada, Vinayak Kariappa" <
vinayak.kariappa.chettimada@nordicsemi.no> wrote:

Hope you are doing it ?only once per board?s life time? else you could be
degrading the flash. Hence, my advice is to use nrfjprog to make the change
"only once" per each board or use the design in soc.c wherein the value is
first compared before writing.

-Vinayak

On 9 Feb 2018, at 07:20, ashish.shukla@corvi.com wrote:

Thanks everyone !!!

Adding these lines does the job.

NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
}

NRF_UICR->EXTSUPPLY = 0x01;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
}

NRF_UICR->REGOUT0 = 0x05;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
}

NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
{
}


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development
www.corvi.com


Please consider the environment before printing this e-mail or its
attachments.

Disclaimer: The information contained herein (including any accompanying
documents) is confidential and is intended solely for the addressee(s). If
you have erroneously received this message, please immediately delete it
and notify the sender. Also, if you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or taking any
action in reliance on the contents of this message or any accompanying
document is strictly prohibited and is unlawful. The organization is not
responsible for any damage caused by a virus or alteration of the e-mail by
a third party or otherwise. The contents of this message may not
necessarily represent the views or policies of Corvi


On Thu, Feb 8, 2018 at 12:17 AM, Vinayak Kariappa <vinayak.kariappa@
gmail.com> wrote:

Hi Ashish,

UICR is Flash, you need to do something similar to in soc.c done for
reset pin config. Or use nrfjprog to write values to UICR

Sent from my iPhone

On 7 Feb 2018, at 12:04, "ashish.shukla@corvi.com" <
ashish.shukla@corvi.com> wrote:

Hi,

Yes, I'm working in high voltage mode. VDDH = 3.6V

Then, I added following lines

NRF_POWER->DCDCEN0 = 0x01; // Enabling DC/DC for stage REG0
NRF_POWER->DCDCEN = 0x01; // Enabling DC/DC for stage REG1

Again, as you suggested

NRF_UICR->EXTSUPPLY = 0x01;
NRF_UICR->REGOUT0 = 0x05;

After adding these lines at starting of main() function, It still
measures 1.8V.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development
www.corvi.com


Please consider the environment before printing this e-mail or its
attachments.

Disclaimer: The information contained herein (including any accompanying
documents) is confidential and is intended solely for the addressee(s). If
you have erroneously received this message, please immediately delete it
and notify the sender. Also, if you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or taking any
action in reliance on the contents of this message or any accompanying
document is strictly prohibited and is unlawful. The organization is not
responsible for any damage caused by a virus or alteration of the e-mail by
a third party or otherwise. The contents of this message may not
necessarily represent the views or policies of Corvi


On Wed, Feb 7, 2018 at 4:16 PM, Puzdrowski, Andrzej <
Andrzej.Puzdrowski@nordicsemi.no> wrote:

Hi

So you must have supplied nRF52840 from VDDH pin ? so it power regulator
circuit works in high voltage mode.



Then internal regulator generate the GPIO output voltage:

You need to set UICR->REGOUT0 properly, 5 is proper value for select 3.3
V



For more info see nRF52840 OPS, especjali POWER chapter



Andrzej



*From:* zephyr-devel-bounces@lists.zephyrproject.org [mailto:
zephyr-devel-bounces@lists.zephyrproject.org] *On Behalf Of *
ashish.shukla@corvi.com
*Sent:* Wednesday, February 07, 2018 8:22 AM
*To:* zephyr-devel@lists.zephyrproject.org; zephyr-
users@lists.zephyrproject.org
*Subject:* [Zephyr-devel] Power Configuration of nrf52840



Hello everyone !!!

I'm working with custom PCB of nrf52840. I need to set VDD voltage which
is also GPIO high level voltage equals to 3.3V, otherwise it's 1.8V by
default.


How can I configure this?

or

How can I access registers of nrf52840 in zephyr architecture?





--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

www.corvi.com



Please consider the environment before printing this e-mail or its
attachments.



Disclaimer: The information contained herein (including any accompanying
documents) is confidential and is intended solely for the addressee(s). If
you have erroneously received this message, please immediately delete it
and notify the sender. Also, if you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or taking any
action in reliance on the contents of this message or any accompanying
document is strictly prohibited and is unlawful. The organization is not
responsible for any damage caused by a virus or alteration of the e-mail by
a third party or otherwise. The contents of this message may not
necessarily represent the views or policies of Corvi


_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel



_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zephyrproject.org/pipermail/zephyr-devel/attachments/20180210/51618262/attachment.html>

------------------------------

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


End of Zephyr-devel Digest, Vol 14, Issue 32
********************************************


Re: [Zephyr-users] Power Configuration of nrf52840

Vikrant More <vikrant8051@...>
 

But nrf52 flash support 10K write cycle. And it is like normal programming, isn't it ?

Worrying after reading your this statement, since I'm now trying to save persistent data which generate during working of #BluetoothMesh on flash of nRF52.

I used NFFS file system for testing. 

On Feb 10, 2018 10:57 AM, "Chettimada, Vinayak Kariappa" <vinayak.kariappa.chettimada@...> wrote:
Hope you are doing it “only once per board’s life time” else you could be degrading the flash. Hence, my advice is to use nrfjprog to make the change "only once" per each board or use the design in soc.c wherein the value is first compared before writing.

-Vinayak

On 9 Feb 2018, at 07:20, ashish.shukla@... wrote:

Thanks everyone !!!

Adding these lines does the job. 

 NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    }

    NRF_UICR->EXTSUPPLY = 0x01;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    } 

    NRF_UICR->REGOUT0 = 0x05;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    }

    NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
    {
    }


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Thu, Feb 8, 2018 at 12:17 AM, Vinayak Kariappa <vinayak.kariappa@gmail.com> wrote:
Hi Ashish,

UICR is Flash, you need to do something similar to in soc.c done for reset pin config. Or use nrfjprog to write values to UICR


On 7 Feb 2018, at 12:04, "ashish.shukla@..." <ashish.shukla@...> wrote:

Hi,

Yes, I'm working in high voltage mode.  VDDH = 3.6V 

Then, I added following lines 

NRF_POWER->DCDCEN0 = 0x01;  // Enabling DC/DC for stage REG0
NRF_POWER->DCDCEN = 0x01;   // Enabling DC/DC for stage REG1 

Again, as you suggested 

NRF_UICR->EXTSUPPLY = 0x01;  
NRF_UICR->REGOUT0 = 0x05;

After adding these lines at starting of main() function, It still measures 1.8V. 


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Wed, Feb 7, 2018 at 4:16 PM, Puzdrowski, Andrzej <Andrzej.Puzdrowski@nordicsemi.no> wrote:

Hi

So you must have supplied nRF52840 from VDDH pin – so it power regulator circuit works in high voltage mode.

 

Then internal regulator generate the GPIO output voltage:

You need to set UICR->REGOUT0 properly, 5 is proper value for select 3.3 V

 

For more info see nRF52840 OPS, especjali POWER chapter

 

Andrzej

 

From: zephyr-devel-bounces@lists.zephyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of ashish.shukla@...
Sent: Wednesday, February 07, 2018 8:22 AM
To: zephyr-devel@lists.zephyrproject.org; zephyr-users@...
Subject: [Zephyr-devel] Power Configuration of nrf52840

 

Hello everyone !!! 

I'm working with custom PCB of nrf52840. I need to set VDD voltage which is also GPIO high level voltage equals to 3.3V, otherwise it's 1.8V by default.


How can I configure this? 

or 

How can I access registers of nrf52840 in zephyr architecture?    

 

 

--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

 

Please consider the environment before printing this e-mail or its attachments.

 

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

 


_______________________________________________
Zephyr-users mailing list
Zephyr-users@...ct.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users


Re: [Bluetooth] Is BT 5.0 specific features supported by Zephyr for nRF52840 board yet?

Chettimada, Vinayak Kariappa
 

Hi Anupam,

Your changes to list out the PHY commands as supported is welcome, please send a PR to upstream repo.

Nordic chip do not own any Bluetooth device address space, no public addresses and the device shall use privacy features in all cases.
That said, every chip comes with an unique byte stream hint usable as the identity if required, and Zephyr host+controller combined sample use this entropy as default.
This number can be retrieved for standalone HCI controller using the vendor specific command: BT_HCI_OP_VS_READ_STATIC_ADDRS

Your host can choose to use HCI LE Set Random Address with its chosen address (as your design standards mandate wrt security).

Regards,
Vinayak

On 9 Feb 2018, at 14:30, Anupam Roy <anupam.r@...> wrote:


Hi Cufi,

 Thanks for fast response. With the help of your pointer, now I am able to at-least verify the basic HCI LE 2M PHY commands like - Read PHY, LE Set Default PHY, LE Set PHY

By the way, the reason for the "btmon" tool not being able to list up the 2M PHY commands was probably some checks getting missed out in Bluetooth controller code.

 

After I made following changes, now LE 2M PHY commands are listed out properly.

+++ b/subsys/bluetooth/controller/hci/hci.c
@@ -530,6 +530,15 @@ static void read_supported_commands(struct net_buf *buf, struct net_buf **evt)
        /* LE Enhanced TX Test. */
        rp->commands[36] |= BIT(0);
 #endif /* CONFIG_BT_CTLR_DTM_HCI */
+#if defined(CONFIG_BT_CTLR_PHY)
+       /* LE Read PHY Command. */
+       rp->commands[35] |= BIT(4);
+       /* LE Set Default PHY Command. */
+       rp->commands[35] |= BIT(5);
+       /* LE Set PHY Command. */
+       rp->commands[35] |= BIT(6);
+#endif

 

 

Please share your opinion about the same.

By the way, one issue I am encountering is with Bluetooth public address.

After I run btattach from RPI3 terminal, BT address turns out to be ALL zeroes.

 

 pi@raspberrypi:~ $ sudo hciconfig hci1
hci1: Type: Primary  Bus: UART
 BD Address: 00:00:00:00:00:00  ACL MTU: 27:7  SCO MTU: 0:0
 UP RUNNING 
 RX bytes:1649 acl:36 sco:0 events:89 errors:0
 TX bytes:916 acl:31 sco:0 commands:50 errors:0


 

Any insight to this will be really great. Much thanks.

 

BR,

-Anupam Roy

 

--------- Original Message ---------

Sender : Cufi, Carles <Carles.Cufi@...>

Date : 2018-02-09 05:05 (GMT+9)

Title : RE: [Zephyr-devel] [Bluetooth] Is BT 5.0 specific features supported by Zephyr for nRF52840 board yet?

 
Hi Anupam,

 

All the features you mention are supported on the nRF52840 *except* LE Extended Advertising.
I suggest you take a look at the controller feature list in order to enable/disable particular features. You can do that by editing your prj.conf and adding the missing options.

 

 

LE Extended Advertising will probably come after some additional required refactoring that is going on at the moment.

 

Contributions welcome!

 

Regards,

 

Carles

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Anupam Roy
Sent: 08 February 2018 14:16
To: zephyr-devel@...
Cc: SACHIN DEV SHARMA <sachin.dev@...>
Subject: [Zephyr-devel] [Bluetooth] Is BT 5.0 specific features supported by Zephyr for nRF52840 board yet?

 

Hello Zephyr Developers,

 I am looking for zephyr based application for verifying BT 5.0 specific features like LE Extended Advertising, LE Long Range (2M PHY), LE High Speed (2M PHY) etc. on my nRF52840 PDK board.

Currently, I have compiled samples/bluetooth/hci_uart and burnt the zephyr.hex in nRF52840 PDK board.

However, it does not support BT 5.0 specific features mentioned above. My intention is to use Bluez upstream in my Host PC (RPI3 with Raspbian Distribution) and nRF52840 SOC as my BT controller.

Could someone provide some insights if such support is available somewhere or if not, then when will such support be available?

When I use hciconfig hci1 commands, I get following list of Supported commands in btmon

  HCI Command: Read Local Supported Commands (0x04|0x0002) plen 0                                                                                                                                           #1 [hci1] 17.880862
> HCI Event: Command Complete (0x0e) plen 68                                                                                                                                                                #2 [hci1] 17.882136
      Read Local Supported Commands (0x04|0x0002) ncmd 1
        Status: Success (0x00)
        Commands: 62 entries
          Disconnect (Octet 0 - Bit 5)
          Read Remote Version Information (Octet 2 - Bit 7)
          Set Event Mask (Octet 5 - Bit 6)
          Reset (Octet 5 - Bit 7)
          Read Transmit Power Level (Octet 10 - Bit 2)
          Set Controller To Host Flow Control (Octet 10 - Bit 5)
          Host Buffer Size (Octet 10 - Bit 6)
          Host Number of Completed Packets (Octet 10 - Bit 7)
          Read Local Version Information (Octet 14 - Bit 3)
          Read Local Supported Features (Octet 14 - Bit 5)
          Read BD ADDR (Octet 15 - Bit 1)
          Set Event Mask Page 2 (Octet 22 - Bit 2)
          LE Set Event Mask (Octet 25 - Bit 0)
          LE Read Buffer Size (Octet 25 - Bit 1)
          LE Read Local Supported Features (Octet 25 - Bit 2)
          LE Set Random Address (Octet 25 - Bit 4)
          LE Set Advertising Parameters (Octet 25 - Bit 5)
          LE Read Advertising Channel TX Power (Octet 25 - Bit 6)
          LE Set Advertising Data (Octet 25 - Bit 7)
          LE Set Scan Response Data (Octet 26 - Bit 0)
          LE Set Advertise Enable (Octet 26 - Bit 1)
          LE Set Scan Parameters (Octet 26 - Bit 2)
          LE Set Scan Enable (Octet 26 - Bit 3)
          LE Create Connection (Octet 26 - Bit 4)
          LE Create Connection Cancel (Octet 26 - Bit 5)
          LE Read White List Size (Octet 26 - Bit 6)
          LE Clear White List (Octet 26 - Bit 7)
          LE Add Device To White List (Octet 27 - Bit 0)
          LE Remove Device From White List (Octet 27 - Bit 1)
          LE Connection Update (Octet 27 - Bit 2)
          LE Set Host Channel Classification (Octet 27 - Bit 3)
          LE Read Channel Map (Octet 27 - Bit 4)
          LE Read Remote Used Features (Octet 27 - Bit 5)
          LE Encrypt (Octet 27 - Bit 6)
          LE Rand (Octet 27 - Bit 7)
          LE Start Encryption (Octet 28 - Bit 0)
          LE Long Term Key Request Reply (Octet 28 - Bit 1)
          LE Long Term Key Request Neg Reply (Octet 28 - Bit 2)
          LE Read Supported States (Octet 28 - Bit 3)
          LE Receiver Test (Octet 28 - Bit 4)
          LE Transmitter Test (Octet 28 - Bit 5)
          LE Test End (Octet 28 - Bit 6)
          Read Authenticated Payload Timeout (Octet 32 - Bit 4)
          Write Authenticated Payload Timeout (Octet 32 - Bit 5)
          LE Remote Connection Parameter Request Reply (Octet 33 - Bit 4)
          LE Remote Connection Parameter Request Negative Reply (Octet 33 - Bit 5)
          LE Set Data Length (Octet 33 - Bit 6)
          LE Read Suggested Default Data Length (Octet 33 - Bit 7)
          LE Write Suggested Default Data Length (Octet 34 - Bit 0)
          LE Add Device To Resolving List (Octet 34 - Bit 3)
          LE Remove Device From Resolving List (Octet 34 - Bit 4)
          LE Clear Resolving List (Octet 34 - Bit 5)
          LE Read Resolving List Size (Octet 34 - Bit 6)
          LE Read Peer Resolvable Address (Octet 34 - Bit 7)
          LE Read Local Resolvable Address (Octet 35 - Bit 0)
          LE Set Address Resolution Enable (Octet 35 - Bit 1)
          LE Set Resolvable Private Address Timeout (Octet 35 - Bit 2)
          LE Read Maximum Data Length (Octet 35 - Bit 3)
          LE Enhanced Receiver Test (Octet 35 - Bit 7)
          LE Enhanced Transmitter Test (Octet 36 - Bit 0)
          LE Read Transmit Power (Octet 38 - Bit 7)
          LE Set Privacy Mode (Octet 39 - Bit 2)
@ RAW Close: hciconfig                                                                                                                                                                                {0x0006} [hci1] 17.886419
@ RAW Close: hciconfig

 
BR,

-Anupam Roy

BR,

-Anupam Roy

 

<Mail Attachment.gif>

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


Re: Bluetooth Mesh Advertisement issues

Chettimada, Vinayak Kariappa
 

Hi Paul,

I do not have visibility to your code, in terms of how you are starting the advertisements, if you stop and start them too close you will see the behaviour as you observed. 
As I cannot infer from your image that the interval being 7-8ms with just 2 event, please send me a longer capture.

Regards,
Vinayak

On 9 Feb 2018, at 15:48, Gavrikov Paul <Paul.Gavrikov@...> wrote:

Also I just checked and the same happens with SoftDevice 132 – am I measuring something wrong?
 
Von: Gavrikov Paul 
Gesendet: Freitag, 9. Februar 2018 15:43
An: 'Chettimada, Vinayak Kariappa' <vinayak.kariappa.chettimada@...>; zephyr-devel@...
Betreff: AW: Bluetooth Mesh Advertisement issues
 
I measured the time between two starting points like here: https://ibb.co/dqa5Ox
 
Code:
               struct bt_le_adv_param param;
               param.options = 0;
               param.interval_min = ADV_INT(K_MSEC(20));
               param.interval_max = param.interval_min;
               param.own_addr = NULL;
               int err = bt_le_adv_start(&param, ad, ARRAY_SIZE(ad), NULL, 0);
 
Von: Chettimada, Vinayak Kariappa [mailto:vinayak.kariappa.chettimada@...] 
Gesendet: Freitag, 9. Februar 2018 15:32
An: Gavrikov Paul <Paul.Gavrikov@...>; zephyr-devel@...
Betreff: RE: Bluetooth Mesh Advertisement issues
 
1.      Advertising Interval too short and out of spec: Sometimes the interval between 2 transmits of the Friend Poll is under 20ms (even tho it is set to 20ms). I measured intervals of just 7ms.
[vich]  Are you sure this not due to a close stop to start sequence? Do you see 7 ms intervals or one-off 7 ms spacing?


Re: [Zephyr-users] Power Configuration of nrf52840

Chettimada, Vinayak Kariappa
 

Hope you are doing it “only once per board’s life time” else you could be degrading the flash. Hence, my advice is to use nrfjprog to make the change "only once" per each board or use the design in soc.c wherein the value is first compared before writing.

-Vinayak

On 9 Feb 2018, at 07:20, ashish.shukla@... wrote:

Thanks everyone !!!

Adding these lines does the job. 

 NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    }

    NRF_UICR->EXTSUPPLY = 0x01;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    } 

    NRF_UICR->REGOUT0 = 0x05;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy){
    }

    NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren;
    while (NRF_NVMC->READY == NVMC_READY_READY_Busy)
    {
    }


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Thu, Feb 8, 2018 at 12:17 AM, Vinayak Kariappa <vinayak.kariappa@...> wrote:
Hi Ashish,

UICR is Flash, you need to do something similar to in soc.c done for reset pin config. Or use nrfjprog to write values to UICR


On 7 Feb 2018, at 12:04, "ashish.shukla@..." <ashish.shukla@...> wrote:

Hi,

Yes, I'm working in high voltage mode.  VDDH = 3.6V 

Then, I added following lines 

NRF_POWER->DCDCEN0 = 0x01;  // Enabling DC/DC for stage REG0
NRF_POWER->DCDCEN = 0x01;   // Enabling DC/DC for stage REG1 

Again, as you suggested 

NRF_UICR->EXTSUPPLY = 0x01;  
NRF_UICR->REGOUT0 = 0x05;

After adding these lines at starting of main() function, It still measures 1.8V. 


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Wed, Feb 7, 2018 at 4:16 PM, Puzdrowski, Andrzej <Andrzej.Puzdrowski@nordicsemi.no> wrote:

Hi

So you must have supplied nRF52840 from VDDH pin – so it power regulator circuit works in high voltage mode.

 

Then internal regulator generate the GPIO output voltage:

You need to set UICR->REGOUT0 properly, 5 is proper value for select 3.3 V

 

For more info see nRF52840 OPS, especjali POWER chapter

 

Andrzej

 

From: zephyr-devel-bounces@...hyrproject.org [mailto:zephyr-devel-bounces@lists.zephyrproject.org] On Behalf Of ashish.shukla@...
Sent: Wednesday, February 07, 2018 8:22 AM
To: zephyr-devel@...ct.org; zephyr-users@...ct.org
Subject: [Zephyr-devel] Power Configuration of nrf52840

 

Hello everyone !!! 

I'm working with custom PCB of nrf52840. I need to set VDD voltage which is also GPIO high level voltage equals to 3.3V, otherwise it's 1.8V by default.


How can I configure this? 

or 

How can I access registers of nrf52840 in zephyr architecture?    

 

 

--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

 

Please consider the environment before printing this e-mail or its attachments.

 

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

 


_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


Re: Bluetooth Mesh Advertisement issues

Gavrikov Paul <Paul.Gavrikov@...>
 

Also I just checked and the same happens with SoftDevice 132 – am I measuring something wrong?

 

Von: Gavrikov Paul
Gesendet: Freitag, 9. Februar 2018 15:43
An: 'Chettimada, Vinayak Kariappa' <vinayak.kariappa.chettimada@...>; zephyr-devel@...
Betreff: AW: Bluetooth Mesh Advertisement issues

 

I measured the time between two starting points like here: https://ibb.co/dqa5Ox

 

Code:

               struct bt_le_adv_param param;

               param.options = 0;

               param.interval_min = ADV_INT(K_MSEC(20));

               param.interval_max = param.interval_min;

               param.own_addr = NULL;

               int err = bt_le_adv_start(&param, ad, ARRAY_SIZE(ad), NULL, 0);

 

Von: Chettimada, Vinayak Kariappa [mailto:vinayak.kariappa.chettimada@...]
Gesendet: Freitag, 9. Februar 2018 15:32
An: Gavrikov Paul <Paul.Gavrikov@...>; zephyr-devel@...
Betreff: RE: Bluetooth Mesh Advertisement issues

 

1.      Advertising Interval too short and out of spec: Sometimes the interval between 2 transmits of the Friend Poll is under 20ms (even tho it is set to 20ms). I measured intervals of just 7ms.

[vich]  Are you sure this not due to a close stop to start sequence? Do you see 7 ms intervals or one-off 7 ms spacing?


Re: Bluetooth Mesh Advertisement issues

Gavrikov Paul <Paul.Gavrikov@...>
 

I measured the time between two starting points like here: https://ibb.co/dqa5Ox

 

Code:

               struct bt_le_adv_param param;

               param.options = 0;

               param.interval_min = ADV_INT(K_MSEC(20));

               param.interval_max = param.interval_min;

               param.own_addr = NULL;

               int err = bt_le_adv_start(&param, ad, ARRAY_SIZE(ad), NULL, 0);

 

Von: Chettimada, Vinayak Kariappa [mailto:vinayak.kariappa.chettimada@...]
Gesendet: Freitag, 9. Februar 2018 15:32
An: Gavrikov Paul <Paul.Gavrikov@...>; zephyr-devel@...
Betreff: RE: Bluetooth Mesh Advertisement issues

 

1.      Advertising Interval too short and out of spec: Sometimes the interval between 2 transmits of the Friend Poll is under 20ms (even tho it is set to 20ms). I measured intervals of just 7ms.

[vich]  Are you sure this not due to a close stop to start sequence? Do you see 7 ms intervals or one-off 7 ms spacing?


Re: Bluetooth Mesh Advertisement issues

Chettimada, Vinayak Kariappa
 

1.       Advertising Interval too short and out of spec: Sometimes the interval between 2 transmits of the Friend Poll is under 20ms (even tho it is set to 20ms). I measured intervals of just 7ms.

[vich]  Are you sure this not due to a close stop to start sequence? Do you see 7 ms intervals or one-off 7 ms spacing?


Re: Bluetooth Mesh Advertisement issues

Gavrikov Paul <Paul.Gavrikov@...>
 

Hi Johan,

I rechecked and indeed it is a controller issue. Even without mesh I see this behavior. However I can only test it on the nRF52-DK. Not sure how other boards behave.

And I totally agree with your comments on adv.c -- my code was more of a quick sketch.

Best,
Paul

-----Ursprüngliche Nachricht-----
Von: Johan Hedberg [mailto:johan.hedberg@intel.com]
Gesendet: Freitag, 9. Februar 2018 14:46
An: Gavrikov Paul <Paul.Gavrikov@newtec.de>
Cc: zephyr-devel@lists.zephyrproject.org
Betreff: Re: [Zephyr-devel] Bluetooth Mesh Advertisement issues

Hi Paul,

On Fri, Feb 09, 2018, Gavrikov Paul wrote:
I believe I've found 2 issues in the BLE Mesh implementation - could
someone check on that? The following measurements were done with a
Friend Poll at the LPN (nRF52-PCA10040).

1. Advertising Interval too short and out of spec: Sometimes the
interval between 2 transmits of the Friend Poll is under 20ms (even
tho it is set to 20ms). I measured intervals of just 7ms.
Are you saying the controller doesn't seem to do what it's directed to do through HCI? We'd need the controller folks to comment on that then.

2. Too many advertisements are sent in mesh. This is most likely
due to the way it is implemented: Instead of having a method that
sends a specific amount of advertisements, the advertisement is
started and a timer stops it after 30ms * transmits. I understand that
the 30ms are done to be sure of sending all advertisements out (20ms
Interval + 0..10ms delay), however this can lead to unnecessary
transmission of advertisements. A fix would be to re-implement
advertising for mesh, like so:

void adv(bt_data ad, int count)
{
struct bt_le_adv_param param;
param.options = 0;
param.interval_min = ADV_INT(K_MSEC(1000)); // pick high to prevent regular transmission
param.interval_max = param.interval_min;
param.own_addr = NULL;

int err;
for(int i = 0; i < count; i++) {
err = bt_le_adv_start(&param, ad, ARRAY_SIZE(ad), NULL, 0);
if (err) {
printk("error starting adv: %d, i: %d", err, i);
return;
}
k_sleep(10); // give advertiser a chance to send the advertisement
bt_le_adv_stop();
k_sleep(10);
k_sleep(sys_rand32_get() % 11); // wait random time between 0 and 10ms
}
}
This might work, but it looks quite complicated to me. The current adv.c logic tries to push as much as possible of the scheduling to the controller side, since in many ways (but not accurately) the mesh transmission behavior can be mapped to the advertising interval and the
0-10 ms random delay (called advDelay in the Link Layer spec) between advertising events.

That said, we're well aware that standard HCI makes mesh transmissions quite awkward and inaccurate. For this purpose there's a Mesh HCI vendor extension on its way that will allow the host to do accurate control of the advertising bearer, even for the tightest possible timings that you can theoretically configure a Friendship to. There's an initial PR for the controller side implementation here:

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

Once the PR matures a bit more I'll start adding code to the host side
(adv.c) to take advantage of it.

Johan


Re: Bluetooth Mesh Advertisement issues

Johan Hedberg
 

Hi Paul,

On Fri, Feb 09, 2018, Gavrikov Paul wrote:
I believe I've found 2 issues in the BLE Mesh implementation - could
someone check on that? The following measurements were done with a
Friend Poll at the LPN (nRF52-PCA10040).

1. Advertising Interval too short and out of spec: Sometimes the
interval between 2 transmits of the Friend Poll is under 20ms (even
tho it is set to 20ms). I measured intervals of just 7ms.
Are you saying the controller doesn't seem to do what it's directed to
do through HCI? We'd need the controller folks to comment on that then.

2. Too many advertisements are sent in mesh. This is most likely
due to the way it is implemented: Instead of having a method that
sends a specific amount of advertisements, the advertisement is
started and a timer stops it after 30ms * transmits. I understand that
the 30ms are done to be sure of sending all advertisements out (20ms
Interval + 0..10ms delay), however this can lead to unnecessary
transmission of advertisements. A fix would be to re-implement
advertising for mesh, like so:

void adv(bt_data ad, int count)
{
struct bt_le_adv_param param;
param.options = 0;
param.interval_min = ADV_INT(K_MSEC(1000)); // pick high to prevent regular transmission
param.interval_max = param.interval_min;
param.own_addr = NULL;

int err;
for(int i = 0; i < count; i++) {
err = bt_le_adv_start(&param, ad, ARRAY_SIZE(ad), NULL, 0);
if (err) {
printk("error starting adv: %d, i: %d", err, i);
return;
}
k_sleep(10); // give advertiser a chance to send the advertisement
bt_le_adv_stop();
k_sleep(10);
k_sleep(sys_rand32_get() % 11); // wait random time between 0 and 10ms
}
}
This might work, but it looks quite complicated to me. The current adv.c
logic tries to push as much as possible of the scheduling to the
controller side, since in many ways (but not accurately) the mesh
transmission behavior can be mapped to the advertising interval and the
0-10 ms random delay (called advDelay in the Link Layer spec) between
advertising events.

That said, we're well aware that standard HCI makes mesh transmissions
quite awkward and inaccurate. For this purpose there's a Mesh HCI vendor
extension on its way that will allow the host to do accurate control of
the advertising bearer, even for the tightest possible timings that you
can theoretically configure a Friendship to. There's an initial PR for
the controller side implementation here:

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

Once the PR matures a bit more I'll start adding code to the host side
(adv.c) to take advantage of it.

Johan


Re: [Bluetooth] Is BT 5.0 specific features supported by Zephyr for nRF52840 board yet?

Anupam Roy
 

Hi Cufi,

 Thanks for fast response. With the help of your pointer, now I am able to at-least verify the basic HCI LE 2M PHY commands like - Read PHY, LE Set Default PHY, LE Set PHY

By the way, the reason for the "btmon" tool not being able to list up the 2M PHY commands was probably some checks getting missed out in Bluetooth controller code.

 

After I made following changes, now LE 2M PHY commands are listed out properly.

+++ b/subsys/bluetooth/controller/hci/hci.c
@@ -530,6 +530,15 @@ static void read_supported_commands(struct net_buf *buf, struct net_buf **evt)
        /* LE Enhanced TX Test. */
        rp->commands[36] |= BIT(0);
 #endif /* CONFIG_BT_CTLR_DTM_HCI */
+#if defined(CONFIG_BT_CTLR_PHY)
+       /* LE Read PHY Command. */
+       rp->commands[35] |= BIT(4);
+       /* LE Set Default PHY Command. */
+       rp->commands[35] |= BIT(5);
+       /* LE Set PHY Command. */
+       rp->commands[35] |= BIT(6);
+#endif

 

 

Please share your opinion about the same.

By the way, one issue I am encountering is with Bluetooth public address.

After I run btattach from RPI3 terminal, BT address turns out to be ALL zeroes.

 

 pi@raspberrypi:~ $ sudo hciconfig hci1
hci1: Type: Primary  Bus: UART
 BD Address: 00:00:00:00:00:00  ACL MTU: 27:7  SCO MTU: 0:0
 UP RUNNING
 RX bytes:1649 acl:36 sco:0 events:89 errors:0
 TX bytes:916 acl:31 sco:0 commands:50 errors:0

 

Any insight to this will be really great. Much thanks.

 

BR,

-Anupam Roy

 

--------- Original Message ---------

Sender : Cufi, Carles <Carles.Cufi@...>

Date : 2018-02-09 05:05 (GMT+9)

Title : RE: [Zephyr-devel] [Bluetooth] Is BT 5.0 specific features supported by Zephyr for nRF52840 board yet?

 

Hi Anupam,

 

All the features you mention are supported on the nRF52840 *except* LE Extended Advertising.

I suggest you take a look at the controller feature list in order to enable/disable particular features. You can do that by editing your prj.conf and adding the missing options.

 

https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/bluetooth/controller/Kconfig#L252

https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/bluetooth/controller/Kconfig#L252

https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/bluetooth/controller/Kconfig#L267

 

LE Extended Advertising will probably come after some additional required refactoring that is going on at the moment.

 

Contributions welcome!

 

Regards,

 

Carles

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Anupam Roy
Sent: 08 February 2018 14:16
To: zephyr-devel@...
Cc: SACHIN DEV SHARMA <sachin.dev@...>
Subject: [Zephyr-devel] [Bluetooth] Is BT 5.0 specific features supported by Zephyr for nRF52840 board yet?

 

Hello Zephyr Developers,

 I am looking for zephyr based application for verifying BT 5.0 specific features like LE Extended Advertising, LE Long Range (2M PHY), LE High Speed (2M PHY) etc. on my nRF52840 PDK board.

Currently, I have compiled samples/bluetooth/hci_uart and burnt the zephyr.hex in nRF52840 PDK board.

However, it does not support BT 5.0 specific features mentioned above. My intention is to use Bluez upstream in my Host PC (RPI3 with Raspbian Distribution) and nRF52840 SOC as my BT controller.

Could someone provide some insights if such support is available somewhere or if not, then when will such support be available?

When I use hciconfig hci1 commands, I get following list of Supported commands in btmon

  HCI Command: Read Local Supported Commands (0x04|0x0002) plen 0                                                                                                                                           #1 [hci1] 17.880862
> HCI Event: Command Complete (0x0e) plen 68                                                                                                                                                                #2 [hci1] 17.882136
      Read Local Supported Commands (0x04|0x0002) ncmd 1
        Status: Success (0x00)
        Commands: 62 entries
          Disconnect (Octet 0 - Bit 5)
          Read Remote Version Information (Octet 2 - Bit 7)
          Set Event Mask (Octet 5 - Bit 6)
          Reset (Octet 5 - Bit 7)
          Read Transmit Power Level (Octet 10 - Bit 2)
          Set Controller To Host Flow Control (Octet 10 - Bit 5)
          Host Buffer Size (Octet 10 - Bit 6)
          Host Number of Completed Packets (Octet 10 - Bit 7)
          Read Local Version Information (Octet 14 - Bit 3)
          Read Local Supported Features (Octet 14 - Bit 5)
          Read BD ADDR (Octet 15 - Bit 1)
          Set Event Mask Page 2 (Octet 22 - Bit 2)
          LE Set Event Mask (Octet 25 - Bit 0)
          LE Read Buffer Size (Octet 25 - Bit 1)
          LE Read Local Supported Features (Octet 25 - Bit 2)
          LE Set Random Address (Octet 25 - Bit 4)
          LE Set Advertising Parameters (Octet 25 - Bit 5)
          LE Read Advertising Channel TX Power (Octet 25 - Bit 6)
          LE Set Advertising Data (Octet 25 - Bit 7)
          LE Set Scan Response Data (Octet 26 - Bit 0)
          LE Set Advertise Enable (Octet 26 - Bit 1)
          LE Set Scan Parameters (Octet 26 - Bit 2)
          LE Set Scan Enable (Octet 26 - Bit 3)
          LE Create Connection (Octet 26 - Bit 4)
          LE Create Connection Cancel (Octet 26 - Bit 5)
          LE Read White List Size (Octet 26 - Bit 6)
          LE Clear White List (Octet 26 - Bit 7)
          LE Add Device To White List (Octet 27 - Bit 0)
          LE Remove Device From White List (Octet 27 - Bit 1)
          LE Connection Update (Octet 27 - Bit 2)
          LE Set Host Channel Classification (Octet 27 - Bit 3)
          LE Read Channel Map (Octet 27 - Bit 4)
          LE Read Remote Used Features (Octet 27 - Bit 5)
          LE Encrypt (Octet 27 - Bit 6)
          LE Rand (Octet 27 - Bit 7)
          LE Start Encryption (Octet 28 - Bit 0)
          LE Long Term Key Request Reply (Octet 28 - Bit 1)
          LE Long Term Key Request Neg Reply (Octet 28 - Bit 2)
          LE Read Supported States (Octet 28 - Bit 3)
          LE Receiver Test (Octet 28 - Bit 4)
          LE Transmitter Test (Octet 28 - Bit 5)
          LE Test End (Octet 28 - Bit 6)
          Read Authenticated Payload Timeout (Octet 32 - Bit 4)
          Write Authenticated Payload Timeout (Octet 32 - Bit 5)
          LE Remote Connection Parameter Request Reply (Octet 33 - Bit 4)
          LE Remote Connection Parameter Request Negative Reply (Octet 33 - Bit 5)
          LE Set Data Length (Octet 33 - Bit 6)
          LE Read Suggested Default Data Length (Octet 33 - Bit 7)
          LE Write Suggested Default Data Length (Octet 34 - Bit 0)
          LE Add Device To Resolving List (Octet 34 - Bit 3)
          LE Remove Device From Resolving List (Octet 34 - Bit 4)
          LE Clear Resolving List (Octet 34 - Bit 5)
          LE Read Resolving List Size (Octet 34 - Bit 6)
          LE Read Peer Resolvable Address (Octet 34 - Bit 7)
          LE Read Local Resolvable Address (Octet 35 - Bit 0)
          LE Set Address Resolution Enable (Octet 35 - Bit 1)
          LE Set Resolvable Private Address Timeout (Octet 35 - Bit 2)
          LE Read Maximum Data Length (Octet 35 - Bit 3)
          LE Enhanced Receiver Test (Octet 35 - Bit 7)
          LE Enhanced Transmitter Test (Octet 36 - Bit 0)
          LE Read Transmit Power (Octet 38 - Bit 7)
          LE Set Privacy Mode (Octet 39 - Bit 2)
@ RAW Close: hciconfig                                                                                                                                                                                {0x0006} [hci1] 17.886419
@ RAW Close: hciconfig

 

BR,

-Anupam Roy

 

BR,

-Anupam Roy

 



Bluetooth Mesh Advertisement issues

Gavrikov Paul <Paul.Gavrikov@...>
 

Hi again,

 

I believe I’ve found 2  issues in the BLE Mesh implementation – could someone check on that? The following measurements were done with a Friend Poll at the LPN (nRF52-PCA10040).

 

1.      Advertising Interval too short and out of spec: Sometimes the interval between 2 transmits of the Friend Poll is under 20ms (even tho it is set to 20ms). I measured intervals of just 7ms.

2.      Too many advertisements are sent in mesh. This is most likely due to the way it is implemented: Instead of having a method that sends a specific amount of advertisements, the advertisement is started and a timer stops it after 30ms * transmits. I understand that the 30ms are done to be sure of sending all advertisements out (20ms Interval + 0..10ms delay), however this can lead to unnecessary transmission of advertisements. A fix would be to re-implement advertising for mesh, like so:

 

void adv(bt_data ad, int count)

{

               struct bt_le_adv_param param;

               param.options = 0;

               param.interval_min = ADV_INT(K_MSEC(1000)); // pick high to prevent regular transmission

               param.interval_max = param.interval_min;

               param.own_addr = NULL;

              

               int err;

               for(int i = 0; i < count; i++) {

                              err = bt_le_adv_start(&param, ad, ARRAY_SIZE(ad), NULL, 0);

                              if (err) {

                                            printk("error starting adv: %d, i: %d", err, i);

                                            return;

                              }

                              k_sleep(10); // give advertiser a chance to send the advertisement

                              bt_le_adv_stop();

                              k_sleep(10);

                              k_sleep(sys_rand32_get() % 11); // wait random time between 0 and 10ms

               }

}

 

Best,

Paul Gavrikov

 

eMail: Paul.Gavrikov@...

web:  www.newtec.de

 

NewTec GmbH

Heinrich-von-Stephan-Straße 8

D-79100 Freiburg

Geschäftsführer: Johannes Werbach, Harald Molle, Ulrich Schwer, Michael Tröscher Registergericht Memmingen - HRB 7236 USt.-IdNr. DE130850199

 


Re: (#BluetoothMesh) just binding APP-key allow SRV to process the message

Vikrant More <vikrant8051@...>
 

I'm still waiting for reply.
Is it bug or I'm doing something wrong ?

On Wed, Feb 7, 2018 at 5:47 AM, <alan@...> wrote:



Tarry,

here is the Bluwtooth Mesh programers group.

Alan



On 2018-02-06 02:58, Vikrant More wrote:
Using #meshctl I gave following commands to BOARD_1

appkey-add 1

bind 0 1 1000
bind 0 1 1001
bind 0 1 1002
bind 0 1 1003

sub-add 0100 c000 1000
sub-add 0100 c001 1000

pub-set 0100 c000 1 0 5 1001

sub-add 0100 c000 1002
pub-set 0100 c000 1 0 5 1003

--------------------------------------------------------------------------------------------------

Using #meshctl I gave following commands to BOARD_2

appkey-add 1

bind 0 1 1000
bind 0 1 1001
bind 0 1 1002
bind 0 1 1003

sub-add 0101 c000 1000              //in last email I by mistake wrote
0100 instead of 0101, but main Question is as it is.
pub-set 0101 c001 1 0 5 1001
------------------------------------------------------------------------------------------------------

I've hard coded 4 Models, viz,

GEN_ONOFF_SRV

GEN_ONOFF_CLI

GEN_LEVEL_SRV

GEN_LEVEL_CLI

on both boards.

I found something wrong in case of BOARD_2,

where I only bound APP_KEY to all available models but didn't

assign any SUB or PUB addresses to  GEN_LEVEL_SRV or  GEN_LEVEL_CLI

even after that BOARD_2 is processing data publish by GEN_LEVEL_CLIENT
of BOARD_1.

Have anybody noticed it ?
_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...ct.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


Re: Bluetooth Mesh: Bad values for continuous scan

Gavrikov Paul <Paul.Gavrikov@...>
 

Hi Vinayak,

 

I re-ran my analysis with 0x4, 0x10, 0x100 and 0x4000 values (continuous scan, 1000 sent advertisements, re run 3x).

I do see an improvement of roughly 5% for 0x10. A very slight improvement for 0x100 – but it was very good before anyway.

Interestingly 0x4 is now performing worse with a drop rate of 41% (before 32%). Also 0x4000 dropped 19% of advertisements which seems very weird (before under 1%).  

 

Best,
Paul

Von: Chettimada, Vinayak Kariappa [mailto:vinayak.kariappa.chettimada@...]
Gesendet: Mittwoch, 7. Februar 2018 11:37
An: Gavrikov Paul <Paul.Gavrikov@...>
Cc: zephyr-devel@...; Johan Hedberg <johan.hedberg@...>
Betreff: RE: [Zephyr-devel] Bluetooth Mesh: Bad values for continuous scan

 

Hi Paul,

 

FYI. The below two PRs should be merged soon into upstream master, could you please re-run your analysis and let me know if there has been any improvement?

 

Improved radio utilization in continuous scanning:

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

 

And, fixed a bug that prevented advertising while in continuous scanning with 2 second window:

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

 

Thanks in advance.

 

-Vinayak

 

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Chettimada, Vinayak Kariappa
Sent: Thursday, February 01, 2018 9:14 PM
To: Johan Hedberg <johan.hedberg@...>
Cc: Gavrikov Paul <Paul.Gavrikov@...>; zephyr-devel@...
Subject: Re: [Zephyr-devel] Bluetooth Mesh: Bad values for continuous scan

 

Every event has a 1.5ms preparation/idling, hence you are right 1.5ms of 10ms or 15% missed adv reports.

 

The reason for 10ms was to reduce the radio idling when advertising event would overlap in time with scan window,

in such cases scan will only resume every 10ms.

Imagine if using a scan interval and window of 2 seconds, and it where to be skipped due to a advertising event of mere 3 ms.

I am working on a newer architecture that would increase radio utilisation significantly, but its going to take sometime until I finish porting everything.

 

That said, there is an advanced Kconfig option CONFIG_BT_CTLR_XTAL_THRESHOLD

you can increase this to above 10 ms so that the 1.5ms idling reduces dynamically down, reducing the miss percentage down.

 

Also, there is a controller bug, which I will fix soon. If the scan window is more than twice the advertising interval, the controller asserts.

 

-Vinayak

 

On 1 Feb 2018, at 18:15, Johan Hedberg <johan.hedberg@...> wrote:

 

Hi Paul,

On Thu, Feb 01, 2018, Gavrikov Paul wrote:

the default MESH_SCAN_INTERVAL and MESH_SCAN_WINDOW
(/subsys/bluetooth/host/mesh/adv.c) are both set to 0x10, thus
enabling a continuous scan which switches the channel every 10ms.
However as you may know, most radios can't switch channels immediately
and thus cause a delay period in which no advertisement can be
detected. (see e.g.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5375785/).
I did some experiments with a Nordic Semicon nRF52-PCA100400 and saw
that with the default Zephyr values I miss 15% of all advertisements
in an almost inactive radio environment.  Increasing
MESH_SCAN_INTERVAL to 0x100 (i.e. 160ms) results in 1.5%, 0x4000 (the
max)  <0.5% miss rate. (Measurement: Sending 5x 1000 advertisements
with 20ms interval).

Thus I'd propose increasing these values or exposing them to config.


Thanks for analyzing this. I picked 0x10 after consulting with the
Nordic Semiconductor engineers who are behind Zephyr's controller
implementation. I'll let them comment before doing the change.

Johan
_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

4201 - 4220 of 8335