Date   

Precision clock synchronisation between nRF52 devices #ble #nrf52840

marcus
 

Hi,

I posted a question at the zephyr github https://github.com/zephyrproject-rtos/zephyr/issues/11296

Basically we need to implement sub millisecond precision clock synchronisation between nRF52 devices using zephyr and we need some advice on how to accomplish this.
If there is a possibility to retrieve a timestamp somewhere in the code close to the point of ble packet transmission, then we could probably solve this, but it would be great to get some advice from the experts on where to place the hooks or maybe there are better ways to find out the timing of packet transmission?

 


Re: [mBed][TLS][MQTT][sam_e70_xplained]

Prabhu Vinod, Karthik
 

Never mind…I found the error. I had to diff conf-tls1_2_generic.h and other config and add the remaining ones to user config file. Also remove #define MBEDTLS_CONFIG_H from the tls user config file so that they are included.

 

Sorry and Thanks.

 

Many Regards,

Karthik Prabhu Vinod

 

Help save the planet by choosing not to use single use plastics. Pick paper, bamboo or metal cutlery and carry your own bag to the grocery store. Every little thing you do makes an impact.

 

From: <users@...> on behalf of "Karthik Prabhu Vinod (Intel)" <karthik.prabhu.vinod@...>
Date: Tuesday, November 13, 2018 at 10:25 PM
To: "users@..." <users@...>
Subject: [Zephyr-users] [mBed][TLS][MQTT][sam_e70_xplained]

 

Hi,

 

I am trying to build the mqtt_publisher_subscriber app for sam_e70_xplained board. I was successfully able to connect to a cloud via TLS_v1_2 using a DER format.

 

But now, I am trying to switch to a more friendly PEM format by of course looking at the samples and it fails to connect. Also, unable to turn on the LOGGING for MBEDTLS modules, I wasn’t sure what’s causing the failure after the change to how logging works for NET & MBEDTLS modules

 

This is how I am assigning my PEM buffer

 

static const unsigned char ca_certificate[]=

"-----BEGIN CERTIFICATE-----\r\n"

"MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\r\n"

"MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\r\n"

"d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\r\n"

"QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\r\n"

"MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\r\n"

"b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\r\n"

"9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\r\n"

"CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\r\n"

"nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\r\n"

"43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\r\n"

"T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\r\n"

"gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\r\n"

"BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\r\n"

"TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\r\n"

"DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\r\n"

"hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\r\n"

"06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\r\n"

"PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\r\n"

"YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\r\n"

"CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\r\n"

"-----END CERTIFICATE-----\r\n";

 

 

Building my CA chain:

 

ret = mbedtls_x509_crt_parse(ca_cert, ca_certificate, sizeof(ca_certificate));

 

When I run build, the linker errors:

 

libzephyr.a(net_app.c.obj): In function `_net_app_tls_init':

/Users/kprabhuv/new_zephyr/subsys/net/lib/app/net_app.c:2221: undefined reference to `mbedtls_entropy_init'

/Users/kprabhuv/new_zephyr/subsys/net/lib/app/net_app.c:2230: undefined reference to `mbedtls_entropy_add_source'

/Users/kprabhuv/new_zephyr/subsys/net/lib/app/net_app.c:2358: undefined reference to `mbedtls_entropy_func'

libzephyr.a(net_app.c.obj): In function `_net_app_tls_handler_stop':

/Users/kprabhuv/new_zephyr/subsys/net/lib/app/net_app.c:2365: undefined reference to `mbedtls_entropy_free'

collect2: error: ld returned 1 exit status

make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1

make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2

make: *** [all] Error 2

 

 

Please look forward to some tips or advice.

 

Many Regards,

Karthik Prabhu Vinod

 

Help save the planet by choosing not to use single use plastics. Pick paper, bamboo or metal cutlery and carry your own bag to the grocery store. Every little thing you do makes an impact.


[mBed][TLS][MQTT][sam_e70_xplained]

Prabhu Vinod, Karthik
 

Hi,

 

I am trying to build the mqtt_publisher_subscriber app for sam_e70_xplained board. I was successfully able to connect to a cloud via TLS_v1_2 using a DER format.

 

But now, I am trying to switch to a more friendly PEM format by of course looking at the samples and it fails to connect. Also, unable to turn on the LOGGING for MBEDTLS modules, I wasn’t sure what’s causing the failure after the change to how logging works for NET & MBEDTLS modules

 

This is how I am assigning my PEM buffer

 

static const unsigned char ca_certificate[]=

"-----BEGIN CERTIFICATE-----\r\n"

"MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\r\n"

"MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\r\n"

"d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\r\n"

"QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\r\n"

"MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\r\n"

"b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\r\n"

"9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\r\n"

"CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\r\n"

"nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\r\n"

"43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\r\n"

"T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\r\n"

"gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\r\n"

"BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\r\n"

"TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\r\n"

"DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\r\n"

"hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\r\n"

"06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\r\n"

"PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\r\n"

"YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\r\n"

"CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\r\n"

"-----END CERTIFICATE-----\r\n";

 

 

Building my CA chain:

 

ret = mbedtls_x509_crt_parse(ca_cert, ca_certificate, sizeof(ca_certificate));

 

When I run build, the linker errors:

 

libzephyr.a(net_app.c.obj): In function `_net_app_tls_init':

/Users/kprabhuv/new_zephyr/subsys/net/lib/app/net_app.c:2221: undefined reference to `mbedtls_entropy_init'

/Users/kprabhuv/new_zephyr/subsys/net/lib/app/net_app.c:2230: undefined reference to `mbedtls_entropy_add_source'

/Users/kprabhuv/new_zephyr/subsys/net/lib/app/net_app.c:2358: undefined reference to `mbedtls_entropy_func'

libzephyr.a(net_app.c.obj): In function `_net_app_tls_handler_stop':

/Users/kprabhuv/new_zephyr/subsys/net/lib/app/net_app.c:2365: undefined reference to `mbedtls_entropy_free'

collect2: error: ld returned 1 exit status

make[2]: *** [zephyr/zephyr_prebuilt.elf] Error 1

make[1]: *** [zephyr/CMakeFiles/zephyr_prebuilt.dir/all] Error 2

