Date   

Re: Zephyr (v1.13.0) HCI_UART running on nRF52 DK why BD address is always 00:00:00:00:00:00 after power cycle #nrf52832

frv
 
Edited

Hi there,

For me using the Nordic's nRFConnect smartphone app is very useful in the debug process.

My experience so far is when the public address of the HCI controller is set as 00:00:00:00:00:00 the client (central) application will detect/discover the peripheral BT device as ANOMYNOUS, thus the advertising is working.
However connecting to it via the nRFConnect makes the client applic crashing when the device is disoverable as ANOMYNOUS. But this is a different kind of issue I'm afraid. 

BTW make also sure you are making your device discoverable. 

I suggest you set the public address of the HCI controller via the cmd hcitool cmd 0x3f 0x006 0x0 0x0 0x1 0x2 0x21 0xAD (you are of course free to chose a different BD address). Make sure the btattach process is running correctly (e.g. btattach -B /dev/tttyACM0 -S 1000000 -P h4) before setting the address.
Stop the btattach process and restart it.  When the cmd is succesfully executed the cmd hcitool dev or hciconfig -a should display the address that was set.

BTW making use of QT example code makes it quite interesting to test out BLE functionality. Also QT DBus viewer can be very helpful in setting and debugging BLE functionality.

Good luck,
Frank


Re: Zephyr (v1.13.0) HCI_UART running on nRF52 DK why BD address is always 00:00:00:00:00:00 after power cycle #nrf52832

icephyr
 

Hi,guys, It seems that I met a similar problem with Frank.
 
I use nRF52832 running HCI_UART sample as a controller. I want to make the controller advertise unconnectable packets outside, so I use bluez (version 5.48)
 
and hcitool to set advertise data :
sudo hcitool -i hci0 cmd 0x08 0x0008 1f 02 01 06 03 03 aa fe 17 16 aa fe 00 -10 00 01 02 03 04 05 06 07 08 09 0a 0b 0e 0f 00 00 00 00
 
and set advertise enable:
sudo hcitool -i hci0 cmd 0x08 0x000a 01
 
I detect the process with btmon, the controller returns success ,like this below:


But I didn't find the packet whose data was what I have set with hcitool command. I wonder if this is normal, and will the whole zero mac-address cause this problem ?


Re: Zephyr (v1.13.0) HCI_UART running on nRF52 DK why BD address is always 00:00:00:00:00:00 after power cycle #nrf52832

frv
 

Hi Carles,

Thanks a lot, I hope soon a proper answer can be given, nevertheless progress is made and it just to know if this is normal behaviour. 

Best regards,
Frank


Re: Zephyr (v1.13.0) HCI_UART running on nRF52 DK why BD address is always 00:00:00:00:00:00 after power cycle #nrf52832

Carles Cufi
 

Hi Frank,

 

Right, since this seems to be more about BlueZ and Qt than about Zephyr or nRF, because nRF chipsets do not come with a public address registered and burned into the chip, I have copied a couple of people familiar with BlueZ to see if they can help you.

 

Regards,

 

Carles

 

From: devel@... <devel@...> On Behalf Of frv
Sent: 12 November 2018 12:14
To: devel@...
Subject: Re: [Zephyr-devel] Zephyr (v1.13.0) HCI_UART running on nRF52 DK why BD address is always 00:00:00:00:00:00 after power cycle #nrf52832

 

[Edited Message Follows]

Hi Carles,

