Date   

Re: What information shall be persistent to restore BLE bond after power cycling?

Li, Jun R
 

Hi Vikrant,

Thanks for help! Yes, I did the same thing in my project, but still was not lucky to get it connected to my iPhone after its power cycling, unless I get iPhone to forget my device firstly.

 

What exact information will be stored for restoring the secured bonding to a phone?

 

Regards,

Jun

 

 

From: Vikrant More <vikrant8051@...>
Date: Monday, June 11, 2018 at 23:30
To: Jun Li <jun.r.li@...>
Cc: "devel@..." <devel@...>
Subject: Re: [Zephyr-devel] What information shall be persistent to restore BLE bond after power cycling?

 

Hi Jun Li,

 

You have to enable persistent storage in your application.

 

For that,

 

1) add #include <settings/settings.h> in main.c

 

2) add

 

if (IS_ENABLED(CONFIG_SETTINGS)) {
        settings_load();
    }

 

in bt_ready() function

 

3) add

 

CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_FCB=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y

 

 

in prj.conf

 

 

For details refer -> zephyr/samples/bluetooth/peripheral example.

 

regards,

vikrant

 

 

On Tue, Jun 12, 2018 at 4:17 AM, Li, Jun R <jun.r.li@...> wrote:

Hi,

 

I’m building a BLE application based on a NRF51 board with pass key support. The device can be connected and bonded with a mobile phone after the pass key was correctly entered, and can be reconnected after disconnection. However, the connection can’t be established any more after the device rebooted unless I click “Forget the device” in my phone’s Bluetooth settings. I guess that some parameters related to bonding shall be stored into “settings”, but wasn’t able to figure out what kind of parameters shall be saved and restored. Can anyone give any clue to this? Thank you!

 

Also, I’ve called “settings_load()” in the function “bt_ready()” but it seems not helpful.

 

Regards,

Jun Li

 

 


Re: What information shall be persistent to restore BLE bond after power cycling?

vikrant8051 <vikrant8051@...>
 

Hi Jun Li,

You have to enable persistent storage in your application.

For that,

1) add #include <settings/settings.h> in main.c

2) add

if (IS_ENABLED(CONFIG_SETTINGS)) {
        settings_load();
    }

in bt_ready() function

3) add

CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y
CONFIG_FCB=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y


in prj.conf


For details refer -> zephyr/samples/bluetooth/peripheral example.

regards,
vikrant


On Tue, Jun 12, 2018 at 4:17 AM, Li, Jun R <jun.r.li@...> wrote:

Hi,

 

I’m building a BLE application based on a NRF51 board with pass key support. The device can be connected and bonded with a mobile phone after the pass key was correctly entered, and can be reconnected after disconnection. However, the connection can’t be established any more after the device rebooted unless I click “Forget the device” in my phone’s Bluetooth settings. I guess that some parameters related to bonding shall be stored into “settings”, but wasn’t able to figure out what kind of parameters shall be saved and restored. Can anyone give any clue to this? Thank you!

 

Also, I’ve called “settings_load()” in the function “bt_ready()” but it seems not helpful.

 

Regards,

Jun Li

 



Re: Zephyr development news, 11 June 2018

Marti Bolivar
 

Hi again,

On Mon, Jun 11, 2018 at 7:28 PM, Marti Bolivar <marti@...> wrote:
Hello and happy release day,

Please note that we've renamed the series to "Zephyr development news"
to avoid a name clash with another publication.

This is the 11 June 2018 newsletter tracking the latest Zephyr
development merged into the mainline tree on GitHub.

I forgot to mention that (as usual) an HTML version is also available:


Sorry about that.

Marti


Zephyr development news, 11 June 2018

Marti Bolivar
 

Hello and happy release day,

Please note that we've renamed the series to "Zephyr development news"
to avoid a name clash with another publication.

This is the 11 June 2018 newsletter tracking the latest Zephyr
development merged into the mainline tree on GitHub.

As usual, content is broken down as follows:

- Highlights
  - Important changes: ABI/API breaks and some features
  - New features: non-exhaustive descriptions of new features
  - Bug fixes: non-exhaustive list of fixed bugs
- Individual changes: a complete list of patches, sorted
  chronologically and categorized into areas, like:
  - Architectures
  - Kernel
  - Drivers
  - etc.

Highlights
==========

As announced previously on the mailing lists, Zephyr v1.12.0 has been
tagged and the v1.13 merge window is now open. Hurray!

This newsletter covers changes in the following inclusive range, which
closes out the v1.12 release candidate period:

- 6a138977 ("susbys: disk: Fix misleading menuconfig prompts"),
  merged 4 June 2018
- f58d9cab ("release: Update VERSION for 1.12.0 release"),
  merged 11 June 2018

Important Changes
-----------------

The areas most affected during this period, as might be expected, were
documentation and testing. There were also a fairly large number of
ARC architecture changes.

Features
--------

Continuous Integration:

Sanitycheck can now export tests in CSV format.

Bug Fixes
---------

Arches:

A variety of ARC fixes were merged. These fix overflows in the
privileged stack, IRQ offloading, the ADC and watchdog timer priority
levels, reset instability, and a couple of issues related to exception
handling.