make: *** [all] Error 2

 

 

Please look forward to some tips or advice.

 

Many Regards,

Karthik Prabhu Vinod

 

Help save the planet by choosing not to use single use plastics. Pick paper, bamboo or metal cutlery and carry your own bag to the grocery store. Every little thing you do makes an impact.


Re: DFU over UART #nrf52832

gurpreet+zephy@...
 

I tried this with v1.2.0 of mcuboot, as well as the latest master code. 


Re: DFU over UART #nrf52832

gurpreet+zephy@...
 

I've made some progress.
Once I get the device in serial mode I am able to start the mcumgr upload, but it constantly times out.

The RTT output from the dev board:
***** Booting Zephyr OS zephyr-v1.13.0-49-g121f323de *****
[MCUBOOT] [INF] main: Enter the serial recovery mode
[MCUBOOT] [INF] boot_serial_output: TX


And the mcumgr logs with debug ON:

zephyr (dfu_expt) 15:22:55>mcumgr -ldebug -t 60 --conntype=serial --connstring='dev=/dev/ttyACM0,baud=115200' image upload signed-hello1.bin
DEBU[2018-11-12 15:23:01.044] Using connection profile: name=unnamed type=serial connstring=dev=/dev/ttyACM0,baud=115200 
DEBU[2018-11-12 15:23:01.044] {add-oic-listener} [transceiver.go:64] token=[] 
DEBU[2018-11-12 15:23:01.044] {add-oic-listener} [transceiver.go:64] token=[] 
 0 / 47864 [---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------]   0.00%DEBU[2018-11-12 15:23:01.044] {add-nmp-listener} [serial_sesn.go:217] seq=66 
DEBU[2018-11-12 15:23:01.045] Encoded &{NmpBase:{hdr:{Op:2 Flags:0 Len:0 Group:1 Seq:66 Id:5}}} to:
00000000  a0                                                |.| 
DEBU[2018-11-12 15:23:01.045] Encoded:
00000000  02 00 00 01 00 01 42 05  a0                       |......B..| 
DEBU[2018-11-12 15:23:01.045] Tx NMP request: 00000000  02 00 00 01 00 01 42 05  a0                       |......B..| 
DEBU[2018-11-12 15:23:01.045] Base64 encoding request:
00000000  02 00 00 01 00 01 42 05  a0                       |......B..| 
DEBU[2018-11-12 15:23:01.045] Tx serial
00000000  06 09                                             |..| 
DEBU[2018-11-12 15:23:01.045] Tx serial
00000000  41 41 73 43 41 41 41 42  41 41 46 43 42 61 44 4d  |AAsCAAABAAFCBaDM|
00000010  6f 51 3d 3d                                       |oQ==| 
DEBU[2018-11-12 15:23:01.045] Tx serial
00000000  0a                                                |.| 
DEBU[2018-11-12 15:23:01.053] Rx serial:
00000000  06 09 41 42 41 44 41 41  41 47 41 41 46 34 65 44  |..ABADAAAGAAF4eD| 
 0 B / 46.74 KiB [----------------]   0.00%
DEBU[2018-11-12 15:23:28.019] Rx serial:                                   
 0 B / 46.74 KiB [----------------]   0.00%

This shows that the initial frame seems to be sent (as per https://github.com/apache/mynewt-mcumgr/blob/master/transport/smp-console.md#overview), but mcumgr fails to send the remaining bytes. 

Is there something I'm missing? 

-Gurpreet 


Re: getting started setting up Zephyr build environment on Ubuntu...errors

Robert Berger
 

Hi Eric,


I'm on Ubuntu 18.04 running on an Odroid xU4.  The reason I'm using this SBC is so I can make an image of the eMMc when it's all setup and I hope I won't have to go through this again.  And other people can spend $110 on the Odroid xU4 and just download the image and also be on their way in less than 10 minutes.  Totally worth it.
Well I tend to disagree on that since the way you hacked up your SD card is most likely totally non reproduce-able.

Also building stuff on the SD card is not reproduce-able.

Anyways.

If you want to come up with a development environment which can be shared and re-used I would look e.g. into containers e.g. something like this[1] (which seems a bit bit-rotten).

[1] https://github.com/crops/zephyr-container

Regards,

Robert


Re: getting started setting up Zephyr build environment on Ubuntu...errors

Carles Cufi
 

Hi Eric,

 

Building DTC from source is relatively simple.

 

$ git clone https://git.kernel.org/pub/scm/utils/dtc/dtc.git

$ cd dtc

$ make

$ make install

 

Carles

 

From: <users@...> on behalf of Andy Ross <andrew.j.ross@...>
Date: Saturday, 10 November 2018 at 16:32
To: Eric <ericmdwest@...>, "users@..." <users@...>
Subject: Re: [Zephyr-users] getting started setting up Zephyr build environment on Ubuntu...errors

 

So... the specific error you're getting is that the DeviceTree compiler on your build host is a bit stale.  But more broadly you're trying to build on a ARM host, and we don't have ARM binaries for the SDK.   Building with a custom toolchain is possible (I mean in theory the host gcc is probably on a Pi distro is probably configured with everything you need), but nontrivial and probably not a good fit for someone who doesn't want to learn about Zephyr or the toolchain.

Andy

On 11/9/2018 11:13 PM, Eric wrote:

Hello,
I'm completely new to Zephyr.  I want to make bluetooth mesh projects for Nordic nRF52840.  I'm going through the Getting Started guide, and (typical of how these things go) I'm getting errors not covered in the guide.

When I used mbed, this isn't a problem.  I just log in online, import someone's mbed project, compile, and use OpenOCD on a Raspberry Pi to load the firmware onto a nRF51822.

Is there a Raspberry Pi image that has everything setup and ready for you to just build binaries?  I think there are many in my situation - no interest in the build system, I'm just copying and pasting the instructions and hoping it works.  What I'm really interested in is learning about Bluetooth mesh, not Zephyr, or Eclipse, or any of the toolchain.  The getting started process isn't very valuable for me.  Is there an easier way?

I'm on Ubuntu 18.04 running on an Odroid xU4.  The reason I'm using this SBC is so I can make an image of the eMMc when it's all setup and I hope I won't have to go through this again.  And other people can spend $110 on the Odroid xU4 and just download the image and also be on their way in less than 10 minutes.  Totally worth it.

Here's my error.  I'm at the step of building the hello world for Arduino.  It saids my dtc version is too old.  But I don't know how to solve that.  apt-get tells me that the version 1.4.5-3 is the latest already (yes, I've updated).  I can't find a ready made pre-compiled updated DTC for the ODroid xu4.