Humm... not quite, I have recently created a QT bug report (See : https://bugreports.qt.io/browse/QTBUG-71727)  although I think different parties are to blame, I'm still not sure who is doing really wrong, or miss interprets the data.

Thus to summarize again:
If no public address is set for the Nordic BT controller, the HCI adapter has by default address 00:00:00:00:00:00.

When Qt creates a QLowEnergyController object it uses the BT random address to find the HCI adapter (hciForAddress member function in the HciManager class), but as the random address is different from the default public address it is not able to create a QT BT socket, and thus all BLE actions will fail (E.g. advertising).

As QT uses the Bluez DBus function for retrieving the address info you could say it is the Bluez stack to blame, as the address is referring to the HCI adapter is the random address and not the public device address (00:00:00:00:00:00) (See attach pic of QDbusViewer).

Thus only after setting the public address different from the zero address (by means of the hcitool cmd) , Qt is able to create a correct LowEnergyController object for starting to advertise. But also in this case you could wonder why is in the DBus topology ("Property: AddressType") the public set address still typed as "random". 

I'm wondering how Qt will reply to the issue. Honestly I love to work with QT as a C++ developer.

Also the Zephyr HCI_UART running on the Nordic HW offers a different solution than using the plain C solution (serialize concept when separating connectivity board from application board) offered by Nordic or the C++ solution based on the Nordic PC BLE driver. Altough the latter also gives a nice solution for integrating BT in our products. 

Best regards,
Frank


Re: Zephyr (v1.13.0) HCI_UART running on nRF52 DK why BD address is always 00:00:00:00:00:00 after power cycle #nrf52832

frv
 
Edited

Hi Carles,

Humm... not quite, I have recently created a QT bug report (See : https://bugreports.qt.io/browse/QTBUG-71727)  although I think different parties are to blame, I'm still not sure who is doing really wrong, or miss interprets the data.

Thus to summarize again:
If no public address is set for the Nordic BT controller, the HCI adapter has by default address 00:00:00:00:00:00.

When Qt creates a QLowEnergyController object it uses the BT random address to find the HCI adapter (hciForAddress member function in the HciManager class), but as the random address is different from the default public address it is not able to create a QT BT socket, and thus all BLE actions will fail (E.g. advertising).

As QT uses the Bluez DBus function for retrieving the address info you could say it is the Bluez stack to blame, as the address is referring to the HCI adapter is the random address and not the public device address (00:00:00:00:00:00) (See attach pic of QDbusViewer).

Thus only after setting the public address different from the zero address (by means of the hcitool cmd) , Qt is able to create a correct LowEnergyController object for starting to advertise. But also in this case you could wonder why is in the DBus topology ("Property: AddressType") the public set address still typed as "random". 

I'm wondering how Qt will reply to the issue. Honestly I love to work with QT as a C++ developer.

Also the Zephyr HCI_UART running on the Nordic HW offers a different solution than using the plain C solution (serialize concept when separating connectivity board from application board) offered by Nordic or the C++ solution based on the Nordic PC BLE driver. Altough the latter also gives a nice solution for integrating BT in our products. 

Best regards,
Frank


Re: Zephyr (v1.13.0) HCI_UART running on nRF52 DK why BD address is always 00:00:00:00:00:00 after power cycle #nrf52832

Carles Cufi
 

Hi Frank,

 

I understand, so does that mean that you don’t need a public address? Since Qt seems to be doing the right thing.

 

Carles

 

From: devel@... <devel@...> On Behalf Of frv
Sent: 12 November 2018 09:20
To: devel@...
Subject: Re: [Zephyr-devel] Zephyr (v1.13.0) HCI_UART running on nRF52 DK why BD address is always 00:00:00:00:00:00 after power cycle #nrf52832

 

[Edited Message Follows]

Hi Carles,

Thanks for the feedback.

It seems the Qt QLowerEnergyController object selects the first valid address different from the zero address for addressing the HCI controller/adapter. In my case for Nordic Zephyr BLE Controller this is the random address when the public address is not set first different from the zero address by the hci cmd 0x3f 0x006 "address".

Best regards,
Frank


Re: Zephyr Project using Eclipse

Serafin
 

Fwd: List


On 12/11/18 09:44, Serafin wrote:

Hi


You can let cmake generate a Eclipse project. No cmake integration in eclipse needed: See the documentation https://docs.zephyrproject.org/latest/application/application.html?highlight=eclipse#eclipse-debugging

TLDR:

cmake -G"Eclipse CDT4 - Ninja" -DBOARD=frdm_k64f %ZEPHYR_BASE%\samples\synchronization
ninja

Serafin


On 12/11/18 09:35, Stefan Jaritz wrote:

Morning,

A bit tricky because Eclipse CDT integration of cmake is only available at the latest release and imho not very good.

1.) build from eclipse

Simplest way:
Use std. C Project. Under "C/C++ build" options >> "Builder Type: external" & "Build command: make"

before:
activate build enviroment & go to your zephyr project. create build dir, run cmake

2.) debug from eclipse

the open ocd debuger from the gnu mcu pulgin works best (https://gnu-mcu-eclipse.github.io/debug/openocd/)

create a new run config & and reset the paths:
openocd binary form the /opt/... dir

openocd.cfg from the board config

run west debugserver and start the eclipse debug config


Good luck

Stefan


On 09/11/2018 19:13, Nicholas Yameen wrote:

Hello,

 

I want to develop applications using the FRDM-K64F board from NXP using Eclipse.  Is there any way to use Eclipse as an IDE and create a program, then flash it onto the board? I want to do my development all from Eclipse.  Or do is Eclipse only used as a debugger? Thank you.

 

Regards,

Nick

Nicholas Yameen
R&D Engineer

D  978-975-9675 x59675
E  Nicholas.Yameen@...

800 Federal Street
Andover, MA 01810
United States

Blog Blog Blog Blog Blog Blog Blog 

*Please consider the environment before printing this e-mail

 

 



Re: Zephyr Project using Eclipse

Stefan Jaritz
 

Morning,

A bit tricky because Eclipse CDT integration of cmake is only available at the latest release and imho not very good.

1.) build from eclipse