A bug preventing i.MX RT SoCs from booting correctly was fixed as
well; this also has the nice benefit of eliminating a vast number of
Kconfig warnings emitted when building for other boards.

Bluetooth:

A fix for a Coverity bug related to corrupted flash storage of
persistent settings was merged, along with a fix to retransmit
interval handling in the Mesh implementation, and an invalid pointer
access after disconnect in the ATT code.

Build:

A fix to the kernel helpers for the GCC toolchain was merged which
resolves unaligned access issues on GCC >= 7.

Continuous Integration:

A sanitycheck bug leading to false positive test pass reporting was
fixed.

Documentation:

The final batch of documentation patches covered release notes, issues
in the Getting Started guide, initial documentation for the
experimental West meta-tool, updates to the security documentation,
and some watchdog API documentation.

Kernel:

Architecture-specific attempts to provide thread arguments using its
initial stack layout were replaced with common code, trading off extra
memory to fix broken and incomplete implementations in some
architectures.

Libraries:

A fix was merged for a readdir() buffer out of bounds access
discovered by Coverity.

Networking:

An LWM2M bug was fixed which fixes mandatory rate limiting on the
frequency of notifications for observed object instance attributes.
The LWM2M engine thread priority was also lowered, fixing a thread
starvation issue when running LWM2M concurrently with Bluetooth
(e.g. as part of a 6LoWPAN setup).

The IPv4 stack now correctly updates the time-to-live value based on
the received packet header; a similar fix was merged for IPv6 hop
limits.

Samples:

Some last-minute changes were merged to crypto and networking samples.

The crypto changes appear to have been merged because
samples/drivers/crypto is in fact being used as a test case in
addition to serving as sample code, so they perhaps could be
considered test fixes.

The networking changes were fixes for bugs discovered by Coverity.

Testing:

A variety of patches fixing up and tuning the test cases were merged
in the final days of v1.12 development.

Individual Changes
==================

Patches by area (76 patches total):

- Arches: 11
- Bluetooth: 3
- Boards: 1
- Build: 1
- Continuous Integration: 2
- Documentation: 22
- Firmware Update: 1
- Kernel: 2
- Libraries: 1
- Miscellaneous: 3
- Networking: 5
- Samples: 8
- Scripts: 1
- Storage: 2
- Testing: 13

Arches (11):

- b423ee5f nxp_imx: Move i.MX RT PLL selects to Kconfig.soc
- c5cb8e94 arch/arc: Set the right priority for WDT on quark_se
- 718597fe arch/arm: Fix THREAD_MONITOR entry struct
- 7f7718a0 arch: stm32: remove .hex binary build by default
- 5b6f8605 arch: arc: use a separate stack for exception handling
- 5dd552e6 arch: arc: STACK_CHECK_FAIL of STACK_CHECK not hang the system
- fb3d2d37 arch: arc: remove unused codes
- c63298ea arch: arc: improve the reset code
- 1c4fe3ed arch/arc: Set the right priority for ADC/AON on quark_se
- 97d04364 arch: arc: use top of isr stack as exception stack and bug fixes
- d5bc9d7b arch: arc: adjust privileged stack size of arc to 384 bytes

Bluetooth (3):

- ae829b26 Bluetooth: Fix unchecked settings value lengths
- ed5fb3ff Bluetooth: Mesh: Fix (re)transmit interval handling
- 1218648e Bluetooth: ATT: Fix clearing context at disconnect

Boards (1):

- f0bafc30 boards: make em_starterkit_em7d default test platform

Build (1):

- a37e0372 toolchain: gcc: Add compiler barrier at the end of UNALIGNED_PUT()

Continuous Integration (2):

- 5d6e7eb7 sanitycheck: export list of tests as CSV
- b20c4846 sanitycheck: fail on faults/panics/oopses

Documentation (22):

- 65e191fa api: watchdog: fix wdt_install_timeout doxygen comment
- 265f502b releasenotes: update with doc issues addressed
- 72d4d8bc doc: release notes: Fill in summary, arch, and kernel sections for 1.12
- d04a7efd releasenotes: updated documentation changes
- 59027fb6 doc: relnotes: Correct a couple of headline items
- b0abf365 doc: relnotes: 1.12 Bluetooth release notes
- 2825f79a doc: security: Update security overview for recent features
- 8b9042c4 doc: security: Remove revision history
- 3fc206fa getting_started: fix UNIX-ism
- 9ca4d840 getting_started: fixes for intro section
- 64ab1326 getting_started: fixes and cleanups for installation_linux
- c6c15013 getting_started: building: fix inaccuracies
- e8d0e72a doc: extensions: fix :app: behavior for zephyr-app-commands
- e802d8de doc: conf.py: remove unused import
- 1c852ddf doc: conf.py: make sure west is importable from Python
- 3a766aed doc: conf.py: add sphinx.ext.autodoc extension
- 869e9cce doc: add initial west documentation
- f8251693 conf.py: clean up exit if ZEPHYR_BASE is unset
- d6f2858a doc: relnotes: Add security vulnerability information
- 8e892068 doc: release notes: Update 1.12 release notes with GitHub issues
- d3afa353 doc: release notes: Update 1.12 release notes with more GitHub issues
- 51ae306b doc: release notes: Finalize 1.12 release notes and docs