odroid@odroid:~/zephyr$ cd zephyr/odroid@odroid:~/zephyr/zephyr$ lsCMakeLists.txt    LICENSE     boards   ext      samples  version.h.inCODEOWNERS        Makefile    cmake    include  scripts  zephyr-env.cmdCONTRIBUTING.rst  README.rst  doc      kernel   soc      zephyr-env.shKconfig           VERSION     drivers  lib      subsysKconfig.zephyr    arch        dts      misc     testsodroid@odroid:~/zephyr/zephyr$ source zephyr-env.shodroid@odroid:~/zephyr/zephyr$ cd samples/hello_worldodroid@odroid:~/zephyr/zephyr/samples/hello_world$ lsCMakeLists.txt  README.rst  prj.conf  sample.yaml  srcodroid@odroid:~/zephyr/zephyr/samples/hello_world$ mkdir build && cd buildodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ lsodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ cmake -GNinja -DBOARD=arduino_101 ..-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.6", minimum required is "3.4") -- Selected BOARD arduino_101Zephyr version: 1.13.99CMake Error at /home/odroid/zephyr/zephyr/cmake/extensions.cmake:1076 (message):  Assertion failed: The detected dtc version is unsupported.       The version was found to be 1.4.5       But the minimum supported version is 1.4.6       See  https://docs.zephyrproject.org/latest/getting_started/getting_started.html       for how to use the SDK's dtc alongside a custom toolchain.Call Stack (most recent call first):  /home/odroid/zephyr/zephyr/cmake/host-tools.cmake:24 (assert)  /home/odroid/zephyr/zephyr/cmake/app/boilerplate.cmake:270 (include)  CMakeLists.txt:3 (include)-- Configuring incomplete, errors occurred!odroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ ninjaninja: error: loading 'build.ninja': No such file or directoryodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ lsCMakeCache.txt  CMakeFilesodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$

 


Re: getting started setting up Zephyr build environment on Ubuntu...errors

Andy Ross
 

So... the specific error you're getting is that the DeviceTree compiler on your build host is a bit stale.  But more broadly you're trying to build on a ARM host, and we don't have ARM binaries for the SDK.   Building with a custom toolchain is possible (I mean in theory the host gcc is probably on a Pi distro is probably configured with everything you need), but nontrivial and probably not a good fit for someone who doesn't want to learn about Zephyr or the toolchain.

Andy

On 11/9/2018 11:13 PM, Eric wrote:
Hello,
I'm completely new to Zephyr.  I want to make bluetooth mesh projects for Nordic nRF52840.  I'm going through the Getting Started guide, and (typical of how these things go) I'm getting errors not covered in the guide.

When I used mbed, this isn't a problem.  I just log in online, import someone's mbed project, compile, and use OpenOCD on a Raspberry Pi to load the firmware onto a nRF51822.

Is there a Raspberry Pi image that has everything setup and ready for you to just build binaries?  I think there are many in my situation - no interest in the build system, I'm just copying and pasting the instructions and hoping it works.  What I'm really interested in is learning about Bluetooth mesh, not Zephyr, or Eclipse, or any of the toolchain.  The getting started process isn't very valuable for me.  Is there an easier way?

I'm on Ubuntu 18.04 running on an Odroid xU4.  The reason I'm using this SBC is so I can make an image of the eMMc when it's all setup and I hope I won't have to go through this again.  And other people can spend $110 on the Odroid xU4 and just download the image and also be on their way in less than 10 minutes.  Totally worth it.

Here's my error.  I'm at the step of building the hello world for Arduino.  It saids my dtc version is too old.  But I don't know how to solve that.  apt-get tells me that the version 1.4.5-3 is the latest already (yes, I've updated).  I can't find a ready made pre-compiled updated DTC for the ODroid xu4.

odroid@odroid:~/zephyr$ cd zephyr/odroid@odroid:~/zephyr/zephyr$ lsCMakeLists.txt    LICENSE     boards   ext      samples  version.h.inCODEOWNERS        Makefile    cmake    include  scripts  zephyr-env.cmdCONTRIBUTING.rst  README.rst  doc      kernel   soc      zephyr-env.shKconfig           VERSION     drivers  lib      subsysKconfig.zephyr    arch        dts      misc     testsodroid@odroid:~/zephyr/zephyr$ source zephyr-env.shodroid@odroid:~/zephyr/zephyr$ cd samples/hello_worldodroid@odroid:~/zephyr/zephyr/samples/hello_world$ lsCMakeLists.txt  README.rst  prj.conf  sample.yaml  srcodroid@odroid:~/zephyr/zephyr/samples/hello_world$ mkdir build && cd buildodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ lsodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ cmake -GNinja -DBOARD=arduino_101 ..-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.6", minimum required is "3.4") -- Selected BOARD arduino_101Zephyr version: 1.13.99CMake Error at /home/odroid/zephyr/zephyr/cmake/extensions.cmake:1076 (message):  Assertion failed: The detected dtc version is unsupported.       The version was found to be 1.4.5       But the minimum supported version is 1.4.6       See  https://docs.zephyrproject.org/latest/getting_started/getting_started.html       for how to use the SDK's dtc alongside a custom toolchain.Call Stack (most recent call first):  /home/odroid/zephyr/zephyr/cmake/host-tools.cmake:24 (assert)  /home/odroid/zephyr/zephyr/cmake/app/boilerplate.cmake:270 (include)  CMakeLists.txt:3 (include)-- Configuring incomplete, errors occurred!odroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ ninjaninja: error: loading 'build.ninja': No such file or directoryodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ lsCMakeCache.txt  CMakeFilesodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$


getting started setting up Zephyr build environment on Ubuntu...errors

Eric
 

