Date   

mcuboot usage guide

youqun
 

Hello experts,

 

The Zephyr(v1.10) project has run in my NRF52_PCA10040 board.

Mcuboot source code has been downloaded.

But Zephyr and mcuboot sites give very few info about how to use it.

 

Hope there is a guide or example for users about how to use mcuboot.

My project needs serial bootloader function.

 

 

Best Regards,

Youqun Sun


Re: [Zephyr-devel] Using Math function in zephyr

ashish.shukla@corvi.com <ashish.shukla@...>
 

Thanks a lot Michael, for your efforts. It works now. 


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Sat, Dec 23, 2017 at 4:54 PM, Michael Hope <michaelh@...> wrote:
Hi Ashish.  Here's a blow-by-blow:

https://asciinema.org/a/v1LmP0FCsV2Xyv8BqNKTF8pdy

-- Michael


On Fri, 22 Dec 2017 at 11:35 ashish.shukla@... <ashish.shukla@...> wrote:
Michael, I'm a newbie in Zephyr, can you please tell the steps to be followed to turn on float support for printf.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 2:39 PM, Michael Hope <michaelh@...> wrote:

printk probably doesn't support floating point args. Give printf a try and make sure that printf float support is turned on under 'make menuconfig'.


On Fri, 22 Dec 2017, 10:04 ashish.shukla@..., <ashish.shukla@...> wrote:
Hi,

It doesn't seem to be working for me. Here's a test program

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
printk("round up %d  \n\r",round(5.7));
printk("round down %d \n\r",round(5.2));
}

and output I get is

round up 1075314688
round down 1075052544

I'm working with nrf52840 uC.





--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 1:02 PM, Michael Hope <michaelh@...> wrote:
Huh, interesting.  It works for me in a test program:

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
        printf("round up: %f\n", round(1.9));
        printf("round down: %f\n", round(3.1));
}

"""
***** BOOTING ZEPHYR OS v1.10.99- - BUILD: Dec 21 2017 21:44:19 *****
round up: 2.000000
round down: 3.000000
"""

This is on BOARD=qemu_cortex_m3 which uses the ARM soft float ABI.  There's a chance that you've got a mix of hard float / soft float code but I thought the linker checked that.

What board is this for?

-- Michael

On Fri, 22 Dec 2017 at 08:17 ashish.shukla@... <ashish.shukla@...> wrote:
Hi Michael,

After switching to new library, code compiles but it rounds off all the values to 0.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 12:01 PM, Michael Hope <michaelh@...> wrote:
Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:
Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel





Re: Unable to set Appkey for generic server model

Mani Sadhasivam
 

Hi Johan,

On Sat, Dec 23, 2017 at 5:21 PM, Johan Hedberg <johan.hedberg@...> wrote:
Hi Mani,

