Date   

Re: Logging with a string via %s

pawel.dunaj@...
 

On Fri, May 17, 2019 at 04:24 PM, Boie, Andrew P wrote:

For an operating system that aims to support various functional safety certifications, asynchronous rendering of %s is a terrible idea.

 

It has it's pros and cons. Personally I don't mind it as long as it is well understood and can be turned off.

 

I think %s capability should be dropped from the logger’s format string processing and a separate API added specifically to log a C string, which makes an immediate copy.

 

Here I totally agree. I think that formatting of strings is such a well known standard that nobody will read the fine print for a logger to see what magic may lie under its hood. I think we should either assert that %s is never used and use some other format instead (i.e. force people to check the doc at least once when they hit an error) or keep %s for in place rendering and add new format for people who want to go faster.
Another thing is that assert is disabled by default so many people may never notice the problem (especially for error paths).

 


Re: Logging with a string via %s

Paul Sokolovsky
 

Hello,

On Fri, 17 May 2019 14:38:14 +0000
"lairdjm" <jamie.mccrae@lairdconnect.com> wrote:

Hi,
I think what confused me is that I was reading about the ‘improved
logging’ from this guide:
Opinions vary on that matter, some people think that the logging was
actually "regressed" and not "improved". Literally, it became so
advanced, smart, and sophisticated, that it goes against what most
people need most of the time. Of course, we'll never know if that's
true unless more people provide feedback, so thanks for posting.

https://foundries.io/insights/2018/08/14/zephyr-logging-part-2/ which
doesn’t mention anything about it, I was changing old code from
printf() to LOG_x() and that’s when the issue arose. Thanks, Jamie
I personally do conversion in that direction (printf -> LOG_x) only
when I'm forced to (like, when submitting code for inclusion to
Zephyr). During development, I always use printk/printf which just
behave as expected.

[]

--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog


Re: Logging with a string via %s

Paul Sokolovsky
 

Hello,

On Fri, 17 May 2019 14:24:41 +0000
"Boie, Andrew P" <andrew.p.boie@intel.com> wrote:

For an operating system that aims to support various functional
safety certifications, asynchronous rendering of %s is a terrible
idea.
Some people think that asynchronous logging, forced on unsuspecting
users, is pretty bad idea and make bets when CONFIG_LOG_IMMEDIATE will
become the default behavior again.


I think %s capability should be dropped from the logger’s format
string processing and a separate API added specifically to log a C
string, which makes an immediate copy.

Andrew

From: devel@lists.zephyrproject.org
[mailto:devel@lists.zephyrproject.org] On Behalf Of
pawel.dunaj@nordicsemi.no Sent: Friday, May 17, 2019 1:16 AM To:
devel@lists.zephyrproject.org Subject: Re: [Zephyr-devel] Logging
with a string via %s

Hi,
To optimize time of log processing message construction is deferred.
For this reason you cannot use arrays that will not live long enough
for logger thread to see them. In other words you can always use
static arrays (like you do when calling `LOG_xyz("%s", "testme")`)
but you must never pass anything from the stack (like in your
example). You can enable `CONFIG_LOG_IMMEDIATE` but this will affect
logging performance and does not actually tells you why the problem
happened in the first place.

If you need to print array declared on stack you must call `
log_strdup()` to duplicate it.

Personally I am against this API and I indicated it will cause bugs
as people do expect `%s` to simply output a string and they also
don't read documentation for something that should just work. But at
least it makes logger faster if you look from the bright side.

Thanks,





--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog


Re: Logging with a string via %s

Marc Herbert
 

On 17 May 2019, at 07:24, Boie, Andrew P <andrew.p.boie@intel.com> wrote:

For an operating system that aims to support various functional safety certifications, asynchronous rendering of %s is a terrible idea.

Such a "sharp tool" should at least not look exactly like the slow but safe version used absolutely everywhere else.

http://www.catb.org/~esr/writings/taouu/html/ch01s03.html#rule-surprise

On the same "least astonishment" principle, I think most developers expect degraded performance when logging.


Re: Logging with a string via %s

lairdjm
 