Firmware Update (1):

- 2cba7017 subsys: mgmt: Remove unnecessary comparison

Kernel (2):

- 0e23ad88 kernel: k_work: k_work_init() should initialize all fields
- 2dd91eca kernel: move thread monitor init to common code

Libraries (1):

- bf1e0198 lib: posix: fix out-of-bound write

Miscellaneous (3):

- eb9df85f release: Move version to 1.12.0-rc3
- 3b1fb7f9 release: update footprint data
- f58d9cab release: Update VERSION for 1.12.0 release

Networking (5):

- 95555221 net: shell: Correct help text for "mem" command
- a957107d net: lwm2m: lower priority of engine thread
- d9a14f5a net: ipv6: Set hop limit in net_pkt according to IPv6 header
- e72dcf02 net: ipv4: Set TTL in net_pkt according to IPv4 header
- ed3ea06f net: lwm2m: fix observer attribute update logic

Samples (8):

- cf3da3c6 samples: crypto: Ensure cap_flags is always initialized
- 858cd199 samples: drivers: crypto: Do not show colors in logs
- d06eecbe samples: drivers: crypto: Update expected sample output
- d05442ee samples: crypto: adapt harness
- fd561dd5 samples: net: Check the return value of nats_publish
- e7a3d01d samples: net: dumb_http_server: Handle recv() errors
- b7ad50b4 samples: net: rpl_border_router: Fix out-of-bounds write
- 7cfd5a41 samples: net: hrpl_border_router: Fix NULL pointer dereference

Scripts (1):

- c6c856bc scripts: west: cherry-pick upstream 321ab2e17

Storage (2):

- 6a138977 susbys: disk: Fix misleading menuconfig prompts
- bfdb6aca subsys: settings: Fix file exist error.

Testing (13):

- 9cefce81 tests: remove obsolete k_thread_cancel
- a803af2f tests/kernel/preempt: Add yield and sleep cases
- a026b9ea tests: crypto: Fully initialize variables using named initializers
- a07d0731 tests: mbox_api: Fully initialize k_box_msg struct
- a803335a tests: net: Increase the stack size of frdm-k64f
- b43000f5 tests: net: trickle: Fix running on frdm-k64f
- 59bf65f4 tests: net: Fix tests so they can be run in real hw
- 3057da07 tests: logger-hook: increase ztest stack size
- bb631076 tests: arm: irq_vector_table: Fix Kconfig override
- fb2e142b tests: fix test identifiers
- 33aa9053 tests: kernel: fifo_timeout: Do not potentially dereference NULL ptrs
- 144a4390 tests: fix the bug of sentinel.conf
- a91f1e5e tests: modify the test conditions for emsk_em7d_v22


What information shall be persistent to restore BLE bond after power cycling?

Li, Jun R
 

Hi,

 

I’m building a BLE application based on a NRF51 board with pass key support. The device can be connected and bonded with a mobile phone after the pass key was correctly entered, and can be reconnected after disconnection. However, the connection can’t be established any more after the device rebooted unless I click “Forget the device” in my phone’s Bluetooth settings. I guess that some parameters related to bonding shall be stored into “settings”, but wasn’t able to figure out what kind of parameters shall be saved and restored. Can anyone give any clue to this? Thank you!

 

Also, I’ve called “settings_load()” in the function “bt_ready()” but it seems not helpful.

 

Regards,

Jun Li

 


Re: Bluetooth Multiple Central Connections

Daniel Widmann
 

Hi,

I think I figured out whats going on:
Zephyr will lock up if I try to enable scanning in the 'Failed to connect' callback.
In the failed to connect case, the callback is called from the hci tx thread while a command is processed (I assume BT_HCI_OP_LE_CREATE_CONN_CANCEL). This behavior was recently introduced here. In  bt_le_scan_start, Zephyr will wait forever when it tries to allocate a new buffer from hci_cmd_pool.

Should it be possible to enable scanning 'Failed to connect' callback? Currently the Bluetooth central sample will simply stop if it failed to connect. 


Stack trace for the connected callback:
callback on hci thread.PNG
​ 

Cheers,
Daniel

On Mon, Jun 11, 2018 at 9:24 AM Daniel Widmann <widmann.daniel@...> wrote:
Hi Carles,

It doesn't solve the second issue. I am doing more investigation on that issue right now.

Cheers,
Daniel

On Mon, Jun 11, 2018 at 9:22 AM Cufi, Carles <Carles.Cufi@...> wrote:

Hi Daniel,

 

Can you confirm that this fixes both issues you described in your original email_

 

Thanks,

 

Carles

 

From: Daniel Widmann <widmann.daniel@...>
Sent: 11 June 2018 17:55
To: luiz.von.dentz@...
Cc: Cufi, Carles <carles.cufi@...>; devel@...
Subject: Re: [Zephyr-devel] Bluetooth Multiple Central Connections

 

Hi Luiz,

 

Thanks for pointing me to the bt_att_req. I used the same bt_gatt_write_params for both connections, which caused the issue. I use exactly the same GATT parameters for both connections so I though it wouldn't be an issue.

 