Hello,
I'm completely new to Zephyr.  I want to make bluetooth mesh projects for Nordic nRF52840.  I'm going through the Getting Started guide, and (typical of how these things go) I'm getting errors not covered in the guide.

When I used mbed, this isn't a problem.  I just log in online, import someone's mbed project, compile, and use OpenOCD on a Raspberry Pi to load the firmware onto a nRF51822.

Is there a Raspberry Pi image that has everything setup and ready for you to just build binaries?  I think there are many in my situation - no interest in the build system, I'm just copying and pasting the instructions and hoping it works.  What I'm really interested in is learning about Bluetooth mesh, not Zephyr, or Eclipse, or any of the toolchain.  The getting started process isn't very valuable for me.  Is there an easier way?

I'm on Ubuntu 18.04 running on an Odroid xU4.  The reason I'm using this SBC is so I can make an image of the eMMc when it's all setup and I hope I won't have to go through this again.  And other people can spend $110 on the Odroid xU4 and just download the image and also be on their way in less than 10 minutes.  Totally worth it.

Here's my error.  I'm at the step of building the hello world for Arduino.  It saids my dtc version is too old.  But I don't know how to solve that.  apt-get tells me that the version 1.4.5-3 is the latest already (yes, I've updated).  I can't find a ready made pre-compiled updated DTC for the ODroid xu4.

odroid@odroid:~/zephyr$ cd zephyr/odroid@odroid:~/zephyr/zephyr$ lsCMakeLists.txt    LICENSE     boards   ext      samples  version.h.inCODEOWNERS        Makefile    cmake    include  scripts  zephyr-env.cmdCONTRIBUTING.rst  README.rst  doc      kernel   soc      zephyr-env.shKconfig           VERSION     drivers  lib      subsysKconfig.zephyr    arch        dts      misc     testsodroid@odroid:~/zephyr/zephyr$ source zephyr-env.shodroid@odroid:~/zephyr/zephyr$ cd samples/hello_worldodroid@odroid:~/zephyr/zephyr/samples/hello_world$ lsCMakeLists.txt  README.rst  prj.conf  sample.yaml  srcodroid@odroid:~/zephyr/zephyr/samples/hello_world$ mkdir build && cd buildodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ lsodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ cmake -GNinja -DBOARD=arduino_101 ..-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.6", minimum required is "3.4") -- Selected BOARD arduino_101Zephyr version: 1.13.99CMake Error at /home/odroid/zephyr/zephyr/cmake/extensions.cmake:1076 (message):  Assertion failed: The detected dtc version is unsupported.       The version was found to be 1.4.5       But the minimum supported version is 1.4.6       See  https://docs.zephyrproject.org/latest/getting_started/getting_started.html       for how to use the SDK's dtc alongside a custom toolchain.Call Stack (most recent call first):  /home/odroid/zephyr/zephyr/cmake/host-tools.cmake:24 (assert)  /home/odroid/zephyr/zephyr/cmake/app/boilerplate.cmake:270 (include)  CMakeLists.txt:3 (include)-- Configuring incomplete, errors occurred!odroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ ninjaninja: error: loading 'build.ninja': No such file or directoryodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$ lsCMakeCache.txt  CMakeFilesodroid@odroid:~/zephyr/zephyr/samples/hello_world/build$


Re: How to setup the host system to debug via west gdbserver and Eclipse IDE? #west #gdb #eclipse

Stefan Jaritz
 

Merci


Port 3333 was the missing detail :D

A small add:

Debugging with the "C/C++ Remote Application" have problems resolving symbols and code. You get errors like that:

"""

Using runner: openocd
Open On-Chip Debugger 0.10.0+dev-gea2753a7-dirty (2018-11-02-23:37)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
use the st link v2 cfg
set target to stm32f4x
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v27 API v2 SWIM v6 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.300981
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
    TargetName         Type       Endian TapName            State      
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32f4x.cpu       hla_target little stm32f4x.cpu       running
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080083a0 msp: 0x200038e0
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection on tcp/3333
Debugger attaching: halting execution
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080083a0 msp: 0x200038e0
force hard breakpoints
Info : device id = 0x30006441
Info : flash size = 1024kbytes
Error: Cortex-M Flash Patch Breakpoint rev.1 cannot handle HW breakpoint above address 0x1FFFFFFE
Error: can't add breakpoint: unknown reason
"""


The "GDB OpenOCD Debugging"(https://gnu-mcu-eclipse.github.io/debug/openocd/) Plugin works much better. It sets the firmware binary sources right and the RAM memory access.

You can access the openOCD server started by west or start it on your own. I attached a screenshot with the eclipse settings for everyone who likes to know.


Regards!

Stefan


On 08/11/2018 20:02, Marti Bolivar wrote:
Hi,
On Thu, Nov 8, 2018 at 11:40 AM Stefan Jaritz <stefan@...> wrote:
Hej,

Currently I am trying to figure out how to setup the debugger by the use
of west. I manage to start the west debug server but I failed to connect.

Maybe I am missing something or anyone having the same problem.

My steps & workflow:

"setup zephyr"

1.) open terminal

2.) set environment by "source zephyr-env.sh"

3.) build my project

4.) run "west debugserver" from my build dir

"""


"""

"setup ide"

5.) open eclipse without setting the environment

6.) create a new debug config

6.1) set in Debugger tab:

6.1.1) Debugger >> gdbserver

6.1.2) Main >> "gdb Debugger": =
/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gdb
6.1.3) Connection >> "host name" = localhost
6.1.4) Connection >> "port" = 6666
Looks like eclipse is set up to use port 6666 for the GDB connection...


Eclipse fails to connect with:

"""

Error in final launch sequence:

Failed to execute MI command:
-target-select extended-remote localhost:6666
Error message from debugger back end:
Remote replied unexpectedly to 'vMustReplyEmpty': timeout
Failed to execute MI command:
-target-select extended-remote localhost:6666
Error message from debugger back end:
Remote replied unexpectedly to 'vMustReplyEmpty': timeout
Remote replied unexpectedly to 'vMustReplyEmpty': timeout

"""

