Date   

Re: hci interface stopped working after few hours #ble #hci #nrf52480 #uart

Chettimada, Vinayak Kariappa
 

Hi, Both Mayank and Jamie,

 

I am interested in the way the HCI packets are transported to the Host Bluetooth stack.

 

In case of use of nRF DKs and Dongle, if using JLink debugger host firmware, you need to disable the Mass storage device (I don’t remember, it is something to do with 64-byte USB frames).

Hence, my request to try with MBED debugger host firmware which is a different UART to USB implementation.

 

In case using custom UART to USB, like FTDI, do you wire the CTS/RTS and using hardware flow control?

 

Same for the TTL connections, correct CTS/RTS and hardware flow control is essential.

 

The rationale being, observed HCI timeout and HCI framing errors indicate corrupted UART traffic.

 

Regards,

Vinayak

 

From: devel@... <devel@...> On Behalf Of lairdjm via Lists.Zephyrproject.Org
Sent: 05 March 2020 17:34
To: Cufi, Carles <Carles.Cufi@...>; Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...>; mayank7117@...; devel@...
Cc: devel@...
Subject: Re: [Zephyr-devel] hci interface stopped working after few hours #ble #hci #nrf52480 #uart

 

Hi Carles,

I was assuming it was aimed at both of us, I’m not sure about what hardware they’re using. I’ll give it a try tomorrow with the hardware I have and see if it’s working with the latest branch of zephyr.

Thanks,

Jamie


Re: Zephyr base improvement / improved Zephyr user experience

Rasmussen, Torsten
 

To test the PR: https://github.com/zephyrproject-rtos/zephyr/pull/23054

Just checkout the PR in an existing Zephyr project workspace, and run the extension command:

west zephyr-export

Then you can try build any sample.
Note, this is a one time command to run.


Zephyr Toolchain Working Group Meeting – 05 March 2020

Rasmussen, Torsten
 

Hi,

 

Today’s meeting minutes:

https://docs.google.com/document/d/1IQKBK-GcJNZG0O9QArqYfvb6Huk5xHscN-XIGEZr-z8/

Notes/Minutes

Status updates

  • Status update from Wayne regarding PR#22668
    • Status and work done / challenges / improvements are well described in the PR https://github.com/zephyrproject-rtos/zephyr/pull/22668
    • Main points are
      • Improve documentation in Zephyr on how to pass first compiler check in CMake
      • What compile optimization are mandatory and which are optional
      • Why are certain gcc extensions used

Would be nice to know the reason / get explanation

    • Linker:
      • Linker primitives not supported in MWDT

 

  • Status update from Thomas regarding IAR: Nothing new. regarding PR#22668

 

General discussion regarding toolchain support

  • CI support for commercial / other toolchains
    • For Metaware, CI would need the toolchain install and thus Zephyr community needs a license
      • A practice must be established with regards to commercial toolchain licenses which also satisfies vendor requirements
    • It will not be practical to run CI with all commercial toolchains supported.
    • Vendor of toolchain must be responsible for testing samples with the toolchain
    • Dedicate CI to run PR touching toolchain / manually run
    • Zephyr community should create a dedicated toolchain test that can verify basic toolchain functionality is working
    • Toolchain oriented test cases
  • IAR open to contribute static analysis tools, C-STAT to Zephyr
    • This is part of IAR compiler when having correct license

 

  • Linker Meta-language / templating
    • Find inspiration in how mbed / TF-M / cmsis does linking template.
    • TF-M has support for: IAR, clang, gcc (Requires vendor specific templates)
    • Mbed has support for three compiler: IAR, Arm compiler 6 (LLVM), gcc
    • Work must be expected in Zephyr regarding special gnu linker flags, as example: --whole-archive
    • Offset calculation may be confusing to some compilers, see action point.
    • The way gperf is used inZephyr linking stages is very hard to do in other linkers.

 

  • Short term goals:
    • Dedicated toolchain test cases, 
      • DTS
      • Kconfig
      • Linker
    • Label PR for automatic execution of CI Toolchain test cases
  • Long term goal
    • Meta language for Zephyr linking or templating system

 

Actions

  • Clean-up offset.h to make it easier to support more compilers
  • Exploration work on CI Toolchian test cases: Wayne
  • Everyone: Give feedback on PR#22688, and issue: #5517: Status ?

 