I wasn't aware that bt_gatt_write_params contains the  bt_att_req struct (Maybe params is not the best name for something containing internal state). Also I didn't expect this behavior when reading the API note: "the parameters need to remains valid while it is active".

 

Cheers,

Daniel

 

On Mon, Jun 11, 2018 at 3:17 AM Von Dentz, Luiz <luiz.von.dentz@...> wrote:

Hi Daniel,

Can you send me more details of what the code is doing, for instance,
what are the requests in ATT and how you manage the bt_att_req in use
for each connection.

On Sun, Jun 10, 2018 at 9:06 PM, Cufi, Carles <Carles.Cufi@...> wrote:
> Hi Daniel,
>
> + Luiz, Johan, Vinayak
>
>
>
> Yes, multiple peripherals is supported and what you describe sounds like a
> bug.
>
> Can you let us know what board you are using and also which Zephyr version?
>
>
>
> Also, regarding the ATT null pointer call, could you please file a GitHub
> issue?
>
> The “lockup” that you describe is a bit strange. Can you try scanning or any
> other BLE operation to see if it’s the controller or the host? Can you try
> to reproduce with tests/Bluetooth/shell to see if we can also try to find
> out on our side what the issue might be?
>
>
>
> Any assistance in helping us reproduce the issue is welcome, including a
> snippet app that you might push so we can run it ourselves.
>
>
>
> Thanks in advance!
>
>
>
> Carles
>
>
>
> From: <devel@...> on behalf of Daniel Widmann
> <widmann.daniel@...>
> Date: Sunday, 10 June 2018 at 19:31
> To: "devel@..." <devel@...>
> Subject: [Zephyr-devel] Bluetooth Multiple Central Connections
>
>
>
> Hi,
>
>
>
> I am trying to build a BLE device that connects to multiple peripherals at
> the same time. Is this currently supported? Has anybody tried this recently?
>
>
>
> I tried but it's not very stable:
>
>
>
> * When I try to do GATT request on two peripherals simultaneously, I get a
> usage fault:
>
>  0> ***** USAGE FAULT *****
>
>  0>   Executing thread ID (thread): 0x2000338c
>
>  0>   Faulting instruction address:  0x0
>
>  0>   Illegal use of the EPSR
>
>  0> Fatal fault in thread 0x2000338c! Aborting.
>
> This is caused by calling a NULL function pointer in att.c:L324.
>
>
>
> * I regularly get a timeout error when connecting to a second peripheral
> while already being connected to another peripheral. When this happened,
> something in the system locks up and I can't receive any advertisements
> anymore and existing connections stop working.
>
>
>
> Cheers,
>
> Daniel
>
>
>
>
>
>
>
>
>
>
>
>
>


Using a predefined passkey on a BLE peripheral device with no input/output

Li, Jun R
 

Hi everyone,

 

I have a NRF51 BLE device which doesn’t have either a display or a keyboard, and would like to use a static passkey to secure the connection establishment. Is it possible to use a static pre-defined passkey in Zephyr’s BLE  stack and how is the static passkey defined? Thank you!

 

Regards,

Jun Li

 


Zephyr 1.12.0 released

Maureen Helm
 

Hi all,

 

We are pleased to announce the release of Zephyr kernel version 1.12.0.

 

Major enhancements with this release include:

 

- Asymmetric multiprocessing (AMP) via integration of OpenAMP

- Persistent storage support for Bluetooth Low Energy including Mesh

- 802.1Q - Virtual Local Area Network (VLAN) traffic on an Ethernet network

- Support multiple concurrent filesystem devices, partitions, and FS types

- Ethernet network management interface

- Networking traffic prioritization on a per-connection basis

- Support for Ethernet statistical counters

- Support for TAP net device on the the native POSIX port

- Command-line Zephyr meta-tool "west"

- SPI slave support

- Runtime non-volatile configuration data storage system (settings)

 

Detailed changes since 1.11.0 can be found here:

https://github.com/zephyrproject-rtos/zephyr/releases/tag/zephyr-v1.12.0

 

Many thanks to everyone that contributed to this release! Almost 2000 patches (1978 to be exact) from 111 authors were merged, and 523 GitHub issues were closed in the three months since our last release.

 

The master branch is now open again for development.

 

Regards,

Maureen


Re: Bluetooth Multiple Central Connections

Von Dentz, Luiz <luiz.von.dentz@...>
 

Hi Daniel,

Can you send me more details of what the code is doing, for instance,
what are the requests in ATT and how you manage the bt_att_req in use
for each connection.

On Sun, Jun 10, 2018 at 9:06 PM, Cufi, Carles <Carles.Cufi@...> wrote:
Hi Daniel,

+ Luiz, Johan, Vinayak



Yes, multiple peripherals is supported and what you describe sounds like a
bug.

Can you let us know what board you are using and also which Zephyr version?



Also, regarding the ATT null pointer call, could you please file a GitHub
issue?

The “lockup” that you describe is a bit strange. Can you try scanning or any
other BLE operation to see if it’s the controller or the host? Can you try
to reproduce with tests/Bluetooth/shell to see if we can also try to find
out on our side what the issue might be?