The west console print:
"""

[100%] Built target kernel_elf
Using runner: openocd
Open On-Chip Debugger 0.10.0+dev-gea2753a7-dirty (2018-11-02-23:37)
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
use the st link v2 cfg
set target to stm32f4x
Info : The selected transport took over low-level target control. The
results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v27 API v2 SWIM v6 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.521022
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
But 3333 is what is open for incoming gdb connections.

     TargetName         Type       Endian TapName State
--  ------------------ ---------- ------ ------------------ ------------
  0* stm32f4x.cpu       hla_target little stm32f4x.cpu       halted
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080082cc msp: 0x200038e0
Info : Listening on port 6666 for tcl connections
It seems openocd has opened 6666 for tcl, not gdb.

If you can change your eclipse configuration to use port 3333, it
should work. Otherwise, since you are using the openocd runner, you
can provide the --tcl-port and --gdb-port options to west debugserver
to change the gdb port to 6666 and the tcl port to something else.

From your build directory, you can obtain context-sensitive help
output about your debugserver configuration with:

$ west debugserver --context

That will print the configuration as well as any openocd-specific
options you can provide to west debugserver.

Hope this helps,
Marti

Info : Listening on port 4444 for telnet connections
Info : accepting 'tcl' connection on tcp/6666

"""

Any ideas how to get the combination of west & eclipse for dbg done?


There is a nice document describing the first steps with west.

https://docs.zephyrproject.org/latest/west/flash-debug.html#debugging-west-debug-west-debugserver

Stef





Testing connection with long connection intervals and slave latency #ble #nrf52840

Phil Hipp
 

Hey everybody,

I want to test a connection with following parameters:

conn min = 800 (1s)
conn max = 800 (1s)
slave latency = 4
timeout = 3200

In this scenario no actual data will be send (only Empty Link Layer PDUs). So the Master is sending an Empty Link Layer PDU every 1s. The Slave will only listen every 5th connection event (every 5s) and respond with its own Empty Link Layer PDU. For my test, I want to toggle a Port Pin when the Slave has sent its Empty Link Layer PDU. Is there any callback that will get called after sending this PDU or is there any other way to achieve this?

Best

Phil


Re: How to setup the host system to debug via west gdbserver and Eclipse IDE? #west #gdb #eclipse

Marti Bolivar <marti@...>
 

Hi,
On Thu, Nov 8, 2018 at 11:40 AM Stefan Jaritz <stefan@...> wrote:

Hej,

Currently I am trying to figure out how to setup the debugger by the use
of west. I manage to start the west debug server but I failed to connect.

Maybe I am missing something or anyone having the same problem.

My steps & workflow:

"setup zephyr"

1.) open terminal

2.) set environment by "source zephyr-env.sh"

3.) build my project

4.) run "west debugserver" from my build dir

"""


"""

"setup ide"

5.) open eclipse without setting the environment

6.) create a new debug config

6.1) set in Debugger tab:

6.1.1) Debugger >> gdbserver

6.1.2) Main >> "gdb Debugger": =
/opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gdb
6.1.3) Connection >> "host name" = localhost
6.1.4) Connection >> "port" = 6666
Looks like eclipse is set up to use port 6666 for the GDB connection...



Eclipse fails to connect with:

"""

Error in final launch sequence:

Failed to execute MI command:
-target-select extended-remote localhost:6666
Error message from debugger back end:
Remote replied unexpectedly to 'vMustReplyEmpty': timeout
Failed to execute MI command:
-target-select extended-remote localhost:6666
Error message from debugger back end:
Remote replied unexpectedly to 'vMustReplyEmpty': timeout
Remote replied unexpectedly to 'vMustReplyEmpty': timeout

"""

The west console print:
"""

[100%] Built target kernel_elf
Using runner: openocd
Open On-Chip Debugger 0.10.0+dev-gea2753a7-dirty (2018-11-02-23:37)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
use the st link v2 cfg
set target to stm32f4x
Info : The selected transport took over low-level target control. The
results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v27 API v2 SWIM v6 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.521022
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
But 3333 is what is open for incoming gdb connections.

TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0* stm32f4x.cpu hla_target little stm32f4x.cpu halted
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080082cc msp: 0x200038e0
Info : Listening on port 6666 for tcl connections
It seems openocd has opened 6666 for tcl, not gdb.

If you can change your eclipse configuration to use port 3333, it
should work. Otherwise, since you are using the openocd runner, you
can provide the --tcl-port and --gdb-port options to west debugserver
to change the gdb port to 6666 and the tcl port to something else.

From your build directory, you can obtain context-sensitive help
output about your debugserver configuration with:

$ west debugserver --context

That will print the configuration as well as any openocd-specific
options you can provide to west debugserver.

Hope this helps,
Marti

Info : Listening on port 4444 for telnet connections
Info : accepting 'tcl' connection on tcp/6666

"""

Any ideas how to get the combination of west & eclipse for dbg done?


There is a nice document describing the first steps with west.

https://docs.zephyrproject.org/latest/west/flash-debug.html#debugging-west-debug-west-debugserver

Stef




How to setup the host system to debug via west gdbserver and Eclipse IDE? #west #gdb #eclipse

Stefan Jaritz
 

Hej,

Currently I am trying to figure out how to setup the debugger by the use of west. I manage to start the west debug server but I failed to connect.

Maybe I am missing something or anyone having the same problem.

My steps & workflow:

"setup zephyr"

1.) open terminal

2.) set environment by "source zephyr-env.sh"

3.) build my project

4.) run "west debugserver" from my build dir

"""


"""

"setup ide"

5.) open eclipse without setting the environment

6.) create a new debug config

6.1) set in Debugger tab:

6.1.1) Debugger >> gdbserver

6.1.2) Main >> "gdb Debugger": = /opt/zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/bin/arm-zephyr-eabi/arm-zephyr-eabi-gdb
6.1.3) Connection >> "host name" = localhost
6.1.4) Connection >> "port" = 6666


Eclipse fails to connect with:

"""

Error in final launch sequence:

Failed to execute MI command:
-target-select extended-remote localhost:6666
Error message from debugger back end:
Remote replied unexpectedly to 'vMustReplyEmpty': timeout
Failed to execute MI command:
-target-select extended-remote localhost:6666
Error message from debugger back end:
Remote replied unexpectedly to 'vMustReplyEmpty': timeout
Remote replied unexpectedly to 'vMustReplyEmpty': timeout

"""