On Sat, Dec 23, 2017, Mani Sadhasivam wrote:
> [bt] [ERR] model_send: Model not bound to AppKey 0x0001
>
> Thread used for publishing sensor data:
>
> void temp_work_thread(struct k_work *work)
> {
>         if (node_addr == BT_MESH_ADDR_UNASSIGNED)
>                 return;
>
>         struct net_buf_simple *msg = NET_BUF_SIMPLE(3 + 4);
>         struct bt_mesh_msg_ctx ctx = {
>                 .net_idx = 0,
>                 .app_idx = 1,
>                 .addr = BT_MESH_ADDR_ALL_NODES,
>                 .send_ttl = BT_MESH_TTL_DEFAULT,
>         };
>
>         bt_mesh_model_msg_init(msg, BT_MESH_MODEL_OP);
>         net_buf_simple_add_u8(msg, 1);
>
>         if (bt_mesh_model_send(&root_models[0], &ctx, msg, NULL, NULL)) {

A couple of things come to mind here:

Is root_models[0] really the model that's supposed to do the publishing?
It's often the Configuration Server Model, which would explain the error
you're getting. You didn't show the definition of your models array, so
I'm just guessing here.


You are right... Mistakenly specified the cfg_srv model. It is working fine now :)
 
Also, if this is really a formal publish message you're sending, you
should be using the bt_mesh_model_publish() API instead of
bt_mesh_model_send(). The latter is intended mainly for client model
messages as well as for the server's responses to those, and it doesn't
take into consideration things like the Model Publish Retransmit state
or that you're actually publishing using the configured publication
state (correct app key, destination address, TTL, etc).


Sure, will make use of it. Thanks for the clarification!

Regards,
Mani
 
Johan


Re: Unable to set Appkey for generic server model

Johan Hedberg
 

Hi Mani,

On Sat, Dec 23, 2017, Mani Sadhasivam wrote:
[bt] [ERR] model_send: Model not bound to AppKey 0x0001

Thread used for publishing sensor data:

void temp_work_thread(struct k_work *work)
{
if (node_addr == BT_MESH_ADDR_UNASSIGNED)
return;

struct net_buf_simple *msg = NET_BUF_SIMPLE(3 + 4);
struct bt_mesh_msg_ctx ctx = {
.net_idx = 0,
.app_idx = 1,
.addr = BT_MESH_ADDR_ALL_NODES,
.send_ttl = BT_MESH_TTL_DEFAULT,
};

bt_mesh_model_msg_init(msg, BT_MESH_MODEL_OP);
net_buf_simple_add_u8(msg, 1);

if (bt_mesh_model_send(&root_models[0], &ctx, msg, NULL, NULL)) {
A couple of things come to mind here:

Is root_models[0] really the model that's supposed to do the publishing?
It's often the Configuration Server Model, which would explain the error
you're getting. You didn't show the definition of your models array, so
I'm just guessing here.

Also, if this is really a formal publish message you're sending, you
should be using the bt_mesh_model_publish() API instead of
bt_mesh_model_send(). The latter is intended mainly for client model
messages as well as for the server's responses to those, and it doesn't
take into consideration things like the Model Publish Retransmit state
or that you're actually publishing using the configured publication
state (correct app key, destination address, TTL, etc).

Johan


Unable to set Appkey for generic server model

Mani Sadhasivam
 

Hello,

My objective is to use 96Boards carbons running Zephyr to form a mesh network for publishing sensor data. For testing purposes, I am using Generic ON/OFF server model for sending the sensor data to all nodes in the network, later this will get replaced by Sensor server model.

However, after provisioning the node using `meshctl` and binding AppKey to the model, publishing sensor data from node results in the below error:

[bt] [ERR] model_send: Model not bound to AppKey 0x0001

Thread used for publishing sensor data:

void temp_work_thread(struct k_work *work)
{
        if (node_addr == BT_MESH_ADDR_UNASSIGNED)
                return;

        struct net_buf_simple *msg = NET_BUF_SIMPLE(3 + 4);
        struct bt_mesh_msg_ctx ctx = {
                .net_idx = 0,
                .app_idx = 1,
                .addr = BT_MESH_ADDR_ALL_NODES,
                .send_ttl = BT_MESH_TTL_DEFAULT,
        };

        bt_mesh_model_msg_init(msg, BT_MESH_MODEL_OP);
        net_buf_simple_add_u8(msg, 1);

        if (bt_mesh_model_send(&root_models[0], &ctx, msg, NULL, NULL)) {
                printk("Unable to send sensor message\n");
                return;
        }

        printk("Sensor message sent with OpCode 0x%08x\n", BT_MESH_MODEL_OP);
 
}

Meshctl commands for provisioning and binding AppKey:

discover-unprovisioned on
provision 0108  # Node address 0108
menu config
target 0108
appkey-add 1
bind 0 1 1000 # bind AppKey 1 to model 1000 of 0th element

Above commands seems to succeed with below debug message:

[Zephyr-Node-0108]# target 0108
Configuring node 0108
[config: Target = 0108]# target 0108[config: Target = 0108]# appkey-add 1
GATT-TX: 00 f4 c2 c3 a1 79 49 50 dd 24 66 ea ac 62 e3 76 
GATT-TX: 8d 86 c3 53 dd ca b1 76 2e 21 0c aa 5c c8 
GATT-TX: 00 f4 56 51 ac b5 41 23 5c 15 44 f4 40 68 04 92 
GATT-TX: 35 5f e0 33 34 1a 32 99 00 01 b5 67 ed c0 
GATT-RX: 00 f4 fb 34 d9 5b 37 66 66 0f 1b 3b d0 ca e5 24 
GATT-RX: 70 92 fd 94 3c 44 6c 42 e6 
GATT-RX: 00 f4 33 91 bd 9f b5 37 2d ae 01 5a c8 67 00 c0 
GATT-RX: fa 5f 34 fc e4 53 c9 da 15 
Node 0108 AppKey Status Success
NetKey 000, AppKey 001
[config: Target = 0108]# bind 0 1 1000
GATT-TX: 00 f4 25 40 41 a2 09 fb 01 8f d1 be 2c e3 1b 0b 
GATT-TX: 13 e3 ac 38 ea f9 74 c7 99 a9 33 
GATT-RX: 00 f4 a3 1b e3 71 55 5c 0b a6 d1 6f a2 6f 80 62 
GATT-RX: 84 d6 26 a9 61 49 0a 73 ad 31 bc 04 
Node 0108 Model App Status Success
Element 0108 AppIdx 001
ModelId 1000
[config: Target = 0108]# 

Can anyone please clarify what is going wrong?

Branch used: Latest Master branch

Thanks in advance!

-Mani


Re: [Zephyr-devel] Using Math function in zephyr

Michael Hope
 

Hi Ashish.  Here's a blow-by-blow:

https://asciinema.org/a/v1LmP0FCsV2Xyv8BqNKTF8pdy

-- Michael

On Fri, 22 Dec 2017 at 11:35 ashish.shukla@... <ashish.shukla@...> wrote:
Michael, I'm a newbie in Zephyr, can you please tell the steps to be followed to turn on float support for printf.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 2:39 PM, Michael Hope <michaelh@...> wrote:

printk probably doesn't support floating point args. Give printf a try and make sure that printf float support is turned on under 'make menuconfig'.


On Fri, 22 Dec 2017, 10:04 ashish.shukla@..., <ashish.shukla@...> wrote:
Hi,

It doesn't seem to be working for me. Here's a test program

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
printk("round up %d  \n\r",round(5.7));
printk("round down %d \n\r",round(5.2));
}

and output I get is

round up 1075314688
round down 1075052544

I'm working with nrf52840 uC.





--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 1:02 PM, Michael Hope <michaelh@...> wrote:
Huh, interesting.  It works for me in a test program:

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
        printf("round up: %f\n", round(1.9));
        printf("round down: %f\n", round(3.1));
}

"""
***** BOOTING ZEPHYR OS v1.10.99- - BUILD: Dec 21 2017 21:44:19 *****
round up: 2.000000
round down: 3.000000
"""

This is on BOARD=qemu_cortex_m3 which uses the ARM soft float ABI.  There's a chance that you've got a mix of hard float / soft float code but I thought the linker checked that.

What board is this for?

-- Michael

On Fri, 22 Dec 2017 at 08:17 ashish.shukla@... <ashish.shukla@...> wrote:
Hi Michael,

After switching to new library, code compiles but it rounds off all the values to 0.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 12:01 PM, Michael Hope <michaelh@...> wrote:
Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:
Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel




Re: [Zephyr-devel] Using Math function in zephyr

Boie, Andrew P
 

Ø  printk("round up %d  \n\r",round(5.7));
printk("round down %d \n\r",round(5.2));

 

What output are you expecting? You are using %d.

printk() doesn't support floating point.

 

Andrew

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of ashish.shukla@...
Sent: Friday, December 22, 2017 2:35 AM
To: Michael Hope <michaelh@...>
Cc: zephyr-users@...; zephyr-devel@...
Subject: Re: [Zephyr-users] [Zephyr-devel] Using Math function in zephyr

 

Michael, I'm a newbie in Zephyr, can you please tell the steps to be followed to turn on float support for printf.


 

--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

 

Please consider the environment before printing this e-mail or its attachments.

 

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

 

 

On Fri, Dec 22, 2017 at 2:39 PM, Michael Hope <michaelh@...> wrote:

printk probably doesn't support floating point args. Give printf a try and make sure that printf float support is turned on under 'make menuconfig'.

 

On Fri, 22 Dec 2017, 10:04 ashish.shukla@..., <ashish.shukla@...> wrote:

Hi,

It doesn't seem to be working for me. Here's a test program


#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{

printk("round up %d  \n\r",round(5.7));
printk("round down %d \n\r",round(5.2));
}