Any assistance in helping us reproduce the issue is welcome, including a
snippet app that you might push so we can run it ourselves.



Thanks in advance!



Carles



From: <devel@...> on behalf of Daniel Widmann
<widmann.daniel@...>
Date: Sunday, 10 June 2018 at 19:31
To: "devel@..." <devel@...>
Subject: [Zephyr-devel] Bluetooth Multiple Central Connections



Hi,



I am trying to build a BLE device that connects to multiple peripherals at
the same time. Is this currently supported? Has anybody tried this recently?



I tried but it's not very stable:



* When I try to do GATT request on two peripherals simultaneously, I get a
usage fault:

0> ***** USAGE FAULT *****

0> Executing thread ID (thread): 0x2000338c

0> Faulting instruction address: 0x0

0> Illegal use of the EPSR

0> Fatal fault in thread 0x2000338c! Aborting.

This is caused by calling a NULL function pointer in att.c:L324.



* I regularly get a timeout error when connecting to a second peripheral
while already being connected to another peripheral. When this happened,
something in the system locks up and I can't receive any advertisements
anymore and existing connections stop working.



Cheers,

Daniel














Re: Mbedtls_pk_verify error

christian tavares
 

Thanks for you answer me. I followed your tips and corrected that problems and I resolved to simplify the code removing the server side and letting just application working. But the problem doesn't resolve yet If you could see again o code modified I'll be grateful to help me. Thanks again.
https://github.com/chtavares592/verify_signature/blob/master/verify_signature/src/main.c


Re: Bluetooth Multiple Central Connections

Daniel Widmann
 

Hi Carles,

It doesn't solve the second issue. I am doing more investigation on that issue right now.

Cheers,
Daniel

On Mon, Jun 11, 2018 at 9:22 AM Cufi, Carles <Carles.Cufi@...> wrote:

Hi Daniel,

 

Can you confirm that this fixes both issues you described in your original email_

 

Thanks,

 

Carles

 

From: Daniel Widmann <widmann.daniel@...>
Sent: 11 June 2018 17:55
To: luiz.von.dentz@...
Cc: Cufi, Carles <carles.cufi@...>; devel@...
Subject: Re: [Zephyr-devel] Bluetooth Multiple Central Connections

 

Hi Luiz,

 

Thanks for pointing me to the bt_att_req. I used the same bt_gatt_write_params for both connections, which caused the issue. I use exactly the same GATT parameters for both connections so I though it wouldn't be an issue.

 

I wasn't aware that bt_gatt_write_params contains the  bt_att_req struct (Maybe params is not the best name for something containing internal state). Also I didn't expect this behavior when reading the API note: "the parameters need to remains valid while it is active".

 

Cheers,

Daniel

 

On Mon, Jun 11, 2018 at 3:17 AM Von Dentz, Luiz <luiz.von.dentz@...> wrote:

Hi Daniel,

Can you send me more details of what the code is doing, for instance,
what are the requests in ATT and how you manage the bt_att_req in use
for each connection.

On Sun, Jun 10, 2018 at 9:06 PM, Cufi, Carles <Carles.Cufi@...> wrote:
> Hi Daniel,
>
> + Luiz, Johan, Vinayak
>
>
>
> Yes, multiple peripherals is supported and what you describe sounds like a
> bug.
>
> Can you let us know what board you are using and also which Zephyr version?
>
>
>
> Also, regarding the ATT null pointer call, could you please file a GitHub
> issue?
>
> The “lockup” that you describe is a bit strange. Can you try scanning or any
> other BLE operation to see if it’s the controller or the host? Can you try
> to reproduce with tests/Bluetooth/shell to see if we can also try to find
> out on our side what the issue might be?
>
>
>
> Any assistance in helping us reproduce the issue is welcome, including a
> snippet app that you might push so we can run it ourselves.
>
>
>
> Thanks in advance!
>
>
>
> Carles
>
>
>
> From: <devel@...> on behalf of Daniel Widmann
> <widmann.daniel@...>
> Date: Sunday, 10 June 2018 at 19:31
> To: "devel@..." <devel@...>
> Subject: [Zephyr-devel] Bluetooth Multiple Central Connections
>
>
>
> Hi,
>
>
>
> I am trying to build a BLE device that connects to multiple peripherals at
> the same time. Is this currently supported? Has anybody tried this recently?
>
>
>
> I tried but it's not very stable:
>
>
>
> * When I try to do GATT request on two peripherals simultaneously, I get a
> usage fault:
>
>  0> ***** USAGE FAULT *****
>
>  0>   Executing thread ID (thread): 0x2000338c
>
>  0>   Faulting instruction address:  0x0
>
>  0>   Illegal use of the EPSR
>
>  0> Fatal fault in thread 0x2000338c! Aborting.
>
> This is caused by calling a NULL function pointer in att.c:L324.
>
>
>
> * I regularly get a timeout error when connecting to a second peripheral
> while already being connected to another peripheral. When this happened,
> something in the system locks up and I can't receive any advertisements
> anymore and existing connections stop working.
>
>
>
> Cheers,
>
> Daniel
>
>
>
>
>
>
>
>
>
>
>
>
>