Best regards

 

Torsten Tejlmand Rasmussen

           

 


Re: hci interface stopped working after few hours #ble #hci #nrf52480 #uart

lairdjm
 

Hi Carles,

I was assuming it was aimed at both of us, I’m not sure about what hardware they’re using. I’ll give it a try tomorrow with the hardware I have and see if it’s working with the latest branch of zephyr.

Thanks,

Jamie


Cancelled Event: Zephyr Project: Dev Meeting - Thursday, 5 March 2020 #cal-cancelled

devel@lists.zephyrproject.org Calendar <devel@...>
 

Cancelled: Zephyr Project: Dev Meeting

This event has been cancelled.

When:
Thursday, 5 March 2020
8:00am to 9:00am
(UTC-08:00) America/Los Angeles

Where:
https://zoom.us/j/993312203

Organizer: devel@...

Description:
Join Zoom Meeting
https://zoom.us/j/993312203

One tap mobile
+16699006833,,993312203# US (San Jose)
+16465588656,,993312203# US (New York)

Dial by your location
        +1 669 900 6833 US (San Jose)
        +1 646 558 8656 US (New York)
        +1 877 369 0926 US Toll-free
        +1 855 880 1246 US Toll-free
Meeting ID: 993 312 203
Find your local number: https://zoom.us/u/ankEMRagf


Re: hci interface stopped working after few hours #ble #hci #nrf52480 #uart

Carles Cufi
 

Hi Jamie,

 

I think those questions were directed to Mayank, who is experiencing the issue now.

 

Thanks,

 

Carles

 

From: devel@... <devel@...> On Behalf Of lairdjm via Lists.Zephyrproject.Org
Sent: 05 March 2020 14:36
To: Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...>; mayank7117@...; devel@...
Cc: devel@...
Subject: Re: [Zephyr-devel] hci interface stopped working after few hours #ble #hci #nrf52480 #uart

 

Hi Vinayak,

> Are you using any host debugger firmware to convert to USB? or using 3v TTL connections to your custom board from nRF52840?

When I tested it, it was using an nRF52840 PCA10059-like board without a 32KHz crystal (RC was selected from zephyr), I also tried on a BL654 DVK with the 32KHz connected and set in zephyr

 

> For those using USB_UART conversion, I am assuming you are using Segger JLink firmware on the host chip in the nRF52840 DK/dongle. Could you try using the MBED firmware on the host debugger chip?

When I was testing the UART one, I used an FTDI chip so this does not apply. I tested against a BT850 module, which also uses an FTDI with a non-zephyr based HCI module and that worked flawlessly

 

> Also, please create or refer me to GH issue, so that further discussions can be continued there.

I never created an issue. I haven’t tested in probably about a year now or so.
Thanks,

Jamie


Zephyr Toolchain Working Group - Thu, 03/05/2020 #cal-notice

devel@lists.zephyrproject.org Calendar <noreply@...>
 

Zephyr Toolchain Working Group

When:
Thursday, 5 March 2020
9:00am to 10:00am
(GMT-06:00) America/Chicago

Where:
https://zoom.us/j/967549258

Description:
Zephyr Working Group is inviting you to a scheduled Zoom meeting.

Topic:  Zephyr Toolchain Working Group
Time: Feb 20, 2020 09:00 AM Central Time (US and Canada)
        Every 2 weeks on Thu, until Jul 23, 2020, 12 occurrence(s)
        Feb 20, 2020 09:00 AM
        Mar 5, 2020 09:00 AM
        Mar 19, 2020 09:00 AM
        Apr 2, 2020 09:00 AM
        Apr 16, 2020 09:00 AM
        Apr 30, 2020 09:00 AM
        May 14, 2020 09:00 AM
        May 28, 2020 09:00 AM
        Jun 11, 2020 09:00 AM
        Jun 25, 2020 09:00 AM
        Jul 9, 2020 09:00 AM
        Jul 23, 2020 09:00 AM
Please download and import the following iCalendar (.ics) files to your calendar system.
Weekly: https://zoom.us/meeting/tJIqcu2hrD4id0z59MlGQgtjfduqRH_iTA/ics?icsToken=98tyKuCuqT4uE9aQuF39e7cqA97lbN-1i3UesPYEsRPCMidHaAXyI_NwGo12JPmB