Hi,

I think what confused me is that I was reading about the ‘improved logging’ from this guide: https://foundries.io/insights/2018/08/14/zephyr-logging-part-2/ which doesn’t mention anything about it, I was changing old code from printf() to LOG_x() and that’s when the issue arose.

Thanks,

Jamie

 

THIS MESSAGE, ANY ATTACHMENT(S), AND THE INFORMATION CONTAINED HEREIN MAY BE PROPRIETARY TO LAIRD CONNECTIVITY, INC. AND/OR ANOTHER PARTY, AND MAY FURTHER BE INTENDED TO BE KEPT CONFIDENTIAL. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DELETE THE EMAIL AND ANY ATTACHMENTS, AND IMMEDIATELY NOTIFY THE SENDER BY RETURN EMAIL. THIS MESSAGE AND ITS CONTENTS ARE THE PROPERTY OF LAIRD CONNECTIVITY, INC. AND MAY NOT BE REPRODUCED OR USED WITHOUT THE EXPRESS WRITTEN CONSENT OF LAIRD CONNECTIVITY, INC.


Re: Logging with a string via %s

Boie, Andrew P
 

For an operating system that aims to support various functional safety certifications, asynchronous rendering of %s is a terrible idea.

 

I think %s capability should be dropped from the logger’s format string processing and a separate API added specifically to log a C string, which makes an immediate copy.

 

Andrew

 

From: devel@... [mailto:devel@...] On Behalf Of pawel.dunaj@...
Sent: Friday, May 17, 2019 1:16 AM
To: devel@...
Subject: Re: [Zephyr-devel] Logging with a string via %s

 

Hi,
To optimize time of log processing message construction is deferred. For this reason you cannot use arrays that will not live long enough for logger thread to see them.
In other words you can always use static arrays (like you do when calling `LOG_xyz("%s", "testme")`) but you must never pass anything from the stack (like in your example). You can enable `CONFIG_LOG_IMMEDIATE` but this will affect logging performance and does not actually tells you why the problem happened in the first place.

If you need to print array declared on stack you must call ` log_strdup()` to duplicate it.

Personally I am against this API and I indicated it will cause bugs as people do expect `%s` to simply output a string and they also don't read documentation for something that should just work.
But at least it makes logger faster if you look from the bright side.

Thanks,


Re: Logging with a string via %s

pawel.dunaj@...
 

Hi,
To optimize time of log processing message construction is deferred. For this reason you cannot use arrays that will not live long enough for logger thread to see them.
In other words you can always use static arrays (like you do when calling `LOG_xyz("%s", "testme")`) but you must never pass anything from the stack (like in your example). You can enable `CONFIG_LOG_IMMEDIATE` but this will affect logging performance and does not actually tells you why the problem happened in the first place.

If you need to print array declared on stack you must call ` log_strdup()` to duplicate it.

Personally I am against this API and I indicated it will cause bugs as people do expect `%s` to simply output a string and they also don't read documentation for something that should just work.
But at least it makes logger faster if you look from the bright side.

Thanks,


Re: [NRF52840] GPIO 1 problem

pawel.dunaj@...
 

Hi,
NRF_GPIO_PIN_MAP will effectively change pin number from 6 to (32+6). This would be ok if you use nrfx but when you use Zephyr GPIO API you should use pin id as is. So you should write to CONFIG_GPIO_P1_DEV_NAME device using pin 6.
I.e. do not use NRF_GPIO_PIN_MAP macro.
Thanks,


Upcoming Event: Zephyr Project: Dev Meeting - Thu, 05/16/2019 8:00am-9:00am, Please RSVP #cal-reminder

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

Reminder: Zephyr Project: Dev Meeting

When: Thursday, 16 May 2019, 8:00am to 9:00am, (GMT-07:00) America/Los Angeles

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

An RSVP is requested. Click here to RSVP

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


[NRF52840] GPIO 1 problem

Felipe Gabardo Gonçalves <felipe@...>
 

Hi,