Simplest way:
Use std. C Project. Under "C/C++ build" options >> "Builder Type: external" & "Build command: make"

before:
activate build enviroment & go to your zephyr project. create build dir, run cmake

2.) debug from eclipse

the open ocd debuger from the gnu mcu pulgin works best (https://gnu-mcu-eclipse.github.io/debug/openocd/)

create a new run config & and reset the paths:
openocd binary form the /opt/... dir

openocd.cfg from the board config

run west debugserver and start the eclipse debug config


Good luck

Stefan


On 09/11/2018 19:13, Nicholas Yameen wrote:

Hello,

 

I want to develop applications using the FRDM-K64F board from NXP using Eclipse.  Is there any way to use Eclipse as an IDE and create a program, then flash it onto the board? I want to do my development all from Eclipse.  Or do is Eclipse only used as a debugger? Thank you.

 

Regards,

Nick

Nicholas Yameen
R&D Engineer

D  978-975-9675 x59675
E  Nicholas.Yameen@...

800 Federal Street
Andover, MA 01810
United States

Blog Blog Blog Blog Blog Blog Blog 

*Please consider the environment before printing this e-mail

 

 


Re: #nrf52840 #ble unstable connection #nrf52840 #ble

Randy Chou <rchou3@...>
 

Hi Vinayak,
I merge the patch, host (nRF Connect) get update connection parameter request. After CI change to 30ms, it can keep connection a bit longer but it still disconnect after few minutes (distance is ~2m).
If I move host close to device then the connection can keep more than one hour.
I also try to change the CI back to 7.5ms and move host far away from device (~2m), the connection is also stable.

Do you have any suggestion that I can help to debug this issue?
Thanks,
Randy


Re: Zephyr (v1.13.0) HCI_UART running on nRF52 DK why BD address is always 00:00:00:00:00:00 after power cycle #nrf52832

frv
 
Edited

Hi Carles,

Thanks for the feedback.

It seems the Qt QLowerEnergyController object selects the first valid address different from the zero address for addressing the HCI controller/adapter. In my case for Nordic Zephyr BLE Controller this is the random address when the public address is not set first different from the zero address by the hci cmd 0x3f 0x006 "address".

Best regards,
Frank


Re: lwip integration with OpenThread #nrf52840 #lwip #openthread

deepa.gopinath@...
 

Hi Paul,

I have found it in this link - https://github.com/zephyrproject-rtos/zephyr/issues/10561
By referring the config file also we can able to find Echo client and server example can be built for either OpenThread or third party IP stack.
https://github.com/zephyrproject-rtos/zephyr/blob/master/samples/net/echo_client/overlay-ot.conf
Remaining config files will be used to build for other configurations -  https://github.com/zephyrproject-rtos/zephyr/blob/master/samples/net/echo_client/

Thanks & Regards,
Deepa


Re: thread permissions issue

Diego Sueiro
 

On Sat, 10 Nov 2018 at 16:59, Diego Sueiro <diego.sueiro@gmail.com> wrote:

Hello Zephyrs,

I'm developing a shell module for the sensor drivers and I want to
validate if the device name passed from the user is a sensor device.

I have the CONFIG_USERSAPCE=y.

After calling "dev = device_get_binding(argv[1])" I call the
"Z_SYSCALL_DRIVER_SENSOR(dev, sample_fetch)" and I get the following
error message:

thread 0x2000064c (1) does not have permission on sensor driver
0x20005ac8 [0000]
syscall cmd_get_sensor failed check: access denied


Some questions:

1 - How do I grant permission to the running thread to access the
sensor driver object?
I managed to solve this by calling
"k_thread_access_grant(k_current_get(), dev, NULL)" before calling the
"Z_SYSCALL_DRIVER_SENSOR" macro.

2 - Even having the CONFIG_USERSAPCE=y set when calling
"sensor_sample_fetch" it seems that it is calling the
"_impl_sensor_sample_fetch" directly instead of
"Z_SYSCALL_HANDLER(sensor_sample_fetch, dev)" defined in the
drivers/sensor/sensor_handlers.c file. How can I have the current
thread using the userspace syscalls?
This question remains open.


thread permissions issue

Diego Sueiro
 

Hello Zephyrs,

I'm developing a shell module for the sensor drivers and I want to
validate if the device name passed from the user is a sensor device.

I have the CONFIG_USERSAPCE=y.

After calling "dev = device_get_binding(argv[1])" I call the
"Z_SYSCALL_DRIVER_SENSOR(dev, sample_fetch)" and I get the following
error message:

thread 0x2000064c (1) does not have permission on sensor driver
0x20005ac8 [0000]
syscall cmd_get_sensor failed check: access denied


Some questions:

1 - How do I grant permission to the running thread to access the
sensor driver object?

2 - Even having the CONFIG_USERSAPCE=y set when calling
"sensor_sample_fetch" it seems that it is calling the
"_impl_sensor_sample_fetch" directly instead of
"Z_SYSCALL_HANDLER(sensor_sample_fetch, dev)" defined in the
drivers/sensor/sensor_handlers.c file. How can I have the current
thread using the userspace syscalls?

Regards,

--
*dS
Diego Sueiro


Re: Zephyr Project using Eclipse

Maureen Helm
 

Hi Nick,

Once you’ve generated your project with CMake and imported it into Eclipse, you can edit source files in Eclipse and click the “Make” button to recompile your application.

 

Just be careful if you need to edit Kconfig variables, add new .c files to your project, or update the device tree, because these changes require regenerating your project with CMake. You’ll need to run ‘ninja pristine’ on the command line first, reinvoke CMake, then refresh your project in Eclipse.

 

Maureen

 

From: devel@... [mailto:devel@...] On Behalf Of Nicholas Yameen
Sent: Friday, November 9, 2018 1:14 PM
To: devel@...
Subject: [Zephyr-devel] Zephyr Project using Eclipse

 

Hello,

 

I want to develop applications using the FRDM-K64F board from NXP using Eclipse.  Is there any way to use Eclipse as an IDE and create a program, then flash it onto the board? I want to do my development all from Eclipse.  Or do is Eclipse only used as a debugger? Thank you.

 

Regards,

Nick

Nicholas Yameen
R&D Engineer

D  978-975-9675 x59675
E  Nicholas.Yameen@...

800 Federal Street
Andover, MA 01810
United States

Blog Blog Blog Blog Blog Blog Blog 

*Please consider the environment before printing this e-mail

 

 


Zephyr Project using Eclipse

Nicholas Yameen <Nicholas.Yameen@...>
 

Hello,

 

I want to develop applications using the FRDM-K64F board from NXP using Eclipse.  Is there any way to use Eclipse as an IDE and create a program, then flash it onto the board? I want to do my development all from Eclipse.  Or do is Eclipse only used as a debugger? Thank you.

 

Regards,

Nick

Nicholas Yameen
R&D Engineer

D  978-975-9675 x59675
E  Nicholas.Yameen@...

800 Federal Street
Andover, MA 01810
United States

Blog Blog Blog Blog Blog Blog Blog 

*Please consider the environment before printing this e-mail

 

 


Re: __ASSERT - transfer to error handler

Boie, Andrew P
 

I'm patiently waiting for a paradise times when on CPU exception, assert, etc.,
we'll be ending up in debugger, point to the instruction where the problem
happened (or it can be seen in backtrace).
We do dump this info to the console on a fatal CPU exception. On x86 there's even a crude stack trace.
But it would be nice, if running some application under GDB, for the exception to simply break the debugger at the offending instruction rather than go through Zephyr's exception handling path.

I'm not sure how this could work, perhaps have the Zephyr exception handler set up the stack/registers to the original context and issue a debug exception? Or would this involve some kind of Zephyr-aware extension to GDB? The problem is always that the stack layout for a CPU exception is different than a function call, and might not even be on the same stack, so you can't easily unwind through when the exception happened to the original faulting context.

Andrew


Re: __ASSERT - transfer to error handler

Boie, Andrew P
 

It's better to call k_oops() or k_panic() than _SysFatalErrorHandler() directly. You will actually get useful information about where the error occurred, instead of having to pass in a NULL exception stack frame.

 

Andrew

 

From: devel@... [mailto:devel@...] On Behalf Of Skøien, Kristoffer
Sent: Friday, November 9, 2018 12:11 AM
To: devel@...
Subject: [Zephyr-devel] __ASSERT - transfer to error handler

 

Current implementation:

The __ASSERT macro is extensively used in the Zephyr codebase and in application code for debugging during development.

In case of an ASSERT, the code jumps to __ASSERT_POST which spins the given thread in a while(1).

 

Issue:

During development and debugging, simply looping the thread will mask that the ASSERT has triggered. The only feedback the user gets of an assert is a printout.

This can be missed if e.g.:

- The RTT or Serial debug interface is down or unused

- There is too much logging so that the “ASSERTION FAIL” can be missed

 

Proposed solution:

In __ASSERT_POST provide a function call that will end up a user definable error handler. E.g. _SysFatalErrorHandler

 

This will let the developer set given SOC pins in case of an ASSERT, ask for a specific LED pattern to be set or print further debug messages.

 

Feedback is appreciated.

 

Kind regards

Kristoffer

 


Re: Zephyr: FDRM_K64f board from NXP

Florian Fouillet <Florian.Fouillet@...>
 

Thanks everyone, I will have a look at the DTS.

 

Cheers,

 

From: Diego Sueiro [mailto:diego.sueiro@...]
Sent: Friday, November 9, 2018 10:32 AM
To: Andrei <andrei.emeltchenko.news@...>
Cc: Florian Fouillet <Florian.Fouillet@...>; devel@...
Subject: Re: [Zephyr-devel] Zephyr: FDRM_K64f board from NXP

 

[External email: Use caution with links and attachments]


 

 

On Fri, 9 Nov 2018, 3:22 pm Andrei <andrei.emeltchenko.news@... wrote:

Hi,

On Fri, Nov 09, 2018 at 01:05:42PM +0000, Florian Fouillet wrote:
>    Hi,
>
>     
>
>    I am currently working on the Zephyr OS with a FDRM_K64f board from NXP. I
>    am just going through the documentation and the code example for now.
>
>    I have trouble to understand where is the implementation of the macro for
>    the Freedom board. For eample in the blinky project example
>    (zephyr/samples/basic/blinky/src/main.c) we have a #define LED
>    LED0_GPIO_PIN. we should have somewhere the definition of this
>    LED0_GPIO_PIN to match with the board I am using. however I don't know
>    where is this implementation. In addition of that, do you know where I can
>    find a list of every define like this LED0_GPIO_PIN. For example for PWM
>    or SPI or UART?

It is done somehow through DTS, you need to search i.e.
./zephyr/include/generated/generated_dts_board.h

 

Take a look at the documentation to understand how this process works:

 


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
______________________________________________________________________


Re: Zephyr: FDRM_K64f board from NXP

Diego Sueiro
 


On Fri, 9 Nov 2018, 3:22 pm Andrei <andrei.emeltchenko.news@... wrote:
Hi,

On Fri, Nov 09, 2018 at 01:05:42PM +0000, Florian Fouillet wrote:
>    Hi,
>
>     
>
>    I am currently working on the Zephyr OS with a FDRM_K64f board from NXP. I
>    am just going through the documentation and the code example for now.
>
>    I have trouble to understand where is the implementation of the macro for
>    the Freedom board. For eample in the blinky project example
>    (zephyr/samples/basic/blinky/src/main.c) we have a #define LED
>    LED0_GPIO_PIN. we should have somewhere the definition of this
>    LED0_GPIO_PIN to match with the board I am using. however I don't know
>    where is this implementation. In addition of that, do you know where I can
>    find a list of every define like this LED0_GPIO_PIN. For example for PWM
>    or SPI or UART?

It is done somehow through DTS, you need to search i.e.
./zephyr/include/generated/generated_dts_board.h

Take a look at the documentation to understand how this process works:


Re: Zephyr: FDRM_K64f board from NXP

Andrei
 

Hi,

On Fri, Nov 09, 2018 at 01:05:42PM +0000, Florian Fouillet wrote:
Hi,

 

I am currently working on the Zephyr OS with a FDRM_K64f board from NXP. I
am just going through the documentation and the code example for now.

I have trouble to understand where is the implementation of the macro for
the Freedom board. For eample in the blinky project example
(zephyr/samples/basic/blinky/src/main.c) we have a #define LED
LED0_GPIO_PIN. we should have somewhere the definition of this
LED0_GPIO_PIN to match with the board I am using. however I don't know
where is this implementation. In addition of that, do you know where I can
find a list of every define like this LED0_GPIO_PIN. For example for PWM
or SPI or UART?
It is done somehow through DTS, you need to search i.e.
./zephyr/include/generated/generated_dts_board.h

Best regards
Andrei Emeltchenko

2541 - 2560 of 7928