Date   

the defect of memory pool bitmap

吴升 <wusheng@...>
 

My opinion is as follows

 


Re: Get BT MAC addr in zephyr

Johan Hedberg
 

Hi Tommy,

On 25 Mar 2019, at 6.10, Tommy Lin (林志聰) <Tommy.Lin@quantatw.com> wrote:
We use Nordic 51824 with Zephyr 1.13 version.
By default, the Nordic BLE address is derived from the NRF_FICR->DEVICEADDR[] register.
We use “bluetoothctl show” and can get a random mac address.
1.I don’t know if the random mac address is from NRF_FICR->DEVICEADDR[] register ?
2.Every time , the mac address will be different value , if I delete /var/lib/Bluetooth/static-xx:xx:xx:xx:xx:xx folder and then reboot device.
I expect the random mac address from NRF_FICR->DEVICEADDR[] register should be fixed , am I right ?
It’s always the responsibility of the host to set the random address. When you do a combined build of Zephyr (both controller and host) the FICR address will be used. However, if you’re running BlueZ as the host, it’s the responsibility of BlueZ to set the random address. There’s no standard HCI command to read the FICR value from the controller. Zephyr does have HCI vendor commands for that, but if I remember right BlueZ does not support those yet. If you don’t care about the FICR address specifically, but just want a fixed static random address, then any recent bluetoothd version (>= 5.44) will generate this for you automatically (that’s the /var/lib/bluetooth/static- file that you referred to).

Johan


Get BT MAC addr in zephyr

Tommy Lin (林志聰) <Tommy.Lin@...>
 

Hi Zephyr,

We use Nordic 51824 with Zephyr 1.13 version.

By default, the Nordic BLE address is derived from the NRF_FICR->DEVICEADDR[] register.

We use “bluetoothctl show” and can get a random mac address.

1.I don’t know if the random mac address is from NRF_FICR->DEVICEADDR[] register ?

2.Every time , the mac address will be different value , if I delete /var/lib/Bluetooth/static-xx:xx:xx:xx:xx:xx folder and then reboot device.

 I expect the random mac address from NRF_FICR->DEVICEADDR[] register should be fixed , am I right ?

 

 

 

Thanks

Tommy


Use GH labels, save time

alpi@...
 

Hi,

Lots of GitHub issues and PRs are being created daily.

To help us manage them we have “labels”: to classify them by area, type, priority, or to mark them in need of attention.

 

When creating a GitHub issue or pull request, remember to add the appropriate labels.

It takes a couple of seconds.

If you are reviewing a PR, and there is missing or incorrect labels, fix it *

This will save us all time when searching,

reduce the chances of your PR/issue being forgotten,

speed up reviewing,

reduce the changes of duplicates, etc.

 

Best regards,

Alberto Escolar Piedras

 

*(1st time contributors cannot add labels)


Re: [Bluetooth Mesh] How is the correct way to make a self provision #bluetoothmesh #zephyrbluetoothmesh

Johan Hedberg
 

Hi Lucas,

(added zephyr-devel back to CC since this info may benefit others as well)

On 21 Mar 2019, at 21.29, Lucas Peixoto <lucaspeixotoac@gmail.com> wrote:
Interesting, I was using this CONFIG_BT_SETTINGS because I got it on other project. I did what you said and the errors were gone, thank you, apparently is working. One more thing, this messages "<wrn> bt_mesh_cfg_cli: Unexpected App Key Status message" are normal or is missing something?
No, that’s normal. It means you used the configuration client API without requesting it to wait for the response messages from the (local) configuration server. In that case the client code considers the responses unexpected since it didn't saved any context for the pending request.

Johan


Re: [Bluetooth Mesh] How is the correct way to make a self provision #bluetoothmesh #zephyrbluetoothmesh

Lucas Peixoto <lucaspeixotoac@...>
 

Interesting, I was using this CONFIG_BT_SETTINGS because I got it on other project. I did what you said and the errors were gone, thank you, apparently is working. One more thing, this messages "<wrn> bt_mesh_cfg_cli: Unexpected App Key Status message" are normal or is missing something?


Re: [Bluetooth Mesh] How is the correct way to make a self provision #bluetoothmesh #zephyrbluetoothmesh