Join Zoom Meeting
https://zoom.us/j/967549258

Meeting ID: 967 549 258

One tap mobile
+16699006833,,967549258# US (San Jose)
+16465588656,,967549258# US (New York)

Dial by your location
        +1 669 900 6833 US (San Jose)
        +1 646 558 8656 US (New York)
        855 880 1246 US Toll-free
        877 369 0926 US Toll-free
        +1 647 558 0588 Canada
        855 703 8985 Canada Toll-free
Meeting ID: 967 549 258
Find your local number: https://zoom.us/u/abfRKTHWtN

Live meeting minutes: https://docs.google.com/document/d/1IQKBK-GcJNZG0O9QArqYfvb6Huk5xHscN-XIGEZr-z8/edit#heading=h.x36xe8bnwr9r


Upcoming Event: Zephyr Toolchain Working Group - Thu, 03/05/2020 9:00am-10:00am #cal-reminder

devel@lists.zephyrproject.org Calendar <devel@...>
 

Reminder: Zephyr Toolchain Working Group

When: Thursday, 5 March 2020, 9:00am to 10:00am, (GMT-06:00) America/Chicago

Where:https://zoom.us/j/967549258

View Event

Organizer: Maureen Helm

Description: Zephyr Working Group is inviting you to a scheduled Zoom meeting.

Topic:  Zephyr Toolchain Working Group
Time: Feb 20, 2020 09:00 AM Central Time (US and Canada)
        Every 2 weeks on Thu, until Jul 23, 2020, 12 occurrence(s)
        Feb 20, 2020 09:00 AM
        Mar 5, 2020 09:00 AM
        Mar 19, 2020 09:00 AM
        Apr 2, 2020 09:00 AM
        Apr 16, 2020 09:00 AM
        Apr 30, 2020 09:00 AM
        May 14, 2020 09:00 AM
        May 28, 2020 09:00 AM
        Jun 11, 2020 09:00 AM
        Jun 25, 2020 09:00 AM
        Jul 9, 2020 09:00 AM
        Jul 23, 2020 09:00 AM
Please download and import the following iCalendar (.ics) files to your calendar system.
Weekly: https://zoom.us/meeting/tJIqcu2hrD4id0z59MlGQgtjfduqRH_iTA/ics?icsToken=98tyKuCuqT4uE9aQuF39e7cqA97lbN-1i3UesPYEsRPCMidHaAXyI_NwGo12JPmB

Join Zoom Meeting
https://zoom.us/j/967549258

Meeting ID: 967 549 258

One tap mobile
+16699006833,,967549258# US (San Jose)
+16465588656,,967549258# US (New York)

Dial by your location
        +1 669 900 6833 US (San Jose)
        +1 646 558 8656 US (New York)
        855 880 1246 US Toll-free
        877 369 0926 US Toll-free
        +1 647 558 0588 Canada
        855 703 8985 Canada Toll-free
Meeting ID: 967 549 258
Find your local number: https://zoom.us/u/abfRKTHWtN

Live meeting minutes: https://docs.google.com/document/d/1IQKBK-GcJNZG0O9QArqYfvb6Huk5xHscN-XIGEZr-z8/edit#heading=h.x36xe8bnwr9r


Zephyr Toolchain Working Group Meeting – 05 March 2020

Rasmussen, Torsten
 

Hi All,

 

 

For today’s meeting let’s follow up on last meeting action items and get a status update.

Also I think we should consider the short / long term goals of this WG and who has the skills / capacity to do what.

 

Where:
https://zoom.us/j/967549258

Agenda

  • Action items from last meeting:
    • Wayne: PR22668: Continue work, and use as base for better toolchain abstraction: Status ?
    • Thomas: IAR: Get basic hello world compiling, (linking with GCC) : Status ?
    • Everyone: Give feedback on PR#22688, and issue: #5517: Status ?
  • Toolchain WG Goals

Also some feedback has been given by Marc since last meeting:

  • More reliable than code reviews, I found that gcc/clang -std=cXX -pedantic seem to work great for standard compliance. In our internal project I configured an extra build configuration with -pedantic on the side, we use it like "checkpatch" and others.

Note: Should be coupled with only checking new / modified files in a PR.

 

 

Feel free to send a mail, if you would like additional topics to be discussed.

 

Best regards

 

Torsten T. Rasmussen           

 