Re: Bluetooth Multiple Central Connections

Carles Cufi
 

Hi Daniel,

 

Can you confirm that this fixes both issues you described in your original email_

 

Thanks,

 

Carles

 

From: Daniel Widmann <widmann.daniel@...>
Sent: 11 June 2018 17:55
To: luiz.von.dentz@...
Cc: Cufi, Carles <carles.cufi@...>; devel@...
Subject: Re: [Zephyr-devel] Bluetooth Multiple Central Connections

 

Hi Luiz,

 

Thanks for pointing me to the bt_att_req. I used the same bt_gatt_write_params for both connections, which caused the issue. I use exactly the same GATT parameters for both connections so I though it wouldn't be an issue.

 

I wasn't aware that bt_gatt_write_params contains the  bt_att_req struct (Maybe params is not the best name for something containing internal state). Also I didn't expect this behavior when reading the API note: "the parameters need to remains valid while it is active".

 

Cheers,

Daniel

 

On Mon, Jun 11, 2018 at 3:17 AM Von Dentz, Luiz <luiz.von.dentz@...> wrote:

Hi Daniel,

Can you send me more details of what the code is doing, for instance,
what are the requests in ATT and how you manage the bt_att_req in use
for each connection.

On Sun, Jun 10, 2018 at 9:06 PM, Cufi, Carles <Carles.Cufi@...> wrote:
> Hi Daniel,
>
> + Luiz, Johan, Vinayak
>
>
>
> Yes, multiple peripherals is supported and what you describe sounds like a
> bug.
>
> Can you let us know what board you are using and also which Zephyr version?
>
>
>
> Also, regarding the ATT null pointer call, could you please file a GitHub
> issue?
>
> The “lockup” that you describe is a bit strange. Can you try scanning or any
> other BLE operation to see if it’s the controller or the host? Can you try
> to reproduce with tests/Bluetooth/shell to see if we can also try to find
> out on our side what the issue might be?
>
>
>
> Any assistance in helping us reproduce the issue is welcome, including a
> snippet app that you might push so we can run it ourselves.
>
>
>
> Thanks in advance!
>
>
>
> Carles
>
>
>
> From: <devel@...> on behalf of Daniel Widmann
> <widmann.daniel@...>
> Date: Sunday, 10 June 2018 at 19:31
> To: "devel@..." <devel@...>
> Subject: [Zephyr-devel] Bluetooth Multiple Central Connections
>
>
>
> Hi,
>
>
>
> I am trying to build a BLE device that connects to multiple peripherals at
> the same time. Is this currently supported? Has anybody tried this recently?
>
>
>
> I tried but it's not very stable:
>
>
>
> * When I try to do GATT request on two peripherals simultaneously, I get a
> usage fault:
>
>  0> ***** USAGE FAULT *****
>
>  0>   Executing thread ID (thread): 0x2000338c
>
>  0>   Faulting instruction address:  0x0
>
>  0>   Illegal use of the EPSR
>
>  0> Fatal fault in thread 0x2000338c! Aborting.
>
> This is caused by calling a NULL function pointer in att.c:L324.
>
>
>
> * I regularly get a timeout error when connecting to a second peripheral
> while already being connected to another peripheral. When this happened,
> something in the system locks up and I can't receive any advertisements
> anymore and existing connections stop working.
>
>
>
> Cheers,
>
> Daniel
>
>
>
>
>
>
>
>
>
>
>
>
>


Re: Bluetooth Multiple Central Connections

Daniel Widmann
 

Hi Luiz,

Thanks for pointing me to the bt_att_req. I used the same bt_gatt_write_params for both connections, which caused the issue. I use exactly the same GATT parameters for both connections so I though it wouldn't be an issue.

I wasn't aware that bt_gatt_write_params contains the  bt_att_req struct (Maybe params is not the best name for something containing internal state). Also I didn't expect this behavior when reading the API note: "the parameters need to remains valid while it is active".

Cheers,
Daniel

On Mon, Jun 11, 2018 at 3:17 AM Von Dentz, Luiz <luiz.von.dentz@...> wrote:
Hi Daniel,

Can you send me more details of what the code is doing, for instance,
what are the requests in ATT and how you manage the bt_att_req in use
for each connection.