and output I get is

round up 1075314688

round down 1075052544

I'm working with nrf52840 uC.




 

--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

 

Please consider the environment before printing this e-mail or its attachments.

 

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

 

 

On Fri, Dec 22, 2017 at 1:02 PM, Michael Hope <michaelh@...> wrote:

Huh, interesting.  It works for me in a test program:

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
        printf("round up: %f\n", round(1.9));
        printf("round down: %f\n", round(3.1));
}

"""
***** BOOTING ZEPHYR OS v1.10.99- - BUILD: Dec 21 2017 21:44:19 *****
round up: 2.000000
round down: 3.000000
"""

 

This is on BOARD=qemu_cortex_m3 which uses the ARM soft float ABI.  There's a chance that you've got a mix of hard float / soft float code but I thought the linker checked that.

 

What board is this for?

-- Michael

 

On Fri, 22 Dec 2017 at 08:17 ashish.shukla@... <ashish.shukla@...> wrote:

Hi Michael,

After switching to new library, code compiles but it rounds off all the values to 0.


 

--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

 

Please consider the environment before printing this e-mail or its attachments.

 

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

 

 

On Fri, Dec 22, 2017 at 12:01 PM, Michael Hope <michaelh@...> wrote:

Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

 

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:

Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

 

--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

 

Please consider the environment before printing this e-mail or its attachments.

 

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

 

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

 

 

 