Johan Hedberg
 

Hi Lucas,

It looks like you’ve enabled CONFIG_BT_SETTINGS, but are not calling settings_load() in your app. It might explain the behaviour you’re seeing, since you’re effectively leaving the stack partially uninitialised without an identity address. Since you mentioned the mesh_demo app, you could e.g. look at where/how it calls settings_load().

Johan

On 21 Mar 2019, at 20.34, Lucas Peixoto <lucaspeixotoac@gmail.com> wrote:

[Edited Message Follows]

Hello, I need help to understand what is the correct way to make a self provision. I have two boards(nrf52_pca10040) and them will be provisioned on the same network to make some tests. So far I was using my phone(nRF mesh) to make the provision. However this approach was delaying the development, so I decided use self provision. Reading some examples like bluetooth/mesh_demo I implemented this:

<bt_ready.png>
<self_configure1.png><self_configure2.png><self_provision.png>


Below I show the necessary elements and srv models to solve my problem:

<elements_models.png>

The problem is that when I flashed the firmware I got this:

<log_self_provision.png>

"Advertising failed: err -22" and "Failed to avertise using Network ID" keep happening all the time, in loop. So what I need to do to solve this?

@EDIT: err -22 is related to "Invalid Argument" according to the errno.h, but I don't know exactly which one.


[Bluetooth Mesh] How is the correct way to make a self provision #bluetoothmesh #zephyrbluetoothmesh

Lucas Peixoto <lucaspeixotoac@...>
 
Edited

Hello, I need help to understand what is the correct way to make a self provision. I have two boards(nrf52_pca10040) and them will be provisioned on the same network to make some tests. So far I was using my phone(nRF mesh) to make the provision. However this approach was delaying the development, so I decided use self provision. Reading some examples like bluetooth/mesh_demo I implemented this:





Below I show the necessary elements and srv models to solve my problem:



The problem is that when I flashed the firmware I got this:



"Advertising failed: err -22" and "Failed to avertise using Network ID" keep happening all the time, in loop.  So what I need to do to solve this?

@EDIT: err -22 is related to "Invalid Argument" according to the errno.h, but I don't know exactly which one.


Re: LE pair disconnected

Tommy Lin (林志聰) <Tommy.Lin@...>
 

Hi Thea Aldrich,

The issue has been fixed.


Thank You,
Tommy

寄件者: Thea Aldrich <aldrich.thea@...>
寄件日期: 2019年3月21日 下午 08:54
收件者: Tommy Lin (林志聰); Thea Aldrich
副本: Hedberg, Johan; Chettimada, Vinayak Kariappa; Isaac Chen (陳尚航); Ryan Erickson; Jamie Mccrae; zephyr-devel@...; Hanyu.Hsu@...; Ryan Hsu (徐振鋒)
主旨: Re: [Zephyr-devel] LE pair disconnected
 
Hi Tommy,
I wanted to circle back around to make sure you were able to get your questions answered. If not, please let me know and I will help get you the answers you need. 

If you have not done so already, you can join our Slack channel where most of the developers and maintainers are available. It is a great place to ask questions and talk to the community.
Best,
Thea Aldrich

On Mon, Mar 18, 2019 at 6:01 AM Tommy Lin (林志聰) <Tommy.Lin@...> wrote:

Hi Johan,

sorry to bother you again.

We try to launch Bluetooth service.

After typing “systemctl status bluetooth.service” , some error messages as following:

Could you give us some suggestions.

 

Thank You,

Tommy

From: Tommy Lin (林志聰)
Sent: Wednesday, March 13, 2019 8:19 PM
To: 'Hedberg, Johan' <johan.hedberg@...>; 'Chettimada, Vinayak Kariappa' <vinayak.kariappa.chettimada@...>
Cc: Isaac Chen (
陳尚航) <Isaac_Chen@...>; 'Ryan Erickson' <Ryan.Erickson@...>; 'Jamie Mccrae' <Jamie.Mccrae@...>; 'zephyr-devel@...' <zephyr-devel@...>; 'Hanyu.Hsu@...' <Hanyu.Hsu@...>; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>
Subject: RE: [Zephyr-devel] LE pair disconnected

 