Live meeting minutes: https://docs.google.com/document/d/1IQKBK-GcJNZG0O9QArqYfvb6Huk5xHscN-XIGEZr-z8/edit#heading=h.x36xe8bnwr9r

 


Re: hci interface stopped working after few hours #ble #hci #nrf52480 #uart

lairdjm
 

Hi Vinayak,

> Are you using any host debugger firmware to convert to USB? or using 3v TTL connections to your custom board from nRF52840?

When I tested it, it was using an nRF52840 PCA10059-like board without a 32KHz crystal (RC was selected from zephyr), I also tried on a BL654 DVK with the 32KHz connected and set in zephyr

 

> For those using USB_UART conversion, I am assuming you are using Segger JLink firmware on the host chip in the nRF52840 DK/dongle. Could you try using the MBED firmware on the host debugger chip?

When I was testing the UART one, I used an FTDI chip so this does not apply. I tested against a BT850 module, which also uses an FTDI with a non-zephyr based HCI module and that worked flawlessly

 

> Also, please create or refer me to GH issue, so that further discussions can be continued there.

I never created an issue. I haven’t tested in probably about a year now or so.
Thanks,

Jamie


Re: hci interface stopped working after few hours #ble #hci #nrf52480 #uart

Chettimada, Vinayak Kariappa
 

Hi Mayank,

 

Are you using any host debugger firmware to convert to USB? or using 3v TTL connections to your custom board from nRF52840?

 

For those using USB_UART conversion, I am assuming you are using Segger JLink firmware on the host chip in the nRF52840 DK/dongle. Could you try using the MBED firmware on the host debugger chip?

 

Also, please create or refer me to GH issue, so that further discussions can be continued there.

 

Regards,

Vinayak

 

From: devel@... <devel@...> On Behalf Of Mayank via Lists.Zephyrproject.Org
Sent: 05 March 2020 13:42
To: devel@...
Cc: devel@...
Subject: Re: [Zephyr-devel] hci interface stopped working after few hours #ble #hci #nrf52480 #uart

 


So does anyone have idea regarding this issue ? 

I'm using zephyr (Version : 2.1.0) and Bluez (Version : 5.50).

Thanks,
Mayank


Re: ILI9340 Display Example

Jan Van Winkel
 

Hi Muhammad,

For the nrf52840_pca10056 you need to specify a display shield that supports ili9340, eg. west build -b nrf52840_pca10056 -- -DSHIELD=adafruit_2_8_tft_touch_v2

Note that ili9340 sample has been removed in the latest master as there is now a common sample that support different kind of display shields.

Regards,
Jan

On Thu, Mar 5, 2020 at 1:03 PM Muhammad Muh <muhammad.muh83@...> wrote:
Dear All,

I hope you all are doing well.

I am trying an example in
zephyrproject/zephyr/sample/display/ili9340

The example is building fine with nucleo board
west build -b nucleo_l476rg .

BUT

Please advise on the following error when building with nrf52840 west build -b nrf52840_pca10056 .

FAILED: CMakeFiles/app.dir/src/main.c.obj
ccache /home/muh/zephyr-sdk-0.10.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DBUILD_VERSION=zephyr-v2.0.0-1364-gbb3cd11bf192 -DKERNEL -DNRF52840_XXAA -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/muh/zephyrproject/zephyr/kernel/include -I/home/muh/zephyrproject/zephyr/arch/arm/include -I/home/muh/zephyrproject/zephyr/include -I/home/muh/zephyrproject/zephyr/include/drivers -Izephyr/include/generated -I/home/muh/zephyrproject/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/muh/zephyrproject/zephyr/ext/hal/cmsis/Core/Include -I/home/muh/zephyrproject/modules/hal/nordic/nrfx -I/home/muh/zephyrproject/modules/hal/nordic/nrfx/drivers/include -I/home/muh/zephyrproject/modules/hal/nordic/nrfx/mdk -I/home/muh/zephyrproject/modules/hal/nordic/. -isystem /home/muh/zephyrproject/zephyr/lib/libc/minimal/include -isystem /home/muh/zephyr-sdk-0.10.3/arm-zephyr-eabi/bin/../lib/gcc/arm-ze
phyr-eabi/8.3.0/include -isystem /home/muh/zephyr-sdk-0.10.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/8.3.0/include-fixed -Os -imacros/home/muh/zephyrproject/zephyr/samples/display/ili9340/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mthumb -mcpu=cortex-m4 -imacros/home/muh/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/muh/zephyrproject/zephyr/samples/display/ili9340=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/muh/zephyrproject/zephyr=ZEPHYR_BASE -ffunction-sections -fdata-sections -mabi=aapcs -march=armv7e-m -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj   -c ../src/main.c
../src/main.c: In function 'main':
../src/main.c:49:27: error: 'DT_INST_0_ILITEK_ILI9340_LABEL' undeclared (first use in this function); did you mean 'DT_INST_0_JEDEC_SPI_NOR_LABEL'?
  dev = device_get_binding(DT_INST_0_ILITEK_ILI9340_LABEL);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                           DT_INST_0_JEDEC_SPI_NOR_LABEL