I'm trying to write a value to a GPIO port 1 on a custom board and to pca_10056 and I'm getting nothing on the output. On GPIO port 0 it works properly. My code has no secrets, I'm using blinky sample code from zephyr tag v1.13.0, and I just modified the folowing:

#define LED_PORT CONFIG_GPIO_P1_DEV_NAME #define LED NRF_GPIO_PIN_MAP(1, 6)

Does anyone know where I'm doing something wrong?

Thank you in advance,


Re: Logging with a string via %s

Johan Hedberg
 

Hi,

There’s also a log_strdup() API to deal with this issue.

Johan

On 15 May 2019, at 14.27, Stefan Jaritz <stefan@kokoontech.com> wrote:

Hey Lairdjm,



Depending on you logging setup, the log of the string is done inside the "LOG_DBG" command or later.

Later means, that your main function was already left and your local variables are gone = invalid.

Try to add following lines at your proj.conf:

CONFIG_LOG=y
# CONFIG_LOG_PROCESS_THREAD=y
# CONFIG_LOG_INPLACE_PROCESS=y
CONFIG_LOG_IMMEDIATE=y
CONFIG_LOG_BACKEND_SHOW_COLOR=y

This will force the logger "execute" the log function.

Good luck!

Stefan



On 15/05/2019 11:52, lairdjm wrote:
Hi,
I’m seeing an issue whereby I am unable to log strings using LOG_DBG() and %s format, for a quick example I modified the hello world sample to enable logging and change the code to this:
#define LOG_DOMAIN test_domain
#include <logging/log.h>
LOG_MODULE_REGISTER(LOG_DOMAIN);

void main(void)
{
char baTmpBuf[12];
sprintf(baTmpBuf, "ffffffff");
LOG_DBG("Test : %s", baTmpBuf);

printk("Hello World! %s\n", CONFIG_BOARD);
}
I expect to see “Test : ffffffff” but instead I am getting “Test : %*”, if I change the code to inefficiently log each character, e.g.:
LOG_DBG("Test : %c%c%c%c%c%c%c%c", baTmpBuf[0], baTmpBuf[1], baTmpBuf[2], baTmpBuf[3], baTmpBuf[4], baTmpBuf[5],baTmpBuf[6], baTmpBuf[7]);
Then I get the expected output: “Test : ffffffff”

So why is %s not outputting a string? If there a configuration option I have missed? I have tried toggling “Format strings with libc” option but it doesn’t change anything. I’m testing on an nRF52840 using the nrf52840_pca10056 board file.
Thanks,
Jamie
THIS MESSAGE, ANY ATTACHMENT(S), AND THE INFORMATION CONTAINED HEREIN MAY BE PROPRIETARY TO LAIRD CONNECTIVITY, INC. AND/OR ANOTHER PARTY, AND MAY FURTHER BE INTENDED TO BE KEPT CONFIDENTIAL. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DELETE THE EMAIL AND ANY ATTACHMENTS, AND IMMEDIATELY NOTIFY THE SENDER BY RETURN EMAIL. THIS MESSAGE AND ITS CONTENTS ARE THE PROPERTY OF LAIRD CONNECTIVITY, INC. AND MAY NOT BE REPRODUCED OR USED WITHOUT THE EXPRESS WRITTEN CONSENT OF LAIRD CONNECTIVITY, INC.


Re: Logging with a string via %s

lairdjm
 

Hi Stefan,

Brilliant, didn’t think of that, all working now, thank you.

Thanks,

Jamie

 

From: devel@... <devel@...> On Behalf Of Stefan Jaritz via Lists.Zephyrproject.Org

Sent: 15 May 2019 12:27
To: devel@...
Cc: devel@...
Subject: Re: [Zephyr-devel] Logging with a string via %s

 

EXTERNAL EMAIL: Be careful with attachments and links.

Hey Lairdjm,

 

Depending on you logging setup, the log of the string is done inside the "               LOG_DBG" command or later.

Later means, that your main function was already left and your local variables are gone = invalid.

Try to add following lines at your proj.conf:

CONFIG_LOG=y
# CONFIG_LOG_PROCESS_THREAD=y
# CONFIG_LOG_INPLACE_PROCESS=y
CONFIG_LOG_IMMEDIATE=y
CONFIG_LOG_BACKEND_SHOW_COLOR=y

This will force the logger "execute" the log function.

Good luck!

Stefan

 

On 15/05/2019 11:52, lairdjm wrote:

Hi,

I’m seeing an issue whereby I am unable to log strings using LOG_DBG() and %s format, for a quick example I modified the hello world sample to enable logging and change the code to this:

#define LOG_DOMAIN test_domain

#include <logging/log.h>

LOG_MODULE_REGISTER(LOG_DOMAIN);

 

void main(void)

{

                char baTmpBuf[12];

                sprintf(baTmpBuf, "ffffffff");

                LOG_DBG("Test : %s", baTmpBuf);

 

                printk("Hello World! %s\n", CONFIG_BOARD);

}

I expect to see “Test : ffffffff” but instead I am getting “Test : %*”, if I change the code to inefficiently log each character, e.g.:

                LOG_DBG("Test : %c%c%c%c%c%c%c%c", baTmpBuf[0], baTmpBuf[1], baTmpBuf[2], baTmpBuf[3], baTmpBuf[4], baTmpBuf[5], baTmpBuf[6], baTmpBuf[7]);

Then I get the expected output: “Test : ffffffff”

 

So why is %s not outputting a string? If there a configuration option I have missed? I have tried toggling “Format strings with libc” option but it doesn’t change anything. I’m testing on an nRF52840 using the nrf52840_pca10056 board file.

Thanks,
Jamie

THIS MESSAGE, ANY ATTACHMENT(S), AND THE INFORMATION CONTAINED HEREIN MAY BE PROPRIETARY TO LAIRD CONNECTIVITY, INC. AND/OR ANOTHER PARTY, AND MAY FURTHER BE INTENDED TO BE KEPT CONFIDENTIAL. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DELETE THE EMAIL AND ANY ATTACHMENTS, AND IMMEDIATELY NOTIFY THE SENDER BY RETURN EMAIL. THIS MESSAGE AND ITS CONTENTS ARE THE PROPERTY OF LAIRD CONNECTIVITY, INC. AND MAY NOT BE REPRODUCED OR USED WITHOUT THE EXPRESS WRITTEN CONSENT OF LAIRD CONNECTIVITY, INC.


Re: Logging with a string via %s

Stefan Jaritz
 

Hey Lairdjm,


Depending on you logging setup, the log of the string is done inside the "LOG_DBG" command or later.

Later means, that your main function was already left and your local variables are gone = invalid.

Try to add following lines at your proj.conf:

CONFIG_LOG=y
# CONFIG_LOG_PROCESS_THREAD=y
# CONFIG_LOG_INPLACE_PROCESS=y
CONFIG_LOG_IMMEDIATE=y
CONFIG_LOG_BACKEND_SHOW_COLOR=y

This will force the logger "execute" the log function.

Good luck!

Stefan


On 15/05/2019 11:52, lairdjm wrote:

Hi,

I’m seeing an issue whereby I am unable to log strings using LOG_DBG() and %s format, for a quick example I modified the hello world sample to enable logging and change the code to this:

#define LOG_DOMAIN test_domain

#include <logging/log.h>

LOG_MODULE_REGISTER(LOG_DOMAIN);

 

void main(void)

{

                char baTmpBuf[12];

                sprintf(baTmpBuf, "ffffffff");

                LOG_DBG("Test : %s", baTmpBuf);

 

                printk("Hello World! %s\n", CONFIG_BOARD);

}

I expect to see “Test : ffffffff” but instead I am getting “Test : %*”, if I change the code to inefficiently log each character, e.g.:

                LOG_DBG("Test : %c%c%c%c%c%c%c%c", baTmpBuf[0], baTmpBuf[1], baTmpBuf[2], baTmpBuf[3], baTmpBuf[4], baTmpBuf[5], baTmpBuf[6], baTmpBuf[7]);

Then I get the expected output: “Test : ffffffff

 