Sorry,

I also add bluetoothd file to /usr/libexec/bluetooth/

 

Thanks

Tommy

From: Tommy Lin (林志聰)
Sent: Wednesday, March 13, 2019 8:14 PM
To: 'Hedberg, Johan' <johan.hedberg@...>; Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...>
Cc: Isaac Chen (
陳尚航) <Isaac_Chen@...>; Ryan Erickson <Ryan.Erickson@...>; Jamie Mccrae <Jamie.Mccrae@...>; zephyr-devel@...; Hanyu.Hsu@...; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>
Subject: RE: [Zephyr-devel] LE pair disconnected

 

Hi Johan,

Thanks for your information

 

I do following things:

1.     add Bluetooth.service file to /lib/systemd/system/bluetooth.service

2.     add bluetooth.conf file to /etc/dbus-1/system.d

 

and start Bluetooth service , but it is still auto disconnection after connection.

 

Could you continue to give us some suggestions

 

Thank You,

Tommy

-----Original Message-----


From: Hedberg, Johan [mailto:johan.hedberg@...]
Sent: Wednesday, March 13, 2019 4:55 PM
To: Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...>
Cc: Tommy Lin (
林志聰) <Tommy.Lin@...>; Isaac Chen (陳尚航) <Isaac_Chen@...>; Ryan Erickson <Ryan.Erickson@...>; Jamie Mccrae <Jamie.Mccrae@...>; zephyr-devel@...; Hanyu.Hsu@...; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>
Subject: Re: [Zephyr-devel] LE pair disconnected

 

Hi,

 

The Linux kernel has a 2 second timeout for any connection that doesnt have users. Users in this context are e.g. any user space sockets that use the connection. Normally when bluetoothd is running it owns the ATT socket, so theres always at least one user. It sounds to me like Tommy might not have bluetoothd or any other GATT server running. Anyway, this is starting to be a bit off-topic for the Zephyr mailing list.

 

Johan

 

> On 13 Mar 2019, at 10.50, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:

>

> Hi Tommy,

> Sorry, I am not able to try out your usecase on Bluez, as it has been quite sometime that I have been using with Bluez, due to my priorities, you may have to wait or ask someone else on the maillist to investigate the reasons for the host to disconnect the link.

> I am suspecting that you are not running at client that subscribes to a service, and hence the lost host decides to disconnect the idle link.

> Regards,

> Vinayak

> From: Tommy Lin (林志聰) <Tommy.Lin@...>

> Sent: 13 March 2019 08:41

> To: Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...>; Isaac Chen (陳尚航) <Isaac_Chen@...>; Ryan Erickson <Ryan.Erickson@...>; Jamie Mccrae <Jamie.Mccrae@...>; zephyr-devel@...

> Cc: Hanyu.Hsu@...; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>

> Subject: RE: [Zephyr-devel] LE pair disconnected

> Hi Vinayak,

> sorry to bother you again.

> In your experience , what reason will cause CONNECTION TERMINATED BY LOCAL HOST

> > HCI Event: Disconnect Complete (0x05) plen 4                                                                                                                                                                          

>         Status: Success (0x00)

>         Reason: Connection Terminated By Local Host (0x16)

> @ MGMT Event: Device Disconnected (0x000c) plen 8                                                                                                                                                             

>         LE Address: 7A:03:05:31:E7:E6 (Resolvable)

>         Reason: Connection terminated by local host (0x02)

> <image001.png>

> Thank You,

> Tommy

> From: Tommy Lin (林志聰)

> Sent: Tuesday, March 5, 2019 11:29 AM

> To: 'Chettimada, Vinayak Kariappa' <vinayak.kariappa.chettimada@...>; Isaac Chen (陳尚航) <Isaac_Chen@...>; 'Ryan Erickson' <Ryan.Erickson@...>; 'Jamie Mccrae' <Jamie.Mccrae@...>; 'zephyr-devel@...' <zephyr-devel@...>

> Cc: 'Hanyu.Hsu@...' <Hanyu.Hsu@...>; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>

> Subject: RE: [Zephyr-devel] LE pair disconnected

> Hi Vinayak,

> btmon logs has been put in Attachment.

> Thank You.