Re: [Zephyr-devel] Using Math function in zephyr

ashish.shukla@corvi.com <ashish.shukla@...>
 

Michael, I'm a newbie in Zephyr, can you please tell the steps to be followed to turn on float support for printf.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 2:39 PM, Michael Hope <michaelh@...> wrote:

printk probably doesn't support floating point args. Give printf a try and make sure that printf float support is turned on under 'make menuconfig'.


On Fri, 22 Dec 2017, 10:04 ashish.shukla@..., <ashish.shukla@...> wrote:
Hi,

It doesn't seem to be working for me. Here's a test program

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
printk("round up %d  \n\r",round(5.7));
printk("round down %d \n\r",round(5.2));
}

and output I get is

round up 1075314688
round down 1075052544

I'm working with nrf52840 uC.





--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 1:02 PM, Michael Hope <michaelh@...> wrote:
Huh, interesting.  It works for me in a test program:

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
        printf("round up: %f\n", round(1.9));
        printf("round down: %f\n", round(3.1));
}

"""
***** BOOTING ZEPHYR OS v1.10.99- - BUILD: Dec 21 2017 21:44:19 *****
round up: 2.000000
round down: 3.000000
"""

This is on BOARD=qemu_cortex_m3 which uses the ARM soft float ABI.  There's a chance that you've got a mix of hard float / soft float code but I thought the linker checked that.

What board is this for?

-- Michael

On Fri, 22 Dec 2017 at 08:17 ashish.shukla@... <ashish.shukla@...> wrote:
Hi Michael,

After switching to new library, code compiles but it rounds off all the values to 0.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 12:01 PM, Michael Hope <michaelh@...> wrote:
Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:
Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel




Re: [Zephyr-devel] Using Math function in zephyr

Michael Hope
 

printk probably doesn't support floating point args. Give printf a try and make sure that printf float support is turned on under 'make menuconfig'.


On Fri, 22 Dec 2017, 10:04 ashish.shukla@..., <ashish.shukla@...> wrote:
Hi,

It doesn't seem to be working for me. Here's a test program

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
printk("round up %d  \n\r",round(5.7));
printk("round down %d \n\r",round(5.2));
}

and output I get is

round up 1075314688
round down 1075052544

I'm working with nrf52840 uC.





--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 1:02 PM, Michael Hope <michaelh@...> wrote:
Huh, interesting.  It works for me in a test program:

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
        printf("round up: %f\n", round(1.9));
        printf("round down: %f\n", round(3.1));
}

"""
***** BOOTING ZEPHYR OS v1.10.99- - BUILD: Dec 21 2017 21:44:19 *****
round up: 2.000000
round down: 3.000000
"""

This is on BOARD=qemu_cortex_m3 which uses the ARM soft float ABI.  There's a chance that you've got a mix of hard float / soft float code but I thought the linker checked that.

What board is this for?

-- Michael

On Fri, 22 Dec 2017 at 08:17 ashish.shukla@... <ashish.shukla@...> wrote:
Hi Michael,

After switching to new library, code compiles but it rounds off all the values to 0.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 12:01 PM, Michael Hope <michaelh@...> wrote:
Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:
Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel



Re: [Zephyr-devel] Using Math function in zephyr

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi,

It doesn't seem to be working for me. Here's a test program

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
printk("round up %d  \n\r",round(5.7));
printk("round down %d \n\r",round(5.2));
}

and output I get is

round up 1075314688
round down 1075052544

I'm working with nrf52840 uC.





--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 1:02 PM, Michael Hope <michaelh@...> wrote:
Huh, interesting.  It works for me in a test program:

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
        printf("round up: %f\n", round(1.9));
        printf("round down: %f\n", round(3.1));
}

"""
***** BOOTING ZEPHYR OS v1.10.99- - BUILD: Dec 21 2017 21:44:19 *****
round up: 2.000000
round down: 3.000000
"""

This is on BOARD=qemu_cortex_m3 which uses the ARM soft float ABI.  There's a chance that you've got a mix of hard float / soft float code but I thought the linker checked that.

What board is this for?

-- Michael

On Fri, 22 Dec 2017 at 08:17 ashish.shukla@... <ashish.shukla@...> wrote:
Hi Michael,

After switching to new library, code compiles but it rounds off all the values to 0.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 12:01 PM, Michael Hope <michaelh@...> wrote:
Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:
Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel



Re: [Zephyr-devel] Using Math function in zephyr

Michael Hope
 

Huh, interesting.  It works for me in a test program:

#include <zephyr.h>
#include <misc/printk.h>
#include <math.h>

void main(void)
{
        printf("round up: %f\n", round(1.9));
        printf("round down: %f\n", round(3.1));
}

"""
***** BOOTING ZEPHYR OS v1.10.99- - BUILD: Dec 21 2017 21:44:19 *****
round up: 2.000000
round down: 3.000000
"""

This is on BOARD=qemu_cortex_m3 which uses the ARM soft float ABI.  There's a chance that you've got a mix of hard float / soft float code but I thought the linker checked that.

What board is this for?

-- Michael

On Fri, 22 Dec 2017 at 08:17 ashish.shukla@... <ashish.shukla@...> wrote:
Hi Michael,

After switching to new library, code compiles but it rounds off all the values to 0.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 12:01 PM, Michael Hope <michaelh@...> wrote:
Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:
Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


Re: [Zephyr-devel] Using Math function in zephyr

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hi Michael,

After switching to new library, code compiles but it rounds off all the values to 0.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Fri, Dec 22, 2017 at 12:01 PM, Michael Hope <michaelh@...> wrote:
Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:
Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


Re: [Zephyr-devel] Using Math function in zephyr

Michael Hope
 

Hi Ashish.  I haven't used this personally, but try switching the libc from the built-in minimal libc to newlib.  See http://docs.zephyrproject.org/subsystems/c_library.html for more.

-- Michael

On Fri, 22 Dec 2017 at 06:00 ashish.shukla@... <ashish.shukla@...> wrote:
Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@...
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel


Using Math function in zephyr

ashish.shukla@corvi.com <ashish.shukla@...>
 

Hello everyone !

I'm to use round()  function in zephyr. How to include math functions in zephyr ?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


Re: [Zephyr-devel] Confusion about Zephyr ADC API semantics

Marti Bolivar
 

Hi Jonas,

Thanks for your response! I hope you don't mind I've added back the
users list as well.

I am leaving for holiday break at end of day and so likely won't have
more to say until the new year, but I will be sure to handle 12-bit
right aligned values in a u16_t array in anything I propose for the
core API.

FWIW, STM32 ADCs also support 12 bit conversion with configurable alignment.

Best,
Marti

On Thu, Dec 21, 2017 at 2:24 AM, Jonas Pfaff <jonas.pfaff@comsuisse.ch> wrote:
Hi Marti,

I understand your confusion as I had the same problem a few months ago.
I implemented the sam_afec driver using a 16bit array containing right
aligned 12bit values (can go up to 16bit depending on the ADC config)
because it seemed to be the most plausible and straightforward solution
in my use case.
I am curious to see your solution and would be happy to help where I
can.

Regards,
Jonas

Hello again,

Since about a week has passed by with no response, I assume that the
ADC infrastructure is currently unmaintained (or the maintainers are
on vacation), and will do my best to fix the core semantics as best I
can. I will also make a best effort to contact authors of existing ADC
drivers if I need help as regards to changes that might impact those.