The west console print:
"""

[100%] Built target kernel_elf
Using runner: openocd
Open On-Chip Debugger 0.10.0+dev-gea2753a7-dirty (2018-11-02-23:37)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
use the st link v2 cfg
set target to stm32f4x
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v27 API v2 SWIM v6 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.521022
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
    TargetName         Type       Endian TapName State
--  ------------------ ---------- ------ ------------------ ------------
 0* stm32f4x.cpu       hla_target little stm32f4x.cpu       halted
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080082cc msp: 0x200038e0
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'tcl' connection on tcp/6666

"""

Any ideas how to get the combination of west & eclipse for dbg done?


There is a nice document describing the first steps with west.

https://docs.zephyrproject.org/latest/west/flash-debug.html#debugging-west-debug-west-debugserver

Stef


Re: PTP over BLE

david <david@...>
 

Hi Jukka,

Nothing that I'm aware of (perhaps some future plans on the SIG for upcoming standards)

I'd like to investigate the interest of this though. In our case, we own both sides (running nordic ICs), so here we could broadcast timestamps independent of the LE LL, using something like the time-slot api available in the softdevice sdk. Not up2speed with zephyr really so any guidance on best approach would be much appreciated.

In a way, mimicking how AVB does things would perhaps be a good thing as there might be mixed use-cases with devices equipped with either ethernet or bluetooth LE.


/d

On 27 Aug 2018, at 16:39, Jukka Rissanen <jukka.rissanen@...> wrote:

Hi David,

I have not heard anyone trying to use PTP over BLE. Patches are welcome
of course if there are good use cases for this. Is there a spec that
specifies how to run PTP over BLE?


Cheers,
Jukka


On Mon, 2018-08-27 at 16:12 +0200, via Lists.Zephyrproject.Org wrote:
Hi,

I saw that Precision Time Protocol was just added, great!

Has anyone been looking at a "generic" way to achieve a distributed
precision clock over BLE?

In my use-case it would be ok to limit it to the nordics, similar to
what could be done with the time-slot API (using BLE for
data/commands) and raw radio for sync.. But perhaps there are smarter
ways to achieve the same.


best David


Unable to run the coap-client sample

li_paige@...
 

Hello,

I'm trying the Networking samples and demos with Zephyr.
I successfully compile and run some samples but I have some difficulty in the networking samples.
I am following the instructions here: https://docs.zephyrproject.org/latest/samples/net/coap_client/README.html calling

cmake -GNinja -DBOARD=qemu_riscv32 ..
ninja

The 'ninja' step is failing and I am getting this error message:
zephyr/drivers/console/uart_pipe.c: In function ‘uart_pipe_register’: zephyr/drivers/console/uart_pipe.c:94:37: error: ‘CONFIG_UART_PIPE_ON_DEV_NAME’ undeclared (first use in this function) uart_pipe_dev = device_get_binding(CONFIG_UART_PIPE_ON_DEV_NAME); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Any idea how I can properly set it?

Thanks,
Paige


NRF52840 Timer driver #nrf52840

Phil Hipp
 

Hey everybody,

I need to use the TIMER peripheral of the NRF52840 to produce an interrupt after a specific amount of microseconds. It seems there is no timer driver in zephyr, but I can found the HAL sources for that in /zephyr/ext/hal/nordic/nrfx/drivers/src/nrfx_timer.c.

What would be the best way to implement and use a timer?


Re: DFU over UART #nrf52832

gurpreet+zephy@...
 

Thanks Andrzej and Carles. 
I tried these steps but had some compiler errors with 
CONFIG_SOC_NRF52840_QIAA=y
enabled.
warning: the value '' is invalid for UART_0_NRF_TX_PIN (defined at /home/gps/src/zephyr/boards/arm/nrf52_pca10040/Kconfig.defconfig:14, drivers/serial/Kconfig.nrfx:62), which has type int -- assignment ignored
 
warning: the value '' is invalid for UART_0_NRF_RX_PIN (defined at /home/gps/src/zephyr/boards/arm/nrf52_pca10040/Kconfig.defconfig:17, drivers/serial/Kconfig.nrfx:69), which has type int -- assignment ignored
 
Error: Aborting due to non-whitelisted Kconfig warning 'warning: the value '' is invalid for
UART_0_NRF_TX_PIN (defined at /home/gps/src/zephyr/boards/arm/nrf52_pca10040/Kconfig.defconfig:14,
drivers/serial/Kconfig.nrfx:62), which has type int -- assignment ignored'. Note: If this warning
Once I disabled this, the code successfully compiled. I then proceeded to add a serial interface to mcumgr as follows:
>mcumgr conn show
Connection profiles: 
  myserial-nrf: type=serial, connstring='dev=/dev/ttyACM0,baud=115200'

But when i try to run it, there is a timeout. 
>mcumgr -c "myserial-nrf" image list
Error: NMP timeout
 
Note, the same command works with BLE. 

>mcumgr --conntype ble --connstring 'peer_name=Zephyr' image list 
Images:
 slot=0
    version: 1.2.0
    bootable: true
    flags: active confirmed
    hash: 5d0888224321f9734009ab06a0b11c76e5f0303baaad421534f99de590ec0123
Split status: N/A (0)

Any thoughts on what I may be doing wrong here? 

Thanks in advance,
Gurpreet 


Re: DFU over UART #nrf52832

Puzdrowski, Andrzej <Andrzej.Puzdrowski@...>
 

Bellow the minimal config I used. As you can see I disabled channel sharing between shell and SMP. Shell is switched to RTT.

 

CONFIG_SOC_SERIES_NRF52X=y

CONFIG_SOC_NRF52840_QIAA=y

CONFIG_ARM_MPU=y

CONFIG_ARM=y

CONFIG_THREAD_MONITOR=y

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

CONFIG_CONSOLE=y

CONFIG_RTT_CONSOLE=y

CONFIG_SERIAL=y

CONFIG_UART_NRFX=y

CONFIG_UART_0_NRF_UART=y

CONFIG_ENTROPY_NRF5_THR_THRESHOLD=4