> Tommy

> From: Chettimada, Vinayak Kariappa [mailto:vinayak.kariappa.chettimada@...]

> Sent: Monday, March 4, 2019 3:50 PM

> To: Isaac Chen (陳尚航) <Isaac_Chen@...>; Tommy Lin (林志聰) <Tommy.Lin@...>; Ryan Erickson <Ryan.Erickson@...>; Jamie Mccrae <Jamie.Mccrae@...>; zephyr-devel@...

> Cc: Hanyu.Hsu@...; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>

> Subject: Re: [Zephyr-devel] LE pair disconnected

> Hi,

> Could you please provide the btmon HCI logs?

> Regards,

> Vinayak

> From: "Isaac Chen (陳尚航)" <Isaac_Chen@...>

> Date: Monday, 4 March 2019 at 8:01 AM

> To: "Tommy Lin (林志聰)" <Tommy.Lin@...>, Ryan Erickson <Ryan.Erickson@...>, Jamie Mccrae <Jamie.Mccrae@...>, Vinayak Chettimada <vinayak.kariappa.chettimada@...>, "zephyr-devel@..." <zephyr-devel@...>

> Cc: "Hanyu.Hsu@..." <Hanyu.Hsu@...>, "Ryan Hsu (徐振鋒)" <Ryan.Hsu@...>

> Subject: RE: [Zephyr-devel] LE pair disconnected

> Hi Zephyr team,

> We can find this issue on nRF51 DK and our custom board with zephyr source code(samples/bluetooth/hci_uart). Could you give us your advice on how to solve this issue?

> Best Regards

> Isaac Chen

> Quanta Computer Inc.

> Business Unit 11 BL1

> Tel  : +886-3-327-2345 Ext : 17585

> This transmission is intended only for the use of the addressed recipient and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, any use of this communication is strictly prohibited. If you have received this communication in error, please kindly notify the sender and delete this message immediately.

> From: Tommy Lin (林志聰)

> Sent: Wednesday, February 27, 2019 4:03 PM

> To: Ryan Erickson; Jamie Mccrae; Isaac Chen (陳尚航); Chettimada, Vinayak Kariappa; zephyr-devel@...

> Cc: Hanyu.Hsu@...; Ryan Hsu (徐振鋒)

> Subject: [Zephyr-devel] LE pair disconnected

>  

> Hi Ryan Erickson,

> We use zephyr source code(samples/bluetooth/hci_uart) , and type following commands:

> After then , we can find out device(named 2019bt) in our phone , and we can pair it.

> But 2019bt will be disconnected after about two second at connected.

> Could you give us some suggestions

> Thank  You.

> <image002.jpg>

 


Re: LE pair disconnected

Thea Aldrich
 

Hi Tommy,
I wanted to circle back around to make sure you were able to get your questions answered. If not, please let me know and I will help get you the answers you need. 

If you have not done so already, you can join our Slack channel where most of the developers and maintainers are available. It is a great place to ask questions and talk to the community.
Best,
Thea Aldrich


On Mon, Mar 18, 2019 at 6:01 AM Tommy Lin (林志聰) <Tommy.Lin@...> wrote:

Hi Johan,

sorry to bother you again.

We try to launch Bluetooth service.

After typing “systemctl status bluetooth.service” , some error messages as following:

Could you give us some suggestions.

 

Thank You,

Tommy

From: Tommy Lin (林志聰)
Sent: Wednesday, March 13, 2019 8:19 PM
To: 'Hedberg, Johan' <johan.hedberg@...>; 'Chettimada, Vinayak Kariappa' <vinayak.kariappa.chettimada@...>
Cc: Isaac Chen (
陳尚航) <Isaac_Chen@...>; 'Ryan Erickson' <Ryan.Erickson@...>; 'Jamie Mccrae' <Jamie.Mccrae@...>; 'zephyr-devel@...' <zephyr-devel@...>; 'Hanyu.Hsu@...' <Hanyu.Hsu@...>; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>
Subject: RE: [Zephyr-devel] LE pair disconnected

 

Sorry,

I also add bluetoothd file to /usr/libexec/bluetooth/

 

Thanks

Tommy