On Sun, Jun 10, 2018 at 9:06 PM, Cufi, Carles <Carles.Cufi@...> wrote:
> Hi Daniel,
>
> + Luiz, Johan, Vinayak
>
>
>
> Yes, multiple peripherals is supported and what you describe sounds like a
> bug.
>
> Can you let us know what board you are using and also which Zephyr version?
>
>
>
> Also, regarding the ATT null pointer call, could you please file a GitHub
> issue?
>
> The “lockup” that you describe is a bit strange. Can you try scanning or any
> other BLE operation to see if it’s the controller or the host? Can you try
> to reproduce with tests/Bluetooth/shell to see if we can also try to find
> out on our side what the issue might be?
>
>
>
> Any assistance in helping us reproduce the issue is welcome, including a
> snippet app that you might push so we can run it ourselves.
>
>
>
> Thanks in advance!
>
>
>
> Carles
>
>
>
> From: <devel@...> on behalf of Daniel Widmann
> <widmann.daniel@...>
> Date: Sunday, 10 June 2018 at 19:31
> To: "devel@..." <devel@...>
> Subject: [Zephyr-devel] Bluetooth Multiple Central Connections
>
>
>
> Hi,
>
>
>
> I am trying to build a BLE device that connects to multiple peripherals at
> the same time. Is this currently supported? Has anybody tried this recently?
>
>
>
> I tried but it's not very stable:
>
>
>
> * When I try to do GATT request on two peripherals simultaneously, I get a
> usage fault:
>
>  0> ***** USAGE FAULT *****
>
>  0>   Executing thread ID (thread): 0x2000338c
>
>  0>   Faulting instruction address:  0x0
>
>  0>   Illegal use of the EPSR
>
>  0> Fatal fault in thread 0x2000338c! Aborting.
>
> This is caused by calling a NULL function pointer in att.c:L324.
>
>
>
> * I regularly get a timeout error when connecting to a second peripheral
> while already being connected to another peripheral. When this happened,
> something in the system locks up and I can't receive any advertisements
> anymore and existing connections stop working.
>
>
>
> Cheers,
>
> Daniel
>
>
>
>
>
>
>
>
>
>
>
>
>


Re: [Zephyr-users] is it possible to enable LE Coded PHY for #BluetoothMesh Nodes / #BLE devices? #bluetoothmesh #ble

Chettimada, Vinayak Kariappa
 

Hi Vikrant,

Advertising on Coded PHY needs the implementation of Extended Advertising feature of BT V5.0. This feature has not been implementation, only a initial effort was attempted.
That said, any contribution are welcome and I am available to assist in reviews.

Regards,
Vinayak


On 11 Jun 2018, at 17:48, vikrant8051 <vikrant8051@...> wrote:

Hi,


Is concept of, LE Codded PHY present in current Zephyr implementation to increase range
between two #BluetoothMesh Nodes ?

What is default configuration out of
- LE M1
- LE M2
- LE Coded ?


Thank You !!



is it possible to enable LE Coded PHY for #BluetoothMesh Nodes / #BLE devices? #bluetoothmesh #ble

vikrant8051 <vikrant8051@...>
 

Hi,


Is concept of, LE Codded PHY present in current Zephyr implementation to increase range
between two #BluetoothMesh Nodes ?

What is default configuration out of
- LE M1
- LE M2
- LE Coded ?


Thank You !!


Re: build zephyr samples/hello_world on WSL reporting error

Carles Cufi
 

Hi there,

 

This is a bug introduced to WSL recently, so there’s nothing we can do on the Zephyr side except wait for Microsoft to fix it. You can downgrade your WSL in the meantime. For more information please see:

https://github.com/Microsoft/WSL/issues/3154

 

Regards,

 

Carles

 

From: devel@... <devel@...> On Behalf Of ???
Sent: 11 June 2018 03:55
To: devel@...
Subject: [Zephyr-devel] build zephyr samples/hello_world on WSL reporting error

 

 

I'm using WSL (Ubuntu on Windows)

I setup build environment as "Getting Started Guide" said, and build samples/hello_world demo appbut cmake reporting error, the error message is:

 

/home/wmx/usb/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gcc: 1: /home/wmx/usb/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gcc: Syntax error: ")" unexpected

CMake Error at /home/wmx/win/zephyr/cmake/compiler/gcc.cmake:48 (string):

  string sub-command REGEX, mode REPLACE needs at least 6 arguments total to

  command.

Call Stack (most recent call first):

  /home/wmx/win/zephyr/cmake/toolchain.cmake:40 (include)

  /home/wmx/win/zephyr/cmake/app/boilerplate.cmake:242 (include)

  CMakeLists.txt:2 (include)

 

 

/home/wmx/usb/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gcc: 1: /home/wmx/usb/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gcc: Syntax error: ")" unexpected

CMake Error at /home/wmx/win/zephyr/cmake/extensions.cmake:1081 (message):

  No such file or directory: LIBGCC_FILE_NAME: ''

Call Stack (most recent call first):

  /home/wmx/win/zephyr/cmake/compiler/gcc.cmake:100 (assert_exists)

  /home/wmx/win/zephyr/cmake/toolchain.cmake:40 (include)

  /home/wmx/win/zephyr/cmake/app/boilerplate.cmake:242 (include)

  CMakeLists.txt:2 (include)


build zephyr samples/hello_world on WSL reporting error

XIVN1987@...
 


I'm using WSL (Ubuntu on Windows)
I setup build environment as "Getting Started Guide" said, and build samples/hello_world demo app,but cmake reporting error, the error message is:

/home/wmx/usb/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gcc: 1: /home/wmx/usb/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gcc: Syntax error: ")" unexpected
CMake Error at /home/wmx/win/zephyr/cmake/compiler/gcc.cmake:48 (string):
  string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
  command.
Call Stack (most recent call first):
  /home/wmx/win/zephyr/cmake/toolchain.cmake:40 (include)
  /home/wmx/win/zephyr/cmake/app/boilerplate.cmake:242 (include)
  CMakeLists.txt:2 (include)