CONFIG_ENTROPY_NRF5_ISR_THRESHOLD=12

CONFIG_ENTROPY_NRF5_THR_BUF_LEN=4

CONFIG_ENTROPY_NRF5_ISR_BUF_LEN=12

CONFIG_STATS=y

CONFIG_STATS_NAMES=y

CONFIG_BOOTLOADER_MCUBOOT=y

CONFIG_BT_RX_BUF_LEN=260

CONFIG_BT_L2CAP_TX_MTU=260

CONFIG_BT_CTLR=y

CONFIG_FILE_SYSTEM=y

CONFIG_FILE_SYSTEM_NFFS=y

CONFIG_FS_NFFS_FLASH_DEV_NAME="NRF_FLASH_DRV_NAME"

CONFIG_MCUMGR_SMP_BT=y

CONFIG_MCUMGR_SMP_UART=y

CONFIG_NET_BUF_USER_DATA_SIZE=7

CONFIG_CONSOLE_SHELL=y

CONFIG_MCUMGR_CMD_FS_MGMT=y

CONFIG_MCUMGR_CMD_IMG_MGMT=y

CONFIG_MCUMGR_CMD_OS_MGMT=y

CONFIG_MCUMGR_CMD_STAT_MGMT=y

 

From: Puzdrowski, Andrzej
Sent: Tuesday, November 06, 2018 12:32 PM
To: Cufi, Carles <Carles.Cufi@...>; gurpreet+zephy@...; users@...
Subject: RE: [Zephyr-users] DFU over UART #nrf52832

 

I believe that uart and BT channel are available out of the box for this sample. Uart is shared between SMP protocol and the Shell thank to CONFIG_MCUMGR_SMP_SHELL=y.

If you switch of this option the you need to enable SMP serial on its own (so CONFIG_MCUMGR_SMP_UART=y) and disable uart as shell channel.

 

From: Cufi, Carles
Sent: Tuesday, November 06, 2018 12:07 PM
To: gurpreet+zephy@...; users@...; Puzdrowski, Andrzej <Andrzej.Puzdrowski@...>
Subject: RE: [Zephyr-users] DFU over UART #nrf52832

 

Hi there,

 

I believe that if you enable DFU over serial then the shell is not available, because the protocol takes over.

I’ve added Andrzej on copy.

 

Carles

 

From: users@... <users@...> On Behalf Of gurpreet+zephy@...
Sent: 05 November 2018 18:47
To: users@...
Subject: [Zephyr-users] DFU over UART #nrf52832

 

Hi,

I'm trying to build an app that can be upgraded over UART. I see the smp_svr sample has an example of doing this over BT, and I could get that to work.
I've tweaked the prj.conf to add the line 
CONFIG_MCUMGR_SMP_UART=y

I've also disabled CONFIG_MCUMGR_SMP_BT just to prevent things from getting confusing. 

My nrf52 has an mcuboot which was obtained from https://github.com/runtimeco/mcuboot
I then sign and build my modified smp_svr image and then flash it to the device. 

I see the following on console

***** Booting Zephyr OS zephyr-v1.13.0-6-g497974b8b *****

Zephyr Shell, Zephyr version: 1.13.0

Type 'help' for a list of available commands

shell> Bluetooth initialized

Advertising failed to start (rc -5)


the console, however is read only - I cant access the shell. This is all on the nRF52 dev board.
I'm using Ubuntu 18.04 as my host environment. 

My questions:
1. Is there some step I'm missing to allow device upgrades over UART? 
2. Do I need to do anything in particular for 2-way access to the shell

For reference, my prj.conf is:

# Enable mcumgr.

CONFIG_MCUMGR=y

 

# Some command handlers require a large stack.

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

 

# Ensure an MCUboot-compatible binary is generated.

CONFIG_BOOTLOADER_MCUBOOT=y

 

# Allow for large Bluetooth data packets.

CONFIG_BT_L2CAP_TX_MTU=260

CONFIG_BT_RX_BUF_LEN=260

 

# Enable the Bluetooth and shell mcumgr transports.

#CONFIG_MCUMGR_SMP_BT=y

CONFIG_MCUMGR_SMP_SHELL=y

CONFIG_MCUMGR_SMP_UART=y

 

# Bluetooth support requires a net_buf user_data size >= 7.

CONFIG_NET_BUF_USER_DATA_SIZE=7

 

# Enable flash operations.

CONFIG_FLASH=y

 

# Enable the NFFS file system.

CONFIG_FILE_SYSTEM=y

CONFIG_FILE_SYSTEM_NFFS=y

 

# Required by the `taskstat` command.

CONFIG_THREAD_MONITOR=y

 

# Enable statistics and statistic names.

CONFIG_STATS=y

CONFIG_STATS_NAMES=y

 

# Enable all core commands.

CONFIG_MCUMGR_CMD_FS_MGMT=y

CONFIG_MCUMGR_CMD_IMG_MGMT=y

CONFIG_MCUMGR_CMD_OS_MGMT=y

CONFIG_MCUMGR_CMD_STAT_MGMT=y

 

### nRF5 specific settings

 

# Specify the location of the NFFS file system.

CONFIG_FS_NFFS_FLASH_DEV_NAME="NRF_FLASH_DRV_NAME"

Thanks in advance..
Gurpreet 


Re: DFU over UART #nrf52832

Puzdrowski, Andrzej <Andrzej.Puzdrowski@...>
 

I believe that uart and BT channel are available out of the box for this sample. Uart is shared between SMP protocol and the Shell thank to CONFIG_MCUMGR_SMP_SHELL=y.

If you switch of this option the you need to enable SMP serial on its own (so CONFIG_MCUMGR_SMP_UART=y) and disable uart as shell channel.

 

From: Cufi, Carles
Sent: Tuesday, November 06, 2018 12:07 PM
To: gurpreet+zephy@...; users@...; Puzdrowski, Andrzej <Andrzej.Puzdrowski@...>
Subject: RE: [Zephyr-users] DFU over UART #nrf52832

 

Hi there,

 

I believe that if you enable DFU over serial then the shell is not available, because the protocol takes over.

I’ve added Andrzej on copy.

 