From: Tommy Lin (林志聰)
Sent: Wednesday, March 13, 2019 8:14 PM
To: 'Hedberg, Johan' <johan.hedberg@...>; Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...>
Cc: Isaac Chen (
陳尚航) <Isaac_Chen@...>; Ryan Erickson <Ryan.Erickson@...>; Jamie Mccrae <Jamie.Mccrae@...>; zephyr-devel@...; Hanyu.Hsu@...; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>
Subject: RE: [Zephyr-devel] LE pair disconnected

 

Hi Johan,

Thanks for your information

 

I do following things:

1.     add Bluetooth.service file to /lib/systemd/system/bluetooth.service

2.     add bluetooth.conf file to /etc/dbus-1/system.d

 

and start Bluetooth service , but it is still auto disconnection after connection.

 

Could you continue to give us some suggestions

 

Thank You,

Tommy

-----Original Message-----


From: Hedberg, Johan [mailto:johan.hedberg@...]
Sent: Wednesday, March 13, 2019 4:55 PM
To: Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...>
Cc: Tommy Lin (
林志聰) <Tommy.Lin@...>; Isaac Chen (陳尚航) <Isaac_Chen@...>; Ryan Erickson <Ryan.Erickson@...>; Jamie Mccrae <Jamie.Mccrae@...>; zephyr-devel@...; Hanyu.Hsu@...; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>
Subject: Re: [Zephyr-devel] LE pair disconnected

 

Hi,

 

The Linux kernel has a 2 second timeout for any connection that doesnt have users. Users in this context are e.g. any user space sockets that use the connection. Normally when bluetoothd is running it owns the ATT socket, so theres always at least one user. It sounds to me like Tommy might not have bluetoothd or any other GATT server running. Anyway, this is starting to be a bit off-topic for the Zephyr mailing list.

 

Johan

 

> On 13 Mar 2019, at 10.50, Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...> wrote:

>

> Hi Tommy,

> Sorry, I am not able to try out your usecase on Bluez, as it has been quite sometime that I have been using with Bluez, due to my priorities, you may have to wait or ask someone else on the maillist to investigate the reasons for the host to disconnect the link.

> I am suspecting that you are not running at client that subscribes to a service, and hence the lost host decides to disconnect the idle link.

> Regards,

> Vinayak

> From: Tommy Lin (林志聰) <Tommy.Lin@...>

> Sent: 13 March 2019 08:41

> To: Chettimada, Vinayak Kariappa <vinayak.kariappa.chettimada@...>; Isaac Chen (陳尚航) <Isaac_Chen@...>; Ryan Erickson <Ryan.Erickson@...>; Jamie Mccrae <Jamie.Mccrae@...>; zephyr-devel@...

> Cc: Hanyu.Hsu@...; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>

> Subject: RE: [Zephyr-devel] LE pair disconnected

> Hi Vinayak,

> sorry to bother you again.

> In your experience , what reason will cause CONNECTION TERMINATED BY LOCAL HOST

> > HCI Event: Disconnect Complete (0x05) plen 4                                                                                                                                                                          

>         Status: Success (0x00)

>         Reason: Connection Terminated By Local Host (0x16)

> @ MGMT Event: Device Disconnected (0x000c) plen 8                                                                                                                                                             

>         LE Address: 7A:03:05:31:E7:E6 (Resolvable)

>         Reason: Connection terminated by local host (0x02)

> <image001.png>

> Thank You,

> Tommy

> From: Tommy Lin (林志聰)

> Sent: Tuesday, March 5, 2019 11:29 AM

> To: 'Chettimada, Vinayak Kariappa' <vinayak.kariappa.chettimada@...>; Isaac Chen (陳尚航) <Isaac_Chen@...>; 'Ryan Erickson' <Ryan.Erickson@...>; 'Jamie Mccrae' <Jamie.Mccrae@...>; 'zephyr-devel@...' <zephyr-devel@...>

> Cc: 'Hanyu.Hsu@...' <Hanyu.Hsu@...>; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>

> Subject: RE: [Zephyr-devel] LE pair disconnected

> Hi Vinayak,

> btmon logs has been put in Attachment.

> Thank You.

> Tommy

> From: Chettimada, Vinayak Kariappa [mailto:vinayak.kariappa.chettimada@...]