So why is %s not outputting a string? If there a configuration option I have missed? I have tried toggling “Format strings with libc” option but it doesn’t change anything. I’m testing on an nRF52840 using the nrf52840_pca10056 board file.

Thanks,
Jamie

THIS MESSAGE, ANY ATTACHMENT(S), AND THE INFORMATION CONTAINED HEREIN MAY BE PROPRIETARY TO LAIRD CONNECTIVITY, INC. AND/OR ANOTHER PARTY, AND MAY FURTHER BE INTENDED TO BE KEPT CONFIDENTIAL. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DELETE THE EMAIL AND ANY ATTACHMENTS, AND IMMEDIATELY NOTIFY THE SENDER BY RETURN EMAIL. THIS MESSAGE AND ITS CONTENTS ARE THE PROPERTY OF LAIRD CONNECTIVITY, INC. AND MAY NOT BE REPRODUCED OR USED WITHOUT THE EXPRESS WRITTEN CONSENT OF LAIRD CONNECTIVITY, INC.


Re: Logging with a string via %s

lairdjm
 

> sprintf(baTmpBuf, "%s", "ffffffff");

Using that works fine, it just doesn’t like it when a variable is used.

 

THIS MESSAGE, ANY ATTACHMENT(S), AND THE INFORMATION CONTAINED HEREIN MAY BE PROPRIETARY TO LAIRD CONNECTIVITY, INC. AND/OR ANOTHER PARTY, AND MAY FURTHER BE INTENDED TO BE KEPT CONFIDENTIAL. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DELETE THE EMAIL AND ANY ATTACHMENTS, AND IMMEDIATELY NOTIFY THE SENDER BY RETURN EMAIL. THIS MESSAGE AND ITS CONTENTS ARE THE PROPERTY OF LAIRD CONNECTIVITY, INC. AND MAY NOT BE REPRODUCED OR USED WITHOUT THE EXPRESS WRITTEN CONSENT OF LAIRD CONNECTIVITY, INC.


Re: Logging with a string via %s

"K.I.R.A.
 

sprintf(baTmpBuf, "%s", "ffffffff"); ?

---Original---
From: "lairdjm"<jamie.mccrae@...>
Date: Wed, May 15, 2019 18:52 PM
To: "devel@..."<devel@...>;
Subject: [Zephyr-devel] Logging with a string via %s

Hi,

I’m seeing an issue whereby I am unable to log strings using LOG_DBG() and %s format, for a quick example I modified the hello world sample to enable logging and change the code to this:

#define LOG_DOMAIN test_domain

#include <logging/log.h>

LOG_MODULE_REGISTER(LOG_DOMAIN);

 

void main(void)

{

               char baTmpBuf[12];

               sprintf(baTmpBuf, "ffffffff");

               LOG_DBG("Test : %s", baTmpBuf);

 

               printk("Hello World! %s\n", CONFIG_BOARD);

}

I expect to see “Test : ffffffff” but instead I am getting “Test : %*”, if I change the code to inefficiently log each character, e.g.:

                LOG_DBG("Test : %c%c%c%c%c%c%c%c", baTmpBuf[0], baTmpBuf[1], baTmpBuf[2], baTmpBuf[3], baTmpBuf[4], baTmpBuf[5], baTmpBuf[6], baTmpBuf[7]);

Then I get the expected output: “Test : ffffffff

 

So why is %s not outputting a string? If there a configuration option I have missed? I have tried toggling “Format strings with libc” option but it doesn’t change anything. I’m testing on an nRF52840 using the nrf52840_pca10056 board file.

Thanks,
Jamie

THIS MESSAGE, ANY ATTACHMENT(S), AND THE INFORMATION CONTAINED HEREIN MAY BE PROPRIETARY TO LAIRD CONNECTIVITY, INC. AND/OR ANOTHER PARTY, AND MAY FURTHER BE INTENDED TO BE KEPT CONFIDENTIAL. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DELETE THE EMAIL AND ANY ATTACHMENTS, AND IMMEDIATELY NOTIFY THE SENDER BY RETURN EMAIL. THIS MESSAGE AND ITS CONTENTS ARE THE PROPERTY OF LAIRD CONNECTIVITY, INC. AND MAY NOT BE REPRODUCED OR USED WITHOUT THE EXPRESS WRITTEN CONSENT OF LAIRD CONNECTIVITY, INC.