../src/main.c:49:27: note: each undeclared identifier is reported only once for each function it appears in
[4/106] Building C object zephyr/CMake...r/soc/arm/nordic_nrf/nrf52/power.c.obj
ninja: build stopped: subcommand failed.

Regards



Re: hci interface stopped working after few hours #ble #hci #nrf52480 #uart

Mayank
 


So does anyone have idea regarding this issue ? 

I'm using zephyr (Version : 2.1.0) and Bluez (Version : 5.50).

Thanks,
Mayank


ILI9340 Display Example

Muhammad Muh <muhammad.muh83@...>
 

Dear All,

I hope you all are doing well.

I am trying an example in
zephyrproject/zephyr/sample/display/ili9340

The example is building fine with nucleo board
west build -b nucleo_l476rg .

BUT

Please advise on the following error when building with nrf52840 west build -b nrf52840_pca10056 .

FAILED: CMakeFiles/app.dir/src/main.c.obj
ccache /home/muh/zephyr-sdk-0.10.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DBUILD_VERSION=zephyr-v2.0.0-1364-gbb3cd11bf192 -DKERNEL -DNRF52840_XXAA -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/muh/zephyrproject/zephyr/kernel/include -I/home/muh/zephyrproject/zephyr/arch/arm/include -I/home/muh/zephyrproject/zephyr/include -I/home/muh/zephyrproject/zephyr/include/drivers -Izephyr/include/generated -I/home/muh/zephyrproject/zephyr/soc/arm/nordic_nrf/nrf52 -I/home/muh/zephyrproject/zephyr/ext/hal/cmsis/Core/Include -I/home/muh/zephyrproject/modules/hal/nordic/nrfx -I/home/muh/zephyrproject/modules/hal/nordic/nrfx/drivers/include -I/home/muh/zephyrproject/modules/hal/nordic/nrfx/mdk -I/home/muh/zephyrproject/modules/hal/nordic/. -isystem /home/muh/zephyrproject/zephyr/lib/libc/minimal/include -isystem /home/muh/zephyr-sdk-0.10.3/arm-zephyr-eabi/bin/../lib/gcc/arm-ze
phyr-eabi/8.3.0/include -isystem /home/muh/zephyr-sdk-0.10.3/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/8.3.0/include-fixed -Os -imacros/home/muh/zephyrproject/zephyr/samples/display/ili9340/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mthumb -mcpu=cortex-m4 -imacros/home/muh/zephyrproject/zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=/home/muh/zephyrproject/zephyr/samples/display/ili9340=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/muh/zephyrproject/zephyr=ZEPHYR_BASE -ffunction-sections -fdata-sections -mabi=aapcs -march=armv7e-m -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles/app.dir/src/main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj   -c ../src/main.c
../src/main.c: In function 'main':
../src/main.c:49:27: error: 'DT_INST_0_ILITEK_ILI9340_LABEL' undeclared (first use in this function); did you mean 'DT_INST_0_JEDEC_SPI_NOR_LABEL'?
  dev = device_get_binding(DT_INST_0_ILITEK_ILI9340_LABEL);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                           DT_INST_0_JEDEC_SPI_NOR_LABEL
../src/main.c:49:27: note: each undeclared identifier is reported only once for each function it appears in
[4/106] Building C object zephyr/CMake...r/soc/arm/nordic_nrf/nrf52/power.c.obj
ninja: build stopped: subcommand failed.

Regards



Re: hci interface stopped working after few hours #ble #hci #nrf52480 #uart