> Sent: Monday, March 4, 2019 3:50 PM

> To: Isaac Chen (陳尚航) <Isaac_Chen@...>; Tommy Lin (林志聰) <Tommy.Lin@...>; Ryan Erickson <Ryan.Erickson@...>; Jamie Mccrae <Jamie.Mccrae@...>; zephyr-devel@...

> Cc: Hanyu.Hsu@...; Ryan Hsu (徐振鋒) <Ryan.Hsu@...>

> Subject: Re: [Zephyr-devel] LE pair disconnected

> Hi,

> Could you please provide the btmon HCI logs?

> Regards,

> Vinayak

> From: "Isaac Chen (陳尚航)" <Isaac_Chen@...>

> Date: Monday, 4 March 2019 at 8:01 AM

> To: "Tommy Lin (林志聰)" <Tommy.Lin@...>, Ryan Erickson <Ryan.Erickson@...>, Jamie Mccrae <Jamie.Mccrae@...>, Vinayak Chettimada <vinayak.kariappa.chettimada@...>, "zephyr-devel@..." <zephyr-devel@...>

> Cc: "Hanyu.Hsu@..." <Hanyu.Hsu@...>, "Ryan Hsu (徐振鋒)" <Ryan.Hsu@...>

> Subject: RE: [Zephyr-devel] LE pair disconnected

> Hi Zephyr team,

> We can find this issue on nRF51 DK and our custom board with zephyr source code(samples/bluetooth/hci_uart). Could you give us your advice on how to solve this issue?

> Best Regards

> Isaac Chen

> Quanta Computer Inc.

> Business Unit 11 BL1

> Tel  : +886-3-327-2345 Ext : 17585

> This transmission is intended only for the use of the addressed recipient and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, any use of this communication is strictly prohibited. If you have received this communication in error, please kindly notify the sender and delete this message immediately.

> From: Tommy Lin (林志聰)

> Sent: Wednesday, February 27, 2019 4:03 PM

> To: Ryan Erickson; Jamie Mccrae; Isaac Chen (陳尚航); Chettimada, Vinayak Kariappa; zephyr-devel@...

> Cc: Hanyu.Hsu@...; Ryan Hsu (徐振鋒)

> Subject: [Zephyr-devel] LE pair disconnected

>  

> Hi Ryan Erickson,

> We use zephyr source code(samples/bluetooth/hci_uart) , and type following commands:

> After then , we can find out device(named 2019bt) in our phone , and we can pair it.

> But 2019bt will be disconnected after about two second at connected.

> Could you give us some suggestions

> Thank  You.

> <image002.jpg>

 


Re: How to disable optimization in sanitycheck

alpi@...
 

> there are signs that there may be optimization enabled

 

Note that you can check the configuration sanitycheck used in the sanity-out folder,

for example for hello_world with native_posix the folder is:

sanity-out/native_posix/samples/hello_world/sample.helloworld/zephyr/.config

 

You can check there for CONFIG_NO_OPTIMIZATIONS=y

 

You also have the used make/ninja files there.

 

BR
Alberto

 

From: devel@... [mailto:devel@...] On Behalf Of Ooi, Cinly via Lists.Zephyrproject.Org
Sent: Thursday 21 March 2019 01:19
To: devel@...
Cc: devel@...
Subject: [Zephyr-devel] How to disable optimization in sanitycheck

 

Dear All

 

Is there an option (or any instruction on how to modify the code) to disable all optimization in sanitycheck?

 

Purpose: When I was looking at the code coverage report generated by sanitycheck, there are signs that there may be optimization enabled, e.g., only the middle of three C statements was not covered and the program execution is linear. I was exploring command line option to disable optimization but cannot find any

 

Then I was not sure whether something was optimized away with "Z_SYSCALL_HANDLER(funcName);" statement, i.e. a syscall handler with empty body

 

Many thanks in advance

Cinly


Re: How to disable optimization in sanitycheck

Marc Herbert
 

You may need one extra level of quotation, see --extra-args CMAKE_C_FLAGS example and sanitycheck pointer in https://github.com/zephyrproject-rtos/zephyr/pull/14593/files "test/determinism.sh"
 
