Date   

Zephyr BLE Device pairing

Vikrant More <vikrant8051@...>
 

Hello, 


I wanna do pairing of my nrf52840-PDK based BLE device (with nRF Blinky Service) with smartphone using method describe in above video link. 

How to achieve it, so that as soon as PDK receive pairing request from smartphone onboard Led4 should turn ON and by just pressing Button4 it should paired with smartphone ?

Plus Device should go in pairing mode only after pressing Button3 on PDK board.

Is this possible, with available Zephyr Bluetooth APIs ?

In this method, is distance between Device & smartphone matter ?

Is it secure method ?

Thank You !!


How to make Zephyr Based BLE device'd MAC address static ?

Vikrant More <vikrant8051@...>
 

Hello,

Using available Zephyr Bluetooth APIs, I've develop BLE Device which is compatible with Nordic Blinky App. I'm doing testing on nrf52840-PDK board.

But after every reset, it's MAC address gets changed with random one. How to make it static, so that no need of pairing with smartphone again & again ?

How to take control of pairing key, instead of generating random one ?

Thank You !!


Installing matrix library in c in zephyr

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi everyone,

I've to work with matrix operations, It's difficult to write my own functions correctly.

Can someone suggest some workaround for the same?

Is it possible to compile python code along with c ?

--
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


Re: Which cloud service zephyr already supported?

Carles Cufi
 

Hi Aaron,

 

I recommend talking to Open Source Foundries, who have integrated cloud services with Zephyr.

 

I have copied Martí from OSF.

 

Regards,

 

Carles

 

From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Aaron Xu
Sent: 13 February 2018 09:53
To: zephyr-devel@...
Subject: [Zephyr-devel] Which cloud service zephyr already supported?

 

Hi,

 

I want to upload some sensors data, like temperature/humidity/pressure and so on, upstream to cloud.

I am wonder that is there any example to show how to do it?

 

 

Regards,

Aaron


Re: [Zephyr-users] Securing BLE device Services & Characteristics from unauthorized user

Luiz Augusto von Dentz
 

Hi Vikrant,

On Mon, Feb 12, 2018 at 2:34 PM, Vikrant More <vikrant8051@gmail.com> wrote:
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 ?
You will have to add a service containing the characteristic which
probably comes from a different application than the 'normal' mode,
now regarding the AES key exchange I don't think that would be secure
enough so you might as well just add a characteristic that requires
encryption and then once the app attempts to write triggers pairing,
if that manages to create a valid key and write is complete, it can be
any value really since it will be protected by having to pair, then
you can restart on normal mode.


Thanks !!




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


--
Luiz Augusto von Dentz


Which cloud service zephyr already supported?

Aaron Xu
 

Hi,

I want to upload some sensors data, like temperature/humidity/pressure and so on, upstream to cloud.
I am wonder that is there any example to show how to do it?


Regards,
Aaron


[ #BluetoothMesh ] possible Bug .. without assigning subscription address to Model, it is reacting to subscription address assign to other Model #bluetoothmesh

Vikrant More <vikrant8051@...>
 

Hello World !!

This is observation based on following configuration done by #meshctl.
Two nRF52840-PDK boards has been used for it.

For Board 1. after provisioning, I used following commands to configure it
**************************************************************************************

appkey-add 1

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

sub-add 0100 c000 1000
pub-set 0100 c000 1 0 5 1001

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


For Board 2. after provisioning, I used following commands to configure it
**************************************************************************************

appkey-add 1

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

sub-add 0101 c000 1000
pub-set 0101 c000 1 0 5 1001

In case of Board 2, I didn't assign pub & sub addresses to Models 1002 & 1003

**************************************************************************************

Button 1 & 2 are related to GEN_ONOFF_CLIENT
Button 3 & 4 are related to GEN_LEVEL_CLIENT

As per my implementation,
1. if Button 1 is pressed, then LED1 on all Boards turns ON.

2. if Button 2 is pressed, then LED1 on all Boards turns OFF.

3.if Button 3 is pressed, then it publishes value for eg. 2000.
   On subscriber side, it checks that value (since it is less than 10000 it turns ON LED3 & turns OFF LED4 )

4. if Button 4 is pressed, then it publishes value for eg. 15000.
   On subscriber side, it checks that value (since it is greater than 10000 it turns OFF LED 3 & turns ON LED4)

******************************************************************************************

Ideally, as per #meshctl configuration,

if I pressed Button1 on any board, then LED1 on all boards should turn ON & if pressed
pressed Button2 then LED1 should OFF.

And if I pressed Button3 or Button4 on Board1, it should affect LED3&4 only on Board1(self).

And if I pressed Button3 or Button4 on Board2, it should not affect LEDs on any Board.

********************************************************************************************

But here, I found strange behavior in case of Board2. Here without assigning subscription
addresses to Model 1002, LED 3 & LED 4 on Board2 are reacting as soon as I pressed
Button 3&4 on Board 1.


Is it Bug ?

Thank You !!


[ #BluetoothMesh ] possible Bug .. without assigning subscription address to Model, it is reacting to subscription address assign to other Model #bluetoothmesh

Vikrant More <vikrant8051@...>
 

This is observation based on following configuration done by #meshctl.
Two nRF52840-PDK boards has been used for it.

For Board 1. after provisioning, I used following commands to configure it
**************************************************************************************

appkey-add 1

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

sub-add 0100 c000 1000
pub-set 0100 c000 1 0 5 1001

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


For Board 2. after provisioning, I used following commands to configure it
**************************************************************************************

appkey-add 1

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

sub-add 0100 c000 1000
pub-set 0100 c000 1 0 5 1001

In case of Board 2, I didn't assign pub & sub addresses to Models 1002 & 1003

**************************************************************************************

Button 1 & 2 are related to GEN_ONOFF_CLIENT
Button 3 & 4 are related to GEN_LEVEL_CLIENT

As per my coding,
1. if Button 1 is pressed, then LED1 on all Boards turns ON.

2. if Button 2 is pressed, then LED1 on all Boards turns OFF.

3.if Button 3 is pressed, then it publishes value for eg. 2000.
   On subscriber side, it checks that value (since it is less than 10000 it turns ON LED3 & turns OFF LED4 )

4. if Button 4 is pressed, then it publishes value for eg. 15000.
   On subscriber side, it checks that value (since it is greater than 10000 it turns OFF LED 3 & turns ON LED4)

******************************************************************************************

Ideally, as per #meshctl configuration,

if I pressed Button1 on any board, then LED1 on all boards should turn ON & if pressed
pressed Button2 then LED1 should OFF.

And if I pressed Button3 or Button4 on Board1, it should affect LED3&4 on only self Board.

And if I pressed Button3 or Button4 on Board2, it should not affect LEDs on any Board.

********************************************************************************************

But here, I found strange behavior in case of Board2. Here without assigning subscription
addresses to Model 1002, LED 3 & LED 4 on Board 2 are reacting as soon as I pressed
Button 3&4 on Board 1. 

 


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?

3961 - 3980 of 8103