lairdjm
 

Hi,

I’ve previously done testing with the HCI UART and USB sample apps (in older Zephyr versions) with an nRF52840 and linux PC and always found it to not work well. It would start fine, could scan for devices from bluetoothctl and then it just seemed to screw up every time with command timeouts. Never did much digging into why.

Thanks,

Jamie

 

> Hi All,

>

> I'm facing issues regarding ble's hci interface.

> I'm having nrf52840 module on which i run zephyr's hci_uart app for beacon scanning.

> I have Bluez 5.50 installed on my custom board (imx6ull).

>

> hci0 interface on my device is "UP RUNNING". So, i'm able to scan the beacons. (My application scans beacons after every 10 seconds).

>

> Now, When i have put my device for over night testing, then i have observed that after few hours beacon scanning was stopped.

> And i'm getting "Bluetooth: hci0 command 0x200b tx timeout" prints after every 5-10 seconds on the console, still the hci0 interface status is "UP RUNNING", but not able to scan the beacons.

>

> Sometimes also getting the prints like "Bluetooth: hci0: Frame reassembly failed (-84)".

>

> What could be the reason behind this ?

>

> Thanks,

> Mayank


Zephyr base improvement / improved Zephyr user experience

Rasmussen, Torsten
 
Edited

Hi All,

 

I would like to inform you of a suggested improvement on how Zephyr is used in an application and how to source boilerplate.cmake code.

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

 

Today, each application contains:
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)

 

My proposal is to create a Zephyr CMake config package, which allows a user to simply write:

find_package(Zephyr)

in the future.

 

But let me describe some reason for suggesting this change.

 

The existing solution works, and for Linux users, it is very common to use environment variables.

However, this solution also have some drawbacks.

 

One drawback, is that developers working both up-/ and downstream may not be able to always has a single ZEPHYR_BASE, and thus they must still remember to source zephyr-env.sh or run zephyr-env.cmd before working.

 

Second drawback is people using IDEs such as Eclipse or SES, must ensure that ZEPHYR_BASE is correctly set BEFORE launching the IDE.

If only having one Zephyr, that is not a big issue, but having out-of-tree applications depending on different Zephyr versions or working both up- / downstream does make this a bit more annoying.

 

Especially many Windows users are not fond of running a command script prior to launching their IDE.

 

Third drawback, is the fact that ZEPHYR_BASE is not sticky after first CMake invocation, as example, if you try the following:

$ source /tmp/zephyr-1/zephyr/zephyr-env.sh

$ cd <path-to-sample>/hello_world

$ mkdir build; cd build

$ cmake -GNinja -DBOARD=nrf52840_pca10056 ..

-- Zephyr version: 2.2.0-rc2

-- Found PythonInterp: /usr/bin/python3.6 (found suitable version "3.6.8", minimum required is "3.6")

Loaded configuration '/tmp/zephyr-1/zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056_defconfig'

-- Build files have been written to: /tmp/zephyr-1/zephyr/samples/hello_world/build

$ ninja

[122/122] Linking C executable zephyr/zephyr.elf

 

# This could be similar to a user changing folder to do something else,

# or working in an IDE where the ZEPHYR_BASE is different from the value on first CMake invocation.

# and therefore has sourced a different Zephyr

$ source /tmp/zephyr-2/zephyr/zephyr-env.sh

# Indicate a CMakeLists.txt change causing CMake re-run on next ninja invocation.

$ touch ../CMakeLists.txt

$ ninja

[0/1] Re-running CMake...

-- Zephyr version: 2.1.99

-- Selected BOARD nrf52840_pca10056

-- Found west: /home/<user>/.local/bin/west (found suitable version "0.7.0", minimum required is "0.6.0")

-- Loading /tmp/zephyr-1/zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts as base

Error: nrf52840_pca10056.dts.pre.tmp:394.23-24 syntax error

FATAL ERROR: Unable to parse input tree

CMake Error at /tmp/zephyr-2/zephyr/cmake/dts.cmake:188 (message):

  command failed with return code: 1

Call Stack (most recent call first):

  /tmp/zephyr-2/zephyr/cmake/app/boilerplate.cmake:460 (include)

  CMakeLists.txt:5 (include)

 

-- Configuring incomplete, errors occurred!