http://resources.mpi-inf.mpg.de/departments/rg1/teaching/unixffb-ss98/quoting-guide.html


How to disable optimization in sanitycheck

Ooi, Cinly
 

Dear All

Is there an option (or any instruction on how to modify the code) to disable all optimization in sanitycheck?

Purpose: When I was looking at the code coverage report generated by sanitycheck, there are signs that there may be optimization enabled, e.g., only the middle of three C statements was not covered and the program execution is linear. I was exploring command line option to disable optimization but cannot find any

Then I was not sure whether something was optimized away with "Z_SYSCALL_HANDLER(funcName);" statement, i.e. a syscall handler with empty body

Many thanks in advance
Cinly


Re: Triggering Z_SYSCALL_HANDLER calls

Boie, Andrew P
 

You need to call the API from user mode in order to exercise the handler functions. If you call the APIs from supervisor mode, the software interrupt and handler function are bypassed and control goes directly into the implementation function.

 

HTH,

Andrew

 

From: devel@... [mailto:devel@...] On Behalf Of Ooi, Cinly
Sent: Wednesday, March 20, 2019 5:24 AM
To: devel@...
Subject: [Zephyr-devel] Triggering Z_SYSCALL_HANDLER calls

 

Dear All

 

I am trying to write some coverage test to cover  Z_SYSCALL_HANDLERs and I need some clue on how to start.  I know I have to set CONFIG_USERSPACE.

 

 

Normally for  Z_SYSCALL_HANDLER(funcA), gcov reports that  z_impl_funcA() were called, but the line Z_SYSCALL_HANDLER() might not be called. This is despite other Z_SYSCALL_HANDLER() are called. I see this in kernel/timer.c where

(1) Z_SYSCALL_HANDLER(k_timer_status_get) and z_impl_k_timer_status_get() were both being called, but

(2) Z_SYSCALL_HANDLER(k_timer_stop) not called but z_impl_k_timer_stop() was called

 

Many thanks in advance

Cinly


Re: How to enable DMA transfers for UART?

Paul Sokolovsky
 

Hello Stefan,

On Tue, 19 Mar 2019 15:18:02 +0000
"Stefan Jaritz" <stefan@kokoontech.com> wrote:

Hey,

I am currently experimenting with ZephyrOS on different tasks. My
base is an own dev board which has a stm32f4xx MCU that connects
different ICs etc. via UART, I2C, SPI & GPIOs.

Currently the UART ISR is too slow to catch all chars at a rx burst.
Usually I am using UART + DMA transfers to relieve the MCU and save
energy.
[]

So I am asking for help or some example how to do an UART & DMA.

Think having an ringbuffer for rx and an intr firing after n Bytes
received via DMA. Also doing the tx via DMA would be perfect. Any
ideas to setup the Zephyr drivers to do so?
Recently, a new "async" UART API was added to Zephyr, whose
implementation could leverage DMA support (that was one of usecases for
this API). There's an open ticket to implement it for STM32:
https://github.com/zephyrproject-rtos/zephyr/issues/13955

You're welcome to cooperate with the STM32 maintainers on implementing
it.

[]

--
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


Triggering Z_SYSCALL_HANDLER calls

Ooi, Cinly
 

Dear All

I am trying to write some coverage test to cover  Z_SYSCALL_HANDLERs and I need some clue on how to start.  I know I have to set CONFIG_USERSPACE.


Normally for  Z_SYSCALL_HANDLER(funcA), gcov reports that  z_impl_funcA() were called, but the line Z_SYSCALL_HANDLER() might not be called. This is despite other Z_SYSCALL_HANDLER() are called. I see this in kernel/timer.c where
(1) Z_SYSCALL_HANDLER(k_timer_status_get) and z_impl_k_timer_status_get() were both being called, but
(2) Z_SYSCALL_HANDLER(k_timer_stop) not called but z_impl_k_timer_stop() was called

Many thanks in advance
Cinly


Building multiple images

Sebastian Boe
 

Hi all,

due to how advanced security features (TEE) and device firmware
upgrade (MCUBoot) is organized we are seeing the need to boot
Zephyr applications in multiple stages. A real-world use-case of
even a 3-stage boot process has been identified and tested at
Nordic.