Logging with a string via %s

lairdjm
 

Hi,

I’m seeing an issue whereby I am unable to log strings using LOG_DBG() and %s format, for a quick example I modified the hello world sample to enable logging and change the code to this:

#define LOG_DOMAIN test_domain

#include <logging/log.h>

LOG_MODULE_REGISTER(LOG_DOMAIN);

 

void main(void)

{

                char baTmpBuf[12];

                sprintf(baTmpBuf, "ffffffff");

                LOG_DBG("Test : %s", baTmpBuf);

 

                printk("Hello World! %s\n", CONFIG_BOARD);

}

I expect to see “Test : ffffffff” but instead I am getting “Test : %*”, if I change the code to inefficiently log each character, e.g.:

                LOG_DBG("Test : %c%c%c%c%c%c%c%c", baTmpBuf[0], baTmpBuf[1], baTmpBuf[2], baTmpBuf[3], baTmpBuf[4], baTmpBuf[5], baTmpBuf[6], baTmpBuf[7]);

Then I get the expected output: “Test : ffffffff

 

So why is %s not outputting a string? If there a configuration option I have missed? I have tried toggling “Format strings with libc” option but it doesn’t change anything. I’m testing on an nRF52840 using the nrf52840_pca10056 board file.

Thanks,
Jamie

THIS MESSAGE, ANY ATTACHMENT(S), AND THE INFORMATION CONTAINED HEREIN MAY BE PROPRIETARY TO LAIRD CONNECTIVITY, INC. AND/OR ANOTHER PARTY, AND MAY FURTHER BE INTENDED TO BE KEPT CONFIDENTIAL. IF YOU ARE NOT THE INTENDED RECIPIENT, PLEASE DELETE THE EMAIL AND ANY ATTACHMENTS, AND IMMEDIATELY NOTIFY THE SENDER BY RETURN EMAIL. THIS MESSAGE AND ITS CONTENTS ARE THE PROPERTY OF LAIRD CONNECTIVITY, INC. AND MAY NOT BE REPRODUCED OR USED WITHOUT THE EXPRESS WRITTEN CONSENT OF LAIRD CONNECTIVITY, INC.


Re: #ble Refresh advertising data after disconnect #ble

Johan Hedberg
 

Hi Robert,

On 14 May 2019, at 18.18, robert.konc@controlmatik.eu wrote:
In disconnect callback event I was try to update advertising data but function "bt_le_adv_update_data" return with -11 (error code).
As I understand BLE stack start to advwrise after disconnect automaticly. Is there and event or callback function that indicate this.
I can not use disconnect event because this event is fired befor stack start to advertise.

Any suggestion?
You could try using BT_LE_ADV_OPT_ONE_TIME with bt_le_adv_start(). That should ensure that the stack doesn’t automatically restart advertising after a disconnection event.

Johan


Upcoming Event: Zephyr Project: APIs - Tue, 05/14/2019 9:00am-10:00am, Please RSVP #cal-reminder

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

Reminder: Zephyr Project: APIs

When: Tuesday, 14 May 2019, 9:00am to 10:00am, (GMT-07:00) America/Los Angeles

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

An RSVP is requested. Click here to RSVP

Organizer: devel@...

Description: Join from PC, Mac, Linux, iOS or Android: https://zoom.us/j/177647878

Or iPhone one-tap :
    US: +16465588656,,177647878# or +16699006833,,177647878# 
Or Telephone:
    Dial(for higher quality, dial a number based on your current location): 
        US: +1 646 558 8656 or +1 669 900 6833 or +1 855 880 1246 (Toll Free) or +1 877 369 0926 (Toll Free)
    Meeting ID: 177 647 878
    International numbers available: https://zoom.us/zoomconference?m=ioAR9GK1OE5LkN1ojt-heTCl7yPcJrhY


 Live meeting minutes: https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit?usp=sharing