See also "/tmp/zephyr-1/zephyr/samples/hello_world/build/CMakeFiles/CMakeOutput.log".

See also "/tmp/zephyr-1/zephyr/samples/hello_world/build/CMakeFiles/CMakeError.log".

FAILED: build.ninja

/opt/cmake-3.14.4-Linux-x86_64/bin/cmake -S/tmp/zephyr-1/zephyr/samples/hello_world -B/tmp/zephyr-1/zephyr/samples/hello_world/build

ninja: error: rebuilding 'build.ninja': subcommand failed

$

As seen above, the Zephyr in used is now in mixed state and thus failing.

 

I have therefore made the following PR, which solve both above mentioned problems, as well as give a better user experience.

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

It has the following advantages:

  1. CMake will use `find_package` to locate the right Zephyr
  2. Version can be used in an application to ensure the correct Zephyr version for Zephyr users when having multiple Out-of-tree apps
  3. ZEPHYR_BASE is sticky after first CMake invocation, thus if Zephyr based is changed after first run, it will not impact subsequent CMake invocations (directly or through ninja).
  4. Allows to have multiple projects with different Zephyr bases in same IDE, as example Eclipse.
  5. Easier getting started for developers. No boilerplate sourcing, no ZEPHYR_BASE / zephyr-env.sh sourcing, just put:
  6. Fully backward compatible with existing ZEPHYR_BASE.

 

 

So a Zephyr sample such as Hello World may look as:

https://github.com/zephyrproject-rtos/zephyr/blob/a886b9ae428c066bad73cc509757571b70a52d1f/samples/hello_world/CMakeLists.txt
# SPDX-License-Identifier: Apache-2.0

 

cmake_minimum_required(VERSION 3.13.1)

 

find_package(Zephyr 2.2.0 HINTS $ENV{ZEPHYR_BASE})

project(hello_world)

 

target_sources(app PRIVATE src/main.c)

 

 

And a downstream user creating an app based upon Zephyr without version check, can simply do:

`find_package(Zephyr)`

 

If a user wants to support the possibility of overriding the Zephyr by manually specifying ZEPHYR_BASE, the following can be used:  

`find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})`

 

A user requiring Zephyr version 2.2.0 or above can do:

`find_package(Zephyr 2.2.0)`

 

A user requiring an exact Zephyr version 2.2.0 can do:

`find_package(Zephyr 2.2.0 EXACT)`

 

 

To show that Zephyr base is now sticky, I have re-tried above failure using the new principle:

$ source /tmp/zephyr-1/zephyr/zephyr-env.sh

$ mkdir build; cd build

$ cmake -GNinja -DBOARD=nrf52840_pca10056 ..

Including boilerplate (zephyr base): /tmp/zephyr-1/zephyr/cmake/app/boilerplate.cmake

-- Zephyr version: 2.2.0-rc2

-- Found PythonInterp: /usr/bin/python3.6 (found suitable version "3.6.8", minimum required is "3.6")

Loaded configuration '/tmp/zephyr-1/zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056_defconfig'

-- Build files have been written to: /tmp/zephyr-1/zephyr/samples/hello_world/build

$ ninja

[119/124] Linking C executable zephyr/zephyr_prebuilt.elf

Memory region         Used Size  Region Size  %age Used

           FLASH:       11484 B         1 MB      1.10%

            SRAM:        5180 B       256 KB      1.98%

        IDT_LIST:          56 B         2 KB      2.73%

[124/124] Linking C executable zephyr/zephyr.elf

 

$ source /tmp/zephyr-2/zephyr/zephyr-env.sh

$ touch ../CMakeLists.txt

$ ninja

[0/1] Re-running CMake...

Including boilerplate (zephyr base (cached)): /tmp/zephyr-1/zephyr/cmake/app/boilerplate.cmake

-- Zephyr version: 2.2.0-rc2

-- Loading /tmp/zephyr-1/zephyr/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts as base

Loaded configuration '/tmp/zephyr-1/zephyr/samples/hello_world/build/zephyr/.config'

No change to configuration in '/tmp/zephyr-1/zephyr/samples/hello_world/build/zephyr/.config'

No change to Kconfig header in '/tmp/zephyr-1/zephyr/samples/hello_world/build/zephyr/include/generated/autoconf.h'

-- Build files have been written to: /tmp/zephyr-1/zephyr/samples/hello_world/build

