"/samples/net/coap_server" example is not working on "nrf52_pca10040" board


Appala Raju <raju.ga@...>
 

Hi,

As Zephyr supports nRF52xx board, I have build and flashed "/samples/net/coap_server" example for my "nrf52_pca10040" board. But, It is not working and getting Hard-Fault during "init_app". UART messages are as follows. Any one can let me know what could be issue and how to resolve it.

Starting ETSI IoT Plugtests Server
uIP buffer: 1280
LL header: 0 IP+UDP header: 48 REST max chunk: 64
net: net_tx_fiber (0x20009928): Starting TX fiber (stack 1024 bytes)
net: net_rx_fiber (0x20009d28): Starting RX fiber (stack 1024 bytes)
net: net_timer_fiber (0x2000a128): Starting net timer fiber (stack 1536 bytes)
net (0x2000a128): timer fiber stack real size 1536 unused 1304 usage 128/1432 (8 %)
init_app: run coap server * BUS FAULT * Executing thread ID (thread): 0x2000ac28 Faulting instruction address: 0x00018dc0 Precise data bus error Address: 0x20095e10 Fatal fault in thread! Aborting. * HARD FAULT * Fault escalation (see below) * BUS FAULT * Executing thread ID (thread): 0x2000ac28 Faulting instruction address: 0x2000819c Precise data bus error Address: 0x20095e10 Fatal fault in ISR! Spinning...

Thanks,
Raju


Appala Raju <raju.ga@...>
 

Build command is as follows
make BOARD=nrf52_pca10040 NET_IFACE=bt


Appala Raju <raju.ga@...>
 

Can Any one help me on this...

Thanks,
Raju


Tomasz Bursztyka
 

Hi,

As Zephyr supports nRF52xx board, I have build and flashed "/samples/net/coap_server" example
There is no coap_server anymore. Which version of Zephyr are you working on?

Tomasz


Ravi kumar Veeramally
 

Hi Raju,

Current Zephyr upstream doesn't have coap_server. Now we have
zoap_server and zoap_client.

I tried copying prj_bt.conf from echo_server and built zoap_client with
following command.

make BOARD=nrf52_pca10040 CONF_FILE=prj_bt.conf

- Ravi.

On 12/24/2016 08:07 PM, Appala Raju wrote:
Build command is as follows
make BOARD=nrf52_pca10040 NET_IFACE=bt


Appala Raju <raju.ga@...>
 

Hi Tomasz,

I am using 1.6.0 version.

Thanks,
Raju


Tomasz Bursztyka
 

Hi Raju,

Can you try on latest master, on zoap_server?
We don't support the old coap library anymore, which was working against
old ip stack.

Tomasz

Hi Tomasz,

I am using 1.6.0 version.

Thanks,
Raju


Appala Raju <raju.ga@...>
 

Thanks Tomasz...

Just now I checked-out master branch and tried zoap_server as Ravi explained. Now it is booting with out any issues and seeing "shell >" on UART messages.

After that, I am trying to discover the BLE device from Linux machine using "sudo hcitool lescan". Here, nothing is showing. What could be the reason.


Luiz Augusto von Dentz
 

Hi,

zoap_server does not have BT support, but Ive created a patch adding
support for it:

https://gerrit.zephyrproject.org/r/6306

On Fri, Jan 13, 2017 at 11:38 AM, Appala Raju <raju.ga(a)gmail.com> wrote:
Thanks Tomasz...

Just now I checked-out master branch and tried zoap_server as Ravi explained. Now it is booting with out any issues and seeing "shell >" on UART messages.

After that, I am trying to discover the BLE device from Linux machine using "sudo hcitool lescan". Here, nothing is showing. What could be the reason.
--
Luiz Augusto von Dentz


Appala Raju <raju.ga@...>
 

Hi Luiz Augusto von Dentz,

Thanks for the patch. I have update the same and build for zoap_server.

LE SCAN output:
LE Scan ...
CA:2E:39:48:00:77 (unknown)
CA:2E:39:48:00:77 Test IPSP node

This is the debug output on UART:
[bt] [WRN] set_static_addr: Using temporary static random address
[bt] [INF] show_dev_info: Identity: ca:2e:39:48:00:77 (random)
[bt] [INF] show_dev_info: HCI: version 4.2 (0x08) revision 0x0000, manufacturer 0xffff
[bt] [INF] show_dev_info: LMP: version 4.2 (0x08) subver 0xffff
[bt] [DBG] bt_l2cap_le_fixed_chan_register: (0x20005020) CID 0x0004
[bt] [DBG] bt_l2cap_le_fixed_chan_register: (0x20005020) CID 0x0006
[bt] [WRN] bt_pub_key_gen: ECC HCI commands not available
[bt] [DBG] bt_l2cap_le_fixed_chan_register: (0x20005020) CID 0x0005

Then I am trying to connect to this server using following command. But it .is not connecting. What could be the reason?