/home/wmx/usb/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gcc: 1: /home/wmx/usb/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gcc: Syntax error: ")" unexpected
CMake Error at /home/wmx/win/zephyr/cmake/extensions.cmake:1081 (message):
  No such file or directory: LIBGCC_FILE_NAME: ''
Call Stack (most recent call first):
  /home/wmx/win/zephyr/cmake/compiler/gcc.cmake:100 (assert_exists)
  /home/wmx/win/zephyr/cmake/toolchain.cmake:40 (include)
  /home/wmx/win/zephyr/cmake/app/boilerplate.cmake:242 (include)
  CMakeLists.txt:2 (include)


Re: Bluetooth Multiple Central Connections

Carles Cufi
 

Hi Daniel,

+ Luiz, Johan, Vinayak

 

Yes, multiple peripherals is supported and what you describe sounds like a bug.

Can you let us know what board you are using and also which Zephyr version?

 

Also, regarding the ATT null pointer call, could you please file a GitHub issue?

The “lockup” that you describe is a bit strange. Can you try scanning or any other BLE operation to see if it’s the controller or the host? Can you try to reproduce with tests/Bluetooth/shell to see if we can also try to find out on our side what the issue might be?

 

Any assistance in helping us reproduce the issue is welcome, including a snippet app that you might push so we can run it ourselves.

 

Thanks in advance!

 

Carles

 

From: <devel@...> on behalf of Daniel Widmann <widmann.daniel@...>
Date: Sunday, 10 June 2018 at 19:31
To: "devel@..." <devel@...>
Subject: [Zephyr-devel] Bluetooth Multiple Central Connections

 

Hi,

 

I am trying to build a BLE device that connects to multiple peripherals at the same time. Is this currently supported? Has anybody tried this recently?

 

I tried but it's not very stable:

 

* When I try to do GATT request on two peripherals simultaneously, I get a usage fault:

 0> ***** USAGE FAULT *****

 0>   Executing thread ID (thread): 0x2000338c

 0>   Faulting instruction address:  0x0

 0>   Illegal use of the EPSR

 0> Fatal fault in thread 0x2000338c! Aborting.

This is caused by calling a NULL function pointer in att.c:L324

 

* I regularly get a timeout error when connecting to a second peripheral while already being connected to another peripheral. When this happened, something in the system locks up and I can't receive any advertisements anymore and existing connections stop working.

 

Cheers,

Daniel

 

 

 

 

 

 


Bluetooth Multiple Central Connections

Daniel Widmann
 

Hi,

I am trying to build a BLE device that connects to multiple peripherals at the same time. Is this currently supported? Has anybody tried this recently?

I tried but it's not very stable:

* When I try to do GATT request on two peripherals simultaneously, I get a usage fault:
 0> ***** USAGE FAULT *****
 0>   Executing thread ID (thread): 0x2000338c
 0>   Faulting instruction address:  0x0
 0>   Illegal use of the EPSR
 0> Fatal fault in thread 0x2000338c! Aborting.
This is caused by calling a NULL function pointer in att.c:L324

* I regularly get a timeout error when connecting to a second peripheral while already being connected to another peripheral. When this happened, something in the system locks up and I can't receive any advertisements anymore and existing connections stop working.

Cheers,
Daniel







Re: Mbedtls_pk_verify error

David Brown
 

I’m not sure exactly what is wrong, but I can spot numerous buffer overflows just by looking through the code. For example, in verify_signature, you’re calling:

 

snprintk(b1, sizeof(1), “%c”, msg[i]);

 

To start with, I’m not sure why you’re using snprintk of a single character, when you can just compare the character directly. But, sizeof(1) will be ‘4’ on most of our platforms, much more than the single character in the buffer.

 

I would guess initially that this is the problem with the code. In general, I wouldn’t expect this code to be making any calls to functions like ‘snprintk’, ‘strmp’, or the likes.

 

David

 

From: <devel@...> on behalf of christian tavares <christiantavarest@...>
Date: Friday, June 8, 2018 at 10:52 AM
To: "devel@..." <devel@...>
Subject: [Zephyr-devel] Mbedtls_pk_verify error

 

I developed a http_client app and that app receives a signature (BASE64), that signature is made with a hash(sha256) of the string data and the private key. At my app, I catch my public key and call "mbedtls_pk_parse_public_key" and returns 0. In order to verify I call "mbedtls_pk_can_do( &pk, MBEDTLS_PK_RSA )" and "mbedtls_rsa_check_pubkey" and that's functions return 0.

After I decode the server_signature using "mbedtls_base64_decode" and return 0.

But, when I call the verification function "mbedtls_pk_verify" returns MBEDTLS_ERR_RSA_VERIFY_FAILED, don't understand the reason.

 

I already tested the same data using OpenSSL and the verification returns true. I tested the verification on the server side and returns true too.

Here https://github.com/chtavares592/verify_signature I developed my simple example. I put the zephyr's app, the server and the keys. I don't know the reason for this problem if somebody can help I will be grateful. Thanks 

github.com

verify_signature - This is an example where the server sends a signature made with hash (sha256) of data and the private key (rsa) and the client needs to verify this signature with your public key

 

 

4101 - 4120 of 8833