[86/90] Linking C executable zephyr/zephyr_prebuilt.elf

[90/90] Linking C executable zephyr/zephyr.elf

$ echo $ZEPHYR_BASE

/tmp/zephyr-2/zephyr

 

Also a small screenshot from Eclipse to show that two projects can be imported with different Zephyr bases, and both be built and using their own Zephyr base (and in  this example own requested Zephyr version):

 

 

If anyone is interested in a presentation of the new possibilities, I will be happy to make a small presentation for next TSC meeting.

 

 

Torsten Tejlmand Rasmussen

Senior R&D Engineer

P: +47 72 89 92 47

 

Nordic

 

Nordic Semiconductor

Otto Nielsens veg 12, 7052 Trondheim, Norway

www.nordicsemi.com

 

 

SM_symbol_FB  nordic_symbol_small_TW  nordic_symbol_small_YT_ny2  nordic_symbol_small_IN  

 

DevZone

           

 


hci interface stopped working after few hours #ble #hci #nrf52480 #uart

Mayank
 

Hi All,

I'm facing issues regarding ble's hci interface.
I'm having nrf52840 module on which i run zephyr's hci_uart app for beacon scanning.
I have Bluez 5.50 installed on my custom board (imx6ull).

hci0 interface on my device is "UP RUNNING". So, i'm able to scan the beacons. (My application scans beacons after every 10 seconds).

Now, When i have put my device for over night testing, then i have observed that after few hours beacon scanning was stopped.
And i'm getting "Bluetooth: hci0 command 0x200b tx timeout" prints after every 5-10 seconds on the console, still the hci0 interface status is "UP RUNNING", but not able to scan the beacons.

Sometimes also getting the prints like "Bluetooth: hci0: Frame reassembly failed (-84)".

What could be the reason behind this ?

Thanks,
Mayank


API meeting next week: Focusing on watchdogs

Carles Cufi
 

Hi all,

Next week (Tuesday 10th of March) we will focus our attention to watchdog handling in Zephyr.

We recently closed #22858 with the merge of #22859, but this was a temporary solution to what is ultimately a wider problem that requires a discussion regarding the way Zephyr manages watchdogs in general.

A good description of the current issues with the CONFIG_WDT_DISABLE_AT_BOOT option can be found in #22858.

During the call we will discuss the approach we want to take and document it in #23282, which I just created today.

Original issue:
https://github.com/zephyrproject-rtos/zephyr/issues/22858
Pull request:
https://github.com/zephyrproject-rtos/zephyr/pull/22859
New tracking issue:
https://github.com/zephyrproject-rtos/zephyr/issues/23282

Meeting:
https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-api-discussion

Thanks,

Carles


Re: nrf52840 hang without errors #ble #nrf52840 #uart

Chettimada, Vinayak Kariappa
 

Hi Narendar,

 

Please create a github bug report, with details on how to build your application and reproduce the issue.

You may share a branch in the GH issue if that is faster for me or others  to reproduce and debug.

 

Regards,

Vinayak

 

From: devel@... <devel@...> On Behalf Of Narendar Malepu via Lists.Zephyrproject.Org
Sent: 04 March 2020 08:03
To: devel@...
Cc: devel@...
Subject: [Zephyr-devel] nrf52840 hang without errors #ble #nrf52840 #uart

 

Hi,

 

Iam using nrf52840 development board, developing software using zephyr.

In software development iam using bluetooth as a peripheral and uart in interrupt mode(to get data from other module), when iam trying to run both interfaces the board is getting hang without any errors and iam included watchdog timer so after sometime it is restarting.

When iam trying same fuctionality without using interrupt for uart and bluetooth, after some time device is stopping advertisments but uart is working fine.

can someone help me with above problem.

 

Thanks.


nrf52840 hang without errors #ble #nrf52840 #uart

Narendar Malepu
 

Hi,

 

Iam using nrf52840 development board, developing software using zephyr.

In software development iam using bluetooth as a peripheral and uart in interrupt mode(to get data from other module), when iam trying to run both interfaces the board is getting hang without any errors and iam included watchdog timer so after sometime it is restarting.

When iam trying same fuctionality without using interrupt for uart and bluetooth, after some time device is stopping advertisments but uart is working fine.

can someone help me with above problem.

 

Thanks.