echo "connect ca:2e:39:48:00:77 1" | tee /sys/kernel/debug/bluetooth/6lowpan_control


Luiz Augusto von Dentz
 

Hi,

On Sun, Jan 15, 2017 at 1:34 PM, Appala Raju <raju.ga(a)gmail.com> wrote:
Hi Luiz Augusto von Dentz,

Thanks for the patch. I have update the same and build for zoap_server.

LE SCAN output:
LE Scan ...
CA:2E:39:48:00:77 (unknown)
CA:2E:39:48:00:77 Test IPSP node

This is the debug output on UART:
[bt] [WRN] set_static_addr: Using temporary static random address
[bt] [INF] show_dev_info: Identity: ca:2e:39:48:00:77 (random)
[bt] [INF] show_dev_info: HCI: version 4.2 (0x08) revision 0x0000, manufacturer 0xffff
[bt] [INF] show_dev_info: LMP: version 4.2 (0x08) subver 0xffff
[bt] [DBG] bt_l2cap_le_fixed_chan_register: (0x20005020) CID 0x0004
[bt] [DBG] bt_l2cap_le_fixed_chan_register: (0x20005020) CID 0x0006
[bt] [WRN] bt_pub_key_gen: ECC HCI commands not available
[bt] [DBG] bt_l2cap_le_fixed_chan_register: (0x20005020) CID 0x0005

Then I am trying to connect to this server using following command. But it .is not connecting. What could be the reason?

echo "connect ca:2e:39:48:00:77 1" | tee /sys/kernel/debug/bluetooth/6lowpan_control
Well it seems the address is random: ca:2e:39:48:00:77 (random),
should you should pass 2 instead of 1 after the address.

--
Luiz Augusto von Dentz


Appala Raju <raju.ga@...>
 

Hi Luiz Augusto von Dentz,

Yes, I am able to connect by passing 2 after address. How can I go with static address by using device Mac ID instead of random address.

Thanks,
Raju


Luiz Augusto von Dentz
 

Hi,

There could be 2 reasons why you end up with a random address, either
you are setting CONFIG_BLUETOOTH_PRIVACY or the adapter don't have a
valid address (e.g. 00:00:00:00:00:00) which will cause the stack to
generate a static random address, for the former you just need to
disable privacy but in case of the later you need to check with the
manufacturer if it can provide a public address or in case it is a
qemu + btproxy setup just try another USB dongle.

On Sun, Jan 22, 2017 at 5:55 PM, Appala Raju <raju.ga(a)gmail.com> wrote:
Hi Luiz Augusto von Dentz,

Yes, I am able to connect by passing 2 after address. How can I go with static address by using device Mac ID instead of random address.

Thanks,
Raju
--
Luiz Augusto von Dentz


Appala Raju <raju.ga@...>
 

As per this post "https://devzone.nordicsemi.com/question/6566/how-to-get-6-byte-mac-address-at-nrf51822/" we can have unique Mac address but it seems this is not mapped in this OS properly. Can we implement the same.

Thanks,
Raju


Johan Hedberg
 

Hi,

On Mon, Jan 23, 2017, Appala Raju wrote:
As per this post
"https://devzone.nordicsemi.com/question/6566/how-to-get-6-byte-mac-address-at-nrf51822/"
we can have unique Mac address but it seems this is not mapped in this
OS properly. Can we implement the same.
That's indeed a good idea. If someone wants to pick up the task, I think
following would probably be the appropriate location:

--- a/subsys/bluetooth/host/hci_core.c
+++ b/subsys/bluetooth/host/hci_core.c
@@ -3285,6 +3285,10 @@ static int set_static_addr(void)
}
}

+ if (IS_ENABLED(CONFIG_SOC_FAMILY_NRF5)) {
+ /* Read address from nRF5-specific storage */
+ }
+
BT_DBG("Generating new static random address");

err = bt_addr_le_create_static(&bt_dev.id_addr);

Johan


Carles Cufi
 

Hi Raju,

-----Original Message-----
From: Appala Raju [mailto:raju.ga(a)gmail.com]
Sent: Monday, January 23, 2017 18:39
To: devel(a)lists.zephyrproject.org
Subject: [devel] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re:
"/samples/net/coap_server" example is not working on "nrf52_pca10040"
board

As per this post "https://devzone.nordicsemi.com/question/6566/how-to-
get-6-byte-mac-address-at-nrf51822/" we can have unique Mac address but
it seems this is not mapped in this OS properly. Can we implement the
same.
I'll try to send a patch to read the FICR address in the nRF5x. But even then remember that you will end up with a *random static* address, since the Nordic nRF5x ICs do not come with a public address by default. That said, it will be the same random static address every time you boot.

Regards,

Carles


Appala Raju <raju.ga@...>
 

Hi Carles,

I can understand that and that would be fine for me. I hope this is also applicable in all other OS like Contiki & RIOT and even in Nordic SDK.

Thanks,
Raju