I hope and expect to submit some PRs around this in the first week of
2018, now that I've spent a few days hacking on an nRF SAADC driver
and feel I understand the issues a bit better.

Please let me know if you'd like to help!

Thanks,
Marti

On Fri, Dec 15, 2017 at 9:00 PM, Marti Bolivar
<marti@opensourcefoundries.com> wrote:
Hi,

I've been reading through the ADC API, its users, and its test cases,
and I'm confused about the semantics of struct adc_seq_entry, in
particular the field named "buffer". The API docs are vague and the
users contradict each other; something seems wrong to me.

(I volunteer to try to improve the documentation if we can clear
things up; I'm working on an ADC driver and would like to make sure
I'm doing the right thing.)

The main header says "buffer" is a byte array:

https://github.com/zephyrproject-rtos/zephyr/blob/master/include/adc.h#L39

But it doesn't say anything about the contents. That's strange,
especially since common ADC IPs can do 12+ bit conversions. (I at
least expected a u16*, and something written about the left- or
right-alignment of sample data, e.g. how a 12 bit sample is stored in
a 16 bit word.)

That same header only has this to say about the returned values from
an adc_read() call:

* The sample data can be retrieved from the memory buffers in
* the sequence table structure.

So I looked at the API users to find out more, but the results were
even more confusing.

This "simple" test wants to interpret the results as though the buffer
field points at an array of u32 (note the _print_sample_in_hex
implementation and the "delta" printk in adc_test):

https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/drivers/adc/adc_simple/src/main.c#L36

It also says buffer should be void*, which isn't true:

https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/drivers/adc/adc_simple/src/main.c#L78

This "api" test thinks buffer is u16*:

https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/drivers/adc/adc_api/src/test_adc.c#L53

The ADC-based grove temperature driver treats Zephyr samples as if
they were 12 bit right aligned values in a u16 array, and has a
comment saying that's the common convention:

https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/grove/temperature_sensor.c#L46

Can anyone clarify what the correct interpretation of this field is?

Thanks,
Marti


Problem in I2C interfacing with nrf52840

ashish.shukla@corvi.com <ashish.shukla@...>
 


Hello everyone !!!

I'm trying to interface an EEPROM with nrf52840 using I2C protocol.

For this, I used  .../samples/drivers/i2c_fujitsu_fram example, I'm able to read bytes from memory, but I can't write anything in memory. It's write_bytes() function doesn't seem to be working.

Did someone faced the same issue? and what needs to be done to fix this?

--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


Re: Problem in working with Ozone and nRF52840

ashish.shukla@corvi.com <ashish.shukla@...>
 

Thanks,
That solved the issue.


--
Warm regards,
Ashish Shukla
Jr. Embedded Engineer
Research & Development


Please consider the environment before printing this e-mail or its attachments.

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi


On Wed, Dec 20, 2017 at 8:25 PM, Cufi, Carles <Carles.Cufi@...> wrote:

Hi Ashish,

 

The “variable is out of scope” is pretty common and I get it all the time too. It usually happens with local variables only, and it’s mostly due to the compiler optimizations. So the 2 options you have is to either reduce the optimization level (say from –O3 to –O0) or, for a quick fix, store the variable you’re interested in in a temporary global.

 

Regards,

 

Carles

 

From: zephyr-users-bounces@lists.zephyrproject.org [mailto:zephyr-users-bounces@lists.zephyrproject.org] On Behalf Of ashish.shukla@...
Sent: 20 December 2017 06:22
To: zephyr-users@lists.zephyrproject.org; zephyr-devel@lists.zephyrproject.org
Subject: [Zephyr-users] Problem in working with Ozone and nRF52840

 

Hello everyone !!!

I'm just starting to work with Ozone for hardware debugging of nRF52840 uC.

When I enter a variable named cnt which is declared in main function, it says the variable is out of scope. I can't figure out what this means here, and how to resolve this.

Also, is there any way look at status of PINs of uC e.g. I want to look at changing status of pins as a graph.

I'm attaching snapshot of Ozone window. 

 

--

Warm regards,
Ashish Shukla

Jr. Embedded Engineer

Research & Development

 

Please consider the environment before printing this e-mail or its attachments.

 

Disclaimer: The information contained herein (including any accompanying documents) is confidential and is intended solely for the addressee(s). If you have erroneously received this message, please immediately delete it and notify the sender. Also, if you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this message or any accompanying document is strictly prohibited and is unlawful. The organization is not responsible for any damage caused by a virus or alteration of the e-mail by a third party or otherwise. The contents of this message may not necessarily represent the views or policies of Corvi

 



Re: Confusion about Zephyr ADC API semantics

Marti Bolivar
 

Hello again,

Since about a week has passed by with no response, I assume that the
ADC infrastructure is currently unmaintained (or the maintainers are
on vacation), and will do my best to fix the core semantics as best I
can. I will also make a best effort to contact authors of existing ADC
drivers if I need help as regards to changes that might impact those.

I hope and expect to submit some PRs around this in the first week of
2018, now that I've spent a few days hacking on an nRF SAADC driver
and feel I understand the issues a bit better.

Please let me know if you'd like to help!

Thanks,
Marti

On Fri, Dec 15, 2017 at 9:00 PM, Marti Bolivar
<marti@opensourcefoundries.com> wrote:
Hi,

I've been reading through the ADC API, its users, and its test cases,
and I'm confused about the semantics of struct adc_seq_entry, in
particular the field named "buffer". The API docs are vague and the
users contradict each other; something seems wrong to me.

(I volunteer to try to improve the documentation if we can clear
things up; I'm working on an ADC driver and would like to make sure
I'm doing the right thing.)

The main header says "buffer" is a byte array:

https://github.com/zephyrproject-rtos/zephyr/blob/master/include/adc.h#L39

But it doesn't say anything about the contents. That's strange,
especially since common ADC IPs can do 12+ bit conversions. (I at
least expected a u16*, and something written about the left- or
right-alignment of sample data, e.g. how a 12 bit sample is stored in
a 16 bit word.)

That same header only has this to say about the returned values from
an adc_read() call:

* The sample data can be retrieved from the memory buffers in
* the sequence table structure.

So I looked at the API users to find out more, but the results were
even more confusing.

This "simple" test wants to interpret the results as though the buffer
field points at an array of u32 (note the _print_sample_in_hex
implementation and the "delta" printk in adc_test):

https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/drivers/adc/adc_simple/src/main.c#L36

It also says buffer should be void*, which isn't true:

https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/drivers/adc/adc_simple/src/main.c#L78

This "api" test thinks buffer is u16*:

https://github.com/zephyrproject-rtos/zephyr/blob/master/tests/drivers/adc/adc_api/src/test_adc.c#L53

The ADC-based grove temperature driver treats Zephyr samples as if
they were 12 bit right aligned values in a u16 array, and has a
comment saying that's the common convention:

https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/grove/temperature_sensor.c#L46

Can anyone clarify what the correct interpretation of this field is?

Thanks,
Marti


Re: UART flash

Carles Cufi
 

Hi Alan,

Forgot to reply to this:

At the moment it would have to be one UART for the Bluetooth one for the
updates?
No, it's the same UART, but you'll need to reboot into MCUboot's serial recovery mode, update the image and then reboot back into the new image.

Regards,

Carles


Re: UART flash

Carles Cufi
 

Hi Alan,

-----Original Message-----
From: Alan Martinovic [mailto:alan.martinovic@senic.com]
Sent: 20 December 2017 16:09
To: Cufi, Carles <Carles.Cufi@nordicsemi.no>
Cc: zephyr-users@lists.zephyrproject.org
Subject: Re: [Zephyr-users] UART flash

Cool, thanks.

Also in the future we'd like to map firmware update to HCI so that
it's all integrated.

The purpose of this is to be able to do updates on the same physical
UART on which the Bluetooth Host-Controller communication is taking
place?
Yes, and also not to have to enter the bootloader's recovery mode. Right now you'll need to force the bootloader to enter its recovery mode to upload a new image, which will be received by the bootloader code itself. The idea in the future is that you can interleave HCI packets that contains fragments of an image with normal HCI operation, so that once the whole image is uploaded the controller only needs to reboot and the bootloader will swap the images.

The HCI specs actually have this defines?
No, those will be vendor-specific commands. You can find the currently existing ones here: https://github.com/zephyrproject-rtos/zephyr/blob/master/doc/subsystems/bluetooth/hci.txt

Regards,

Carles

2161 - 2180 of 2576