Carles

 

From: users@... <users@...> On Behalf Of gurpreet+zephy@...
Sent: 05 November 2018 18:47
To: users@...
Subject: [Zephyr-users] DFU over UART #nrf52832

 

Hi,

I'm trying to build an app that can be upgraded over UART. I see the smp_svr sample has an example of doing this over BT, and I could get that to work.
I've tweaked the prj.conf to add the line 
CONFIG_MCUMGR_SMP_UART=y

I've also disabled CONFIG_MCUMGR_SMP_BT just to prevent things from getting confusing. 

My nrf52 has an mcuboot which was obtained from https://github.com/runtimeco/mcuboot
I then sign and build my modified smp_svr image and then flash it to the device. 

I see the following on console

***** Booting Zephyr OS zephyr-v1.13.0-6-g497974b8b *****

Zephyr Shell, Zephyr version: 1.13.0

Type 'help' for a list of available commands

shell> Bluetooth initialized

Advertising failed to start (rc -5)


the console, however is read only - I cant access the shell. This is all on the nRF52 dev board.
I'm using Ubuntu 18.04 as my host environment. 

My questions:
1. Is there some step I'm missing to allow device upgrades over UART? 
2. Do I need to do anything in particular for 2-way access to the shell

For reference, my prj.conf is:

# Enable mcumgr.

CONFIG_MCUMGR=y

 

# Some command handlers require a large stack.

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

 

# Ensure an MCUboot-compatible binary is generated.

CONFIG_BOOTLOADER_MCUBOOT=y

 

# Allow for large Bluetooth data packets.

CONFIG_BT_L2CAP_TX_MTU=260

CONFIG_BT_RX_BUF_LEN=260

 

# Enable the Bluetooth and shell mcumgr transports.

#CONFIG_MCUMGR_SMP_BT=y

CONFIG_MCUMGR_SMP_SHELL=y

CONFIG_MCUMGR_SMP_UART=y

 

# Bluetooth support requires a net_buf user_data size >= 7.

CONFIG_NET_BUF_USER_DATA_SIZE=7

 

# Enable flash operations.

CONFIG_FLASH=y

 

# Enable the NFFS file system.

CONFIG_FILE_SYSTEM=y

CONFIG_FILE_SYSTEM_NFFS=y

 

# Required by the `taskstat` command.

CONFIG_THREAD_MONITOR=y

 

# Enable statistics and statistic names.

CONFIG_STATS=y

CONFIG_STATS_NAMES=y

 

# Enable all core commands.

CONFIG_MCUMGR_CMD_FS_MGMT=y

CONFIG_MCUMGR_CMD_IMG_MGMT=y

CONFIG_MCUMGR_CMD_OS_MGMT=y

CONFIG_MCUMGR_CMD_STAT_MGMT=y

 

### nRF5 specific settings

 

# Specify the location of the NFFS file system.

CONFIG_FS_NFFS_FLASH_DEV_NAME="NRF_FLASH_DRV_NAME"

Thanks in advance..
Gurpreet 


Re: DFU over UART #nrf52832

Carles Cufi
 

Hi there,

 

I believe that if you enable DFU over serial then the shell is not available, because the protocol takes over.

I’ve added Andrzej on copy.

 

Carles

 

From: users@... <users@...> On Behalf Of gurpreet+zephy@...
Sent: 05 November 2018 18:47
To: users@...
Subject: [Zephyr-users] DFU over UART #nrf52832

 

Hi,

I'm trying to build an app that can be upgraded over UART. I see the smp_svr sample has an example of doing this over BT, and I could get that to work.
I've tweaked the prj.conf to add the line 
CONFIG_MCUMGR_SMP_UART=y

I've also disabled CONFIG_MCUMGR_SMP_BT just to prevent things from getting confusing. 

My nrf52 has an mcuboot which was obtained from https://github.com/runtimeco/mcuboot
I then sign and build my modified smp_svr image and then flash it to the device. 

I see the following on console

***** Booting Zephyr OS zephyr-v1.13.0-6-g497974b8b *****

Zephyr Shell, Zephyr version: 1.13.0

Type 'help' for a list of available commands

shell> Bluetooth initialized

Advertising failed to start (rc -5)


the console, however is read only - I cant access the shell. This is all on the nRF52 dev board.
I'm using Ubuntu 18.04 as my host environment. 

My questions:
1. Is there some step I'm missing to allow device upgrades over UART? 
2. Do I need to do anything in particular for 2-way access to the shell

For reference, my prj.conf is:

# Enable mcumgr.

CONFIG_MCUMGR=y

 

# Some command handlers require a large stack.

CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

 

# Ensure an MCUboot-compatible binary is generated.

CONFIG_BOOTLOADER_MCUBOOT=y

 

# Allow for large Bluetooth data packets.

CONFIG_BT_L2CAP_TX_MTU=260

CONFIG_BT_RX_BUF_LEN=260

 

# Enable the Bluetooth and shell mcumgr transports.

#CONFIG_MCUMGR_SMP_BT=y

CONFIG_MCUMGR_SMP_SHELL=y

CONFIG_MCUMGR_SMP_UART=y

 

# Bluetooth support requires a net_buf user_data size >= 7.

CONFIG_NET_BUF_USER_DATA_SIZE=7

 

# Enable flash operations.

CONFIG_FLASH=y

 

# Enable the NFFS file system.

CONFIG_FILE_SYSTEM=y

CONFIG_FILE_SYSTEM_NFFS=y

 

# Required by the `taskstat` command.

CONFIG_THREAD_MONITOR=y

 

# Enable statistics and statistic names.

CONFIG_STATS=y

CONFIG_STATS_NAMES=y

 

# Enable all core commands.

CONFIG_MCUMGR_CMD_FS_MGMT=y

CONFIG_MCUMGR_CMD_IMG_MGMT=y

CONFIG_MCUMGR_CMD_OS_MGMT=y

CONFIG_MCUMGR_CMD_STAT_MGMT=y

 

### nRF5 specific settings

 

# Specify the location of the NFFS file system.

CONFIG_FS_NFFS_FLASH_DEV_NAME="NRF_FLASH_DRV_NAME"

Thanks in advance..
Gurpreet