#ble Refresh advertising data after disconnect #ble

robert.konc@...
 

In disconnect callback event I was try to update advertising data but function "bt_le_adv_update_data" return with -11 (error code).
As I understand BLE stack start to advwrise after disconnect automaticly. Is there and event or callback function that indicate this.
I can not use disconnect event because this event is fired befor stack start to advertise.

Any suggestion?

Best regards

 


Re: [Zephyr Main] WEST File Initialization Problem

M Rizwan Ghori <rizwanghori@...>
 

Thank you for your help. I have successfully installed Zephyr.
Now basically i want to do project in Zephyr and will use ReNode for simulation purposes. As i am quite new in this area. I have already installed Zephyr and in my view renode as well. While going through the Re Node tutorial for Running Your First Demo i am facing problem. I am using Ubuntu for my project. I have written following line in my Ubuntu Terminal and getting errors and unable to run the first demo.

rizwan@rizwan-virtual-machine:~/renode1/opt/renode/scripts/single-node$ include stm32f4_discovery.resc
include: command not found
rizwan@rizwan-virtual-machine:~/renode1/opt/renode/scripts/single-node$ renode

Command 'renode' not found, did you mean:

  command 'recode' from deb recode

Try: sudo apt install <deb name>

rizwan@rizwan-virtual-machine:~/renode1/opt/renode/scripts/single-node$ cd /home/rizwan
rizwan@rizwan-virtual-machine:~$ renode

Command 'renode' not found, did you mean:

  command 'recode' from deb recode

Try: sudo apt install <deb name>

rizwan@rizwan-virtual-machine:~$

Kindly advise.

Best Regards


Best Regards




From: Cufi, Carles <Carles.Cufi@...>
Sent: Sunday, March 31, 2019 6:07 PM
To: rizwanghori@...; VanCutsem, Geoffroy; Marti Bolivar
Cc: devel@...
Subject: RE: [Zephyr-devel] [Zephyr Main] WEST File Initialization Problem
 

Hi there,

 

This has been a bug that has popped up several times in the past with Ubuntu:

https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1588562

 

As mentioned by others, please add the following line you your ~/.bashrc:

 

export PATH=$PATH:~/.local/bin

 

Regards,

 

Carles

 

From: devel@... <devel@...> On Behalf Of via Lists.Zephyrproject.Org
Sent: 31 March 2019 08:13
To: VanCutsem, Geoffroy <geoffroy.vancutsem@...>; Marti Bolivar <marti@...>
Cc: devel@...
Subject: Re: [Zephyr-devel] [Zephyr Main] WEST File Initialization Problem

 

Dear,

 

Thank you all for the quick response. Here is the copy paste code.

 

  • pip3 install --user west

        runs fine, after this i have run the following command and it echos the error shown below.

 

  • mrg@mrg-Lenovo-ideapad-110-15ISK:~$ west --version

 

Command 'west' not found, did you mean:

 

  command 'test' from deb coreutils

 

Try: sudo apt install <deb name>

  • mrg@mrg-Lenovo-ideapad-110-15ISK:~$ pip3 show -f west

Name: west

Version: 0.5.7

Summary: Zephyr RTOS Project meta-tool (wrapper and bootstrap)

Author: Zephyr Project

Author-email: devel@...

License: UNKNOWN

Location: /home/mrg/.local/lib/python3.6/site-packages

Requires: configobj, PyYAML, colorama, pykwalify

Files:

  ../../../bin/west

  west-0.5.7.dist-info/DESCRIPTION.rst

  west-0.5.7.dist-info/INSTALLER

  west-0.5.7.dist-info/METADATA

  west-0.5.7.dist-info/RECORD

  west-0.5.7.dist-info/WHEEL

  west-0.5.7.dist-info/entry_points.txt

  west-0.5.7.dist-info/metadata.json

  west-0.5.7.dist-info/top_level.txt

  west/_bootstrap/__init__.py

  west/_bootstrap/__pycache__/__init__.cpython-36.pyc

  west/_bootstrap/__pycache__/main.cpython-36.pyc

  west/_bootstrap/__pycache__/version.cpython-36.pyc

  west/_bootstrap/main.py

  west/_bootstrap/version.py

  west/_bootstrap/west-schema.yml

 