Each bootloader needs to be individually upgrade-able and have
it's own configurations of Zephyr libraries. To achieve this each
bootloader must be organized as it's own executable.

To make matters worse, in a multi-core AMP system each core would
also require at least one executable.

The problem is that the build system can only build one
executable. This creates a usability issue as the user must
invoke a large set of arcane commands to build, sign, and flash
each executable.

After considering many options we have finally ended up with a
solution proposal that is merge-ready. See the PR for details

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

Please add your feedback in the PR and let us know what you think
of the proposed change.

SEBASTIAN BØE | Software Developer
Trondheim, Norway
nordicsemi.com | devzone.nordicsemi.com


Building multiple images

Sebastian Boe
 

Hi all,

due to how advanced security features (TEE) and device firmware
upgrade (MCUBoot) is organized we are seeing the need to boot
Zephyr applications in multiple stages. A real-world use-case of
even a 3-stage boot process has been identified and tested at
Nordic.

Each bootloader needs to be individually upgrade-able and have
it's own configurations of Zephyr libraries. To achieve this each
bootloader must be organized as it's own executable.

To make matters worse, in a multi-core AMP system each core would
also require at least one executable.

The problem is that the build system can only build one
executable. This creates a usability issue as the user must
invoke a large set of arcane commands to build, sign, and flash
each executable.

After considering many options we have finally ended up with a
solution proposal that is merge-ready. See the PR for details

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

Please add your feedback in the PR and let us know what you think
of the proposed change.

SEBASTIAN BØE | Software Developer
Trondheim, Norway
nordicsemi.com | devzone.nordicsemi.com


Re: [Bluetooth mesh]How can I change device name at runtime in ./sample/bluetooth/mesh/?

Kai Ren
 

Thanks Johan, it's handy to use.


Best Regards,
Kai

-----Original Message-----
From: Hedberg, Johan <johan.hedberg@intel.com>
Sent: Tuesday, March 19, 2019 4:14 PM
To: Kai Ren <kren@bluetooth.com>
Cc: devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] [Bluetooth mesh]How can I change device name at runtime in ./sample/bluetooth/mesh/?

Hi Kai,

On 19 Mar 2019, at 6.55, Kai Ren <kren@bluetooth.com> wrote:
I’m using Zephyr v1.12.0 release, the sample code I used is ./sample/bluetooth/mesh/.
In this project, I know the device name (used at provisioning phase over PB-GATT) is predefined in *.prj file, CONFIG_BT_DEVICE_NAME . Is it possible to change the device name at runtime?
I plan to use chip’s factory ID to replace the predefined device name.
The bt_set_name() and bt_get_name() APIs were introduced in Zephyr 1.13.

Johan


Re: How to enable DMA transfers for UART?

Li, Jun R
 

Stefan,
I've ever implemented a DMA-enabled UART on STM32F4 boards, but based on much old version of zephyr. I can try rebasing it to the latest zephyr if you are interested.

Regards,
Jun


On 3/19/19, 08:18, "devel@lists.zephyrproject.org on behalf of Stefan Jaritz" <devel@lists.zephyrproject.org on behalf of stefan@kokoontech.com> wrote:

Hey,

I am currently experimenting with ZephyrOS on different tasks. My base
is an own dev board which has a stm32f4xx MCU that connects different
ICs etc. via UART, I2C, SPI & GPIOs.

Currently the UART ISR is too slow to catch all chars at a rx burst.
Usually I am using UART + DMA transfers to relieve the MCU and save energy.

I checked the UART stm32 api and saw that it is not utilizing things
like uart DMA transfers. But there is an complete DMA API available.
Yeah! Now I looked at the sample section to get a blueprint for doing
so. Ups! Nothing

So I am asking for help or some example how to do an UART & DMA.

Think having an ringbuffer for rx and an intr firing after n Bytes
received via DMA. Also doing the tx via DMA would be perfect. Any ideas
to setup the Zephyr drivers to do so?

Kind regards!

Stefan

PS: there is an nice article on that here

http://stm32f4-discovery.net/2017/07/stm32-tutorial-efficiently-receive-uart-data-using-dma/

2221 - 2240 of 8041