Kindly advise

 

Best Regards

Muhammad Rizwan Ghori

USM Fellow,

School of Computer Sciences,

Universiti Sains Malaysia (USM),
       

 

 


From: VanCutsem, Geoffroy <geoffroy.vancutsem@...>
Sent: Friday, March 29, 2019 2:15 PM
To: M Rizwan Ghori; Marti Bolivar
Cc: Brett Preston;
devel@...
Subject: RE: [Zephyr-devel] [Zephyr Main] WEST File Initialization Problem

 

Can you paste on this thread what the output of “pip3 show –f west” and “echo $PATH” return?

 

From: devel@... [mailto:devel@...] On Behalf Of M Rizwan Ghori
Sent: Friday, March 29, 2019 6:08 AM
To: Marti Bolivar <
marti@...>
Cc: Brett Preston <
bpreston@...>; devel@...
Subject: Re: [Zephyr-devel] [Zephyr Main] WEST File Initialization Problem

 

Dear,

I am using Ubuntu 18.04.

Moreover, the path of West file is after running the command

"pip3 show -f west"

is

home/rizwan/.local/python 3.6/packages

Subsequently, i have installed all the stuff related to Zephyr including Cmake and Zephyr sdk in a path

/home/rizwan/zaphyr

Kindly advise.

 

Rizwan

 

From: Marti Bolivar

Sent: Friday, 29 March, 12:43 pm

Subject: Re: [Zephyr-devel] [Zephyr Main] WEST File Initialization Problem

To: M Rizwan Ghori

Cc: Brett Preston, devel@...

What version of Ubuntu are you using?

If you ran "pip3 install --user west" and west cannot be run afterwards, it sounds like the directory that the west binary was installed into is not on your $PATH. Older versions of Ubuntu sometimes have this issue; I forget which ones.

Usually this directory is ~/.local/bin. Please ensure this directory is on your PATH environment variable and try again.

If that doesn't work, you can confirm where west was installed by running "pip3 show -f west"; check both the Location: value and the [...]/bin/west relative path in the Files: list that follows.

Marti

On Thu, Mar 28, 2019, 10:22 PM M Rizwan Ghori <rizwanghori@...> wrote:

Hi,

Thank you for your kind response. I am using Ubuntu OS for the project. I have followed all the installation steps given on webpage (Linux)

Moreover, after following all the steps of aforementioned link, i started the next step given on the following link.

Commands Tried on Ubuntu:

west init zephyrproject Error Received on Execution of the aforementioned commands:

Best Regards

Muhammad Rizwan Ghori

USM Fellow,

Universiti Sains Malaysia (USM),

 

From: Marti Bolivar <marti@...>

Sent: Friday, March 29, 2019 8:44:47 AM

To: Brett Preston

Cc: M Rizwan Ghori; devel@...

Subject: Re: [Zephyr-devel] [Zephyr Main] WEST File Initialization Problem

 

Hi,

Happy to try to help, but could you please provide details? The below email is a bit vague: "commands given on the website cannot recognize the West file" doesn't provide much context on what went wrong.

- what is your host operating system?

- what commands did you type?

- what was the output?

- what output did you expect?

Feel free to just copy and paste rather than taking screenshots of the terminal window.

Thanks,

Marti

On Thu, Mar 28, 2019, 9:39 PM Brett Preston <bpreston@...> wrote:

Sorry - forwarding from the main mail list to devel@...

On Thu, Mar 28, 2019 at 8:37 PM M Rizwan Ghori <rizwanghori@...> wrote:

Dear,

I am trying to use Zephyr in my research project. I am following the steps given on this website for the Zephyr installation. During the process i am facing problem regarding the initialization of West. The commands given on the website cannot recognize the West file. Kindly advise. Waiting for your kind reply.

Best Regards

 

 

--

Brett Preston

Sr. Program Manager

The Linux Foundation

+1 (971) 303-9030

 

1701 - 1720 of 7679