Date   

Re: nucleo_f401re can not flash and can not work

Erwan Gouriou
 

Hi,


Looking to the picture of the board you sent me, I can see some differences with the board I have:
-Lack of X2, C32, C31, R34, R36 on your board
-Lack of C26 on my board.
This might be a variant I'm not aware of.
Can you send me a picture of the back side of the board as well, to get a complete view of your board?

Thanks
Erwan

On 28 June 2017 at 16:14, 会奎林 <linhuikui@...> wrote:
Hi,
I try drag and drop rt-thread rtos .bin file to my nucleo_f401re board, and it worked, and I compile mbed OS and copy .bin to my board, it worked too. But the zephyr.bin  do not work. I run the command "make BOARD=nucleo_f401re debug", the CPU was halted in somewhere. here are the log:

(gdb) s
Info : halted: PC: 0x08000c2c
Info : halted: PC: 0x08000c02
Info : halted: PC: 0x08000c04
Info : halted: PC: 0x08000c06
Info : halted: PC: 0x08000c08
Info : halted: PC: 0x08000c28
310 *(d_word++) = c_word;
(gdb) s
Info : halted: PC: 0x08000c2c
Info : halted: PC: 0x08000c02
Info : halted: PC: 0x08000c04
Info : halted: PC: 0x08000c06
Info : halted: PC: 0x08000c08
Info : halted: PC: 0x08000c28
310 *(d_word++) = c_word;
(gdb) s
Info : halted: PC: 0x08000c2c
Info : halted: PC: 0x08000c02
Info : halted: PC: 0x08000c04
Info : halted: PC: 0x08000c06
Info : halted: PC: 0x08000c08
Info : halted: PC: 0x08000c28
310 *(d_word++) = c_word;
(gdb) l
305
306 c_word |= c_word << 8;
307 c_word |= c_word << 16;
308
309 while (n >= sizeof(unsigned int)) {
310 *(d_word++) = c_word;
311 n -= sizeof(unsigned int);
312 }
313
314 /* do byte-sized initialization until finished */


by the way, I built it in zephyr-v1.8.0/samples/basic/blinky

Thanks

2017-06-27 11:59 GMT+08:00 会奎林 <linhuikui@...>:
Hi,
Maybe there is an error on my nucleo board. I have upgraded the st-link, I can not roll- back. and the new st-link can not work. I would try to download via com port.
Thanks a lot.

2017-06-26 22:18 GMT+08:00 Erwan Gouriou <erwan.gouriou@...>:
Hi,

Here is a blinky sample binary:
Generated on V1.8.99
Tested ok on nucleo_f401re (by drag and drop on nucleo mounted device)

Please let me know if working on your side

Erwan

On 26 June 2017 at 15:44, Erwan Gouriou <erwan.gouriou@...> wrote:
I tested successfully this morning on same sw and hw.
I'll put .bin available so you can test.



On 26 June 2017 at 15:33, linhuikui <linhuikui@...> wrote:
Hi,
I have copied the zephyr.bin to the nucleo flash disk. But it do not work. I have copied other rtos .bin to the disk, and it worked(Rthread.bin a rtos bin from rtthread.org).And Zephyr.bin do not work either. I doubt the bin format is different, or the Zephyr.bin is too bigger?



在 Erwan Gouriou <erwan.gouriou@...>,2017年6月26日 下午3:30写道:

Hi,

Ok, good point is that compilation is ok.

You can try alternate functions for flashing:
*When plugging your nucleo_board, it should be mounted as a USB disk, and appear in list of devices on nautilus
    > You can drag and drop the .bin directly here
*Use custom open-ocd: https://github.com/erwango/openocd-stm32
   > README should help you to proceed

Good luck


On 24 June 2017 at 03:46, 会奎林 <linhuikui@...> wrote:
I was try to compile and flashed my nucleo_f401re. but the LD2 do not flash. neither blink_led or blinky.
the adjunct is the compiler output, after flashed i toke a photo for the f401re board.

by the way, the zephyr release  download form https://github.com/zephyrproject-rtos/zephyr/archive/v1.8.99.tar.gz
Thanks.

2017-06-22 21:22 GMT+08:00 Erwan Gouriou <erwan.gouriou@...>:
Ok, Can you try following sample and check if LED is blinking?
cd samples/basic/blinky
make BOARD=nucleo_f401re flash

Then, can you tell me which zephyr release / commit you're using?


On 22 June 2017 at 15:06, 会奎林 <linhuikui@...> wrote:
Hi,
   I do follow the steps documenter
When i flashed, the LD1 was green.
*I was did all in  ubuntu OS.
*access com port follow steps minicom -D /dev/ttyACM0 and sudo minicom -D /dev/ttyACM0, but neither work.
*Zephyr SDK version: 0.9.1 and .0.9
*Zephyr version:1.7.0 and 1.8.0

2017-06-22 15:31 GMT+08:00 Erwan Gouriou <erwan.gouriou@...>:
Hi,


Else, can you provide more information:
*command used ("make BOARD=nucleo_f401re flash" should work)
*Work environment (Linux/Windows/Mac Os)
*How do you access com port?
*Zephyr SDK version
*SHA1 of the commit / commit title for the HEAD of your tree
*Is that specific to nucleo_f401re? Did you succeed with other board?

Erwan


On 22 June 2017 at 02:43, 会奎林 <linhuikui@...> wrote:
In the zephyr project, I compile nucleo_f401re board whit sample "hello world" and "shell"  and flashed it. but there is nothing out put via the USB COM. my English is poor, and coudle any one help me?

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












Re: nucleo_f401re can not flash and can not work

lhk
 

Hi,
I try drag and drop rt-thread rtos .bin file to my nucleo_f401re board, and it worked, and I compile mbed OS and copy .bin to my board, it worked too. But the zephyr.bin  do not work. I run the command "make BOARD=nucleo_f401re debug", the CPU was halted in somewhere. here are the log:

(gdb) s
Info : halted: PC: 0x08000c2c
Info : halted: PC: 0x08000c02
Info : halted: PC: 0x08000c04
Info : halted: PC: 0x08000c06
Info : halted: PC: 0x08000c08
Info : halted: PC: 0x08000c28
310 *(d_word++) = c_word;
(gdb) s
Info : halted: PC: 0x08000c2c
Info : halted: PC: 0x08000c02
Info : halted: PC: 0x08000c04
Info : halted: PC: 0x08000c06
Info : halted: PC: 0x08000c08
Info : halted: PC: 0x08000c28
310 *(d_word++) = c_word;
(gdb) s
Info : halted: PC: 0x08000c2c
Info : halted: PC: 0x08000c02
Info : halted: PC: 0x08000c04
Info : halted: PC: 0x08000c06
Info : halted: PC: 0x08000c08
Info : halted: PC: 0x08000c28
310 *(d_word++) = c_word;
(gdb) l
305
306 c_word |= c_word << 8;
307 c_word |= c_word << 16;
308
309 while (n >= sizeof(unsigned int)) {
310 *(d_word++) = c_word;
311 n -= sizeof(unsigned int);
312 }
313
314 /* do byte-sized initialization until finished */


by the way, I built it in zephyr-v1.8.0/samples/basic/blinky

Thanks

2017-06-27 11:59 GMT+08:00 会奎林 <linhuikui@...>:

Hi,
Maybe there is an error on my nucleo board. I have upgraded the st-link, I can not roll- back. and the new st-link can not work. I would try to download via com port.
Thanks a lot.

2017-06-26 22:18 GMT+08:00 Erwan Gouriou <erwan.gouriou@...>:
Hi,

Here is a blinky sample binary:
Generated on V1.8.99
Tested ok on nucleo_f401re (by drag and drop on nucleo mounted device)

Please let me know if working on your side

Erwan

On 26 June 2017 at 15:44, Erwan Gouriou <erwan.gouriou@...> wrote:
I tested successfully this morning on same sw and hw.
I'll put .bin available so you can test.



On 26 June 2017 at 15:33, linhuikui <linhuikui@...> wrote:
Hi,
I have copied the zephyr.bin to the nucleo flash disk. But it do not work. I have copied other rtos .bin to the disk, and it worked(Rthread.bin a rtos bin from rtthread.org).And Zephyr.bin do not work either. I doubt the bin format is different, or the Zephyr.bin is too bigger?



在 Erwan Gouriou <erwan.gouriou@...>,2017年6月26日 下午3:30写道:

Hi,

Ok, good point is that compilation is ok.

You can try alternate functions for flashing:
*When plugging your nucleo_board, it should be mounted as a USB disk, and appear in list of devices on nautilus
    > You can drag and drop the .bin directly here
*Use custom open-ocd: https://github.com/erwango/openocd-stm32
   > README should help you to proceed

Good luck


On 24 June 2017 at 03:46, 会奎林 <linhuikui@...> wrote:
I was try to compile and flashed my nucleo_f401re. but the LD2 do not flash. neither blink_led or blinky.
the adjunct is the compiler output, after flashed i toke a photo for the f401re board.

by the way, the zephyr release  download form https://github.com/zephyrproject-rtos/zephyr/archive/v1.8.99.tar.gz
Thanks.

2017-06-22 21:22 GMT+08:00 Erwan Gouriou <erwan.gouriou@...>:
Ok, Can you try following sample and check if LED is blinking?
cd samples/basic/blinky
make BOARD=nucleo_f401re flash

Then, can you tell me which zephyr release / commit you're using?


On 22 June 2017 at 15:06, 会奎林 <linhuikui@...> wrote:
Hi,
   I do follow the steps documenter
When i flashed, the LD1 was green.
*I was did all in  ubuntu OS.
*access com port follow steps minicom -D /dev/ttyACM0 and sudo minicom -D /dev/ttyACM0, but neither work.
*Zephyr SDK version: 0.9.1 and .0.9
*Zephyr version:1.7.0 and 1.8.0

2017-06-22 15:31 GMT+08:00 Erwan Gouriou <erwan.gouriou@...>:
Hi,


Else, can you provide more information:
*command used ("make BOARD=nucleo_f401re flash" should work)
*Work environment (Linux/Windows/Mac Os)
*How do you access com port?
*Zephyr SDK version
*SHA1 of the commit / commit title for the HEAD of your tree
*Is that specific to nucleo_f401re? Did you succeed with other board?

Erwan


On 22 June 2017 at 02:43, 会奎林 <linhuikui@...> wrote:
In the zephyr project, I compile nucleo_f401re board whit sample "hello world" and "shell"  and flashed it. but there is nothing out put via the USB COM. my English is poor, and coudle any one help me?

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











Re: Problem with pointers when using k_fifo

Luiz Augusto von Dentz
 

Hi Flavio,

On Wed, Jun 28, 2017 at 2:42 PM, Flavio Arieta <flavioarieta@gmail.com> wrote:
Hi,

I'm having some problems with k_fifo_put() and k_fifo_get() when using the
following structure:

typedef struct application_queue_element {
void *pkt;
uint8_t type;
} application_queue_element_t;
k_fifo/k_queue do store their list nodes in the elements you push to
it, so you need something like this:

typedef struct application_queue_element {
void *_reserved; /* Used by k_fifo implementation. */
void *pkt;
uint8_t type;
} application_queue_element_t

The type receives 14 and pkt receives the address of a structure type
variable defined as:

typedef struct request {
uint8_t value;
uint8_t flags;
} request_t;

I tried the following to put the data on the fifo:

application_queue_element_t app_pkt;
request_t dr;
app_pkt.pkt = &dr;
app_pkt.application_protocol_pkt_type = 14;
k_fifo_put(&ctx->recv_queue, &app_pkt);

Then to retrieve the data I made the following:

if (k_fifo_is_empty(&ctx->recv_queue) == 0) {
application_queue_element_t *app_pkt_temp;
app_pkt_temp = k_fifo_get(&ctx->recv_queue, K_NO_WAIT);
}

At the end app_pkt_temp have the right value for the app_pkt_temp->type but
the wrong address for app_pkt_temp->pkt, which gives me 0x00000000 (should
be something like 0x20007744) and therefore wrong values.
As it seems the reference to the dr variable is lost after it was put and
then retrieved from the k_fifo.

Am I missing something when addind the data or got something wrong with the
data structure?


PS: 1. Before putting the data inside the fifo I verified the app_pkt and it
has all the data.
2. I initialized the fifo, but on another function



Thanks,
Flávio Arieta Netto.

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


--
Luiz Augusto von Dentz


Problem with pointers when using k_fifo

Flavio Arieta <flavioarieta@...>
 

Hi,

I'm having some problems with k_fifo_put() and k_fifo_get() when using the following structure:

typedef struct application_queue_element {
    void *pkt;
    uint8_t type;
} application_queue_element_t;

The type receives 14 and pkt receives the address of a structure type variable defined as:

typedef struct request {
    uint8_t value;
    uint8_t flags;
} request_t;

I tried the following to put the data on the fifo:

application_queue_element_t app_pkt;
request_t dr;
app_pkt.pkt = &dr;
app_pkt.application_protocol_pkt_type = 14;
k_fifo_put(&ctx->recv_queue, &app_pkt);

Then to retrieve the data I made the following:

if (k_fifo_is_empty(&ctx->recv_queue) == 0) {
    application_queue_element_t *app_pkt_temp;
    app_pkt_temp = k_fifo_get(&ctx->recv_queue, K_NO_WAIT);
}

At the end app_pkt_temp have the right value for the app_pkt_temp->type but the wrong address for app_pkt_temp->pkt, which gives me 0x00000000 (should be something like 0x20007744) and therefore wrong values.
As it seems the reference to the dr variable is lost after it was put and then retrieved from the k_fifo.

Am I missing something when addind the data or got something wrong with the data structure?


PS: 1. Before putting the data inside the fifo I verified the app_pkt and it has all the data.
       2. I initialized the fifo, but on another function



Thanks,
Flávio Arieta Netto.


Problems with MQTT on FRDM-K64F

Kevin Stöckl <k_stoeckl@...>
 

Hello,

I try to run the sample mqtt publisher on the frdm-k64f.

First I changed the IP-adress on the linux host machine to 192.168.0.75.

Then i type make BOARD=frdm_k64f and then I try to run mosquitto with sudo mosquitto -v -p 1883.

There I got the error message Address already in use and nothing happens.


In the config.h File I changed the Server Address to 192.168.0.75


What could be the problem?

How can I change the IP-adress of the board? And is this necessary?



Thanks in advance

Kevin



Re: zephyr performance

Nashif, Anas
 

There are some samples that measure timing under test/benchmark, you can use those.

Anas

-----Original Message-----
From: zephyr-users-bounces@lists.zephyrproject.org [mailto:zephyr-users-bounces@lists.zephyrproject.org] On Behalf Of massimiliano cialdi
Sent: Thursday, June 22, 2017 9:41 AM
To: zephyr-users@lists.zephyrproject.org
Subject: [Zephyr-users] zephyr performance

Hi,

Have zephyr benchmarks been run? I mean context switch time (preemptive), RAM and ROM usage, etc.


I'm particularly interested in the cortex m4


best regards


--

Powersoft logo <http://www.powersoft.it>

*Massimiliano Cialdi |*Senior Firmware Engineer

*skype:* mci.pws *| email:* massimiliano.cialdi@powersoft.it
<mailto:massimiliano.cialdi@powersoft.it>

*HQ Italy:* Via E. Conti, 5 *|* 50018 Scandicci (FI) Italy

*direct phone:* +39 055 0153429 *| Fax:* +39 055 735 6235

*web site:* www.powersoft.it <http://www.powersoft.it>

Green Audio Power

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


zephyr performance

Massimiliano Cialdi
 

Hi,

Have zephyr benchmarks been run? I mean context switch time (preemptive), RAM and ROM usage, etc.


I'm particularly interested in the cortex m4


best regards


--

Powersoft logo <http://www.powersoft.it>

*Massimiliano Cialdi |*Senior Firmware Engineer

*skype:* mci.pws *| email:* massimiliano.cialdi@powersoft.it <mailto:massimiliano.cialdi@powersoft.it>

*HQ Italy:* Via E. Conti, 5 *|* 50018 Scandicci (FI) Italy

*direct phone:* +39 055 0153429 *| Fax:* +39 055 735 6235

*web site:* www.powersoft.it <http://www.powersoft.it>

Green Audio Power


Re: nucleo_f401re can not flash and can not work

Erwan Gouriou
 

Hi,


Else, can you provide more information:
*command used ("make BOARD=nucleo_f401re flash" should work)
*Work environment (Linux/Windows/Mac Os)
*How do you access com port?
*Zephyr SDK version
*SHA1 of the commit / commit title for the HEAD of your tree
*Is that specific to nucleo_f401re? Did you succeed with other board?

Erwan


On 22 June 2017 at 02:43, 会奎林 <linhuikui@...> wrote:
In the zephyr project, I compile nucleo_f401re board whit sample "hello world" and "shell"  and flashed it. but there is nothing out put via the USB COM. my English is poor, and coudle any one help me?

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



nucleo_f401re can not flash and can not work

lhk
 

In the zephyr project, I compile nucleo_f401re board whit sample "hello world" and "shell"  and flashed it. but there is nothing out put via the USB COM. my English is poor, and coudle any one help me?


zephyr performance

Massimiliano Cialdi
 

Hi,

Have zephyr benchmarks been run? I mean context switch time (preemptive), RAM and ROM usage, etc.


I'm particularly interested in the cortex m4


best regards


--

Powersoft logo <http://www.powersoft.it>

*Massimiliano Cialdi |*Senior Firmware Engineer

*skype:* mci.pws *| email:* massimiliano.cialdi@powersoft.it <mailto:massimiliano.cialdi@powersoft.it>

*HQ Italy:* Via E. Conti, 5 *|* 50018 Scandicci (FI) Italy

*direct phone:* +39 055 0153429 *| Fax:* +39 055 735 6235

*web site:* www.powersoft.it <http://www.powersoft.it>

Green Audio Power


Re: Problems with L2 on samples/net/echo_client and nrf52_pca10040

Flavio Arieta <flavioarieta@...>
 

Hi Wojtek,


Thanks for your guidance, I played with it for a while and it is exactly as you state on your email.



Kind regards,
Flávio Arieta Netto


Re: First steps and first problems.

Jorge Ramirez
 

On 06/18/2017 10:59 PM, Iñaki Malerba wrote:
Hi to all !

My name is Iñaki and this is my first email to this community. I hope you can help me!

Im trying to use zephyr on a 96b Carbon, but Im having some issues with drivers.

At first I tried to make PWM driver work, but I couldnt make it. At first I thought it was some issue with the pinmux or something, so i tried Bill Fletcher's approach and it worked great (letting me know it was not a hardware problem).

Now im trying to make I2C work to read a sensor, but, same as with the PWM, it's not working.

#define I2C_DEV "I2C_1"
struct device *i2c_dev;

i2c_dev = device_get_binding(I2C_DEV);
if (!i2c_dev) {
    printk("I2C: Device driver not found.\n");
    return;
}  

This code always prints the error message.

Note: I've enabled I2C over the menuconfig.

Any clue what can i be doing wrong?

to have i2c support in Carbon you'll need to merge this pull request in your project
https://github.com/zephyrproject-rtos/zephyr/pull/524



First steps and first problems.

Iñaki Malerba <inakimmalerba@...>
 

Hi to all !

My name is Iñaki and this is my first email to this community. I hope you can help me!

Im trying to use zephyr on a 96b Carbon, but Im having some issues with drivers.

At first I tried to make PWM driver work, but I couldnt make it. At first I thought it was some issue with the pinmux or something, so i tried Bill Fletcher's approach and it worked great (letting me know it was not a hardware problem).

Now im trying to make I2C work to read a sensor, but, same as with the PWM, it's not working.

#define I2C_DEV "I2C_1"
struct device *i2c_dev;

i2c_dev = device_get_binding(I2C_DEV);
if (!i2c_dev) {
    printk("I2C: Device driver not found.\n");
    return;
}  

This code always prints the error message.

Note: I've enabled I2C over the menuconfig.

Any clue what can i be doing wrong?

Thanks in advance !!!
__
Martin Iñaki Malerba
inakimmalerba@... | +54 02945 15468443


Re: Problems with L2 on samples/net/echo_client and nrf52_pca10040

Bober, Wojciech <Wojciech.Bober@...>
 

Hi,

 

Please use prj_bt.conf for nrf52_pca10040. This will give you echo example running over BLE, since nrf52830 present on this DK has only BLE radio.

 

The configuration you have used if for nrf52840_pca10056 and builds the echo example to run over 802.15.4 radio present in nRF52840 chip.

 

 

Kind regards,

Wojtek

 

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of Flavio Arieta
Sent: Wednesday, 14 June 2017 16:35
To: zephyr-users@...
Subject: [Zephyr-users] Problems with L2 on samples/net/echo_client and nrf52_pca10040

 

Hi,

 

I'm having some problems with the echo_client sample while using my nrf52 pca10040.

 

From what I understood of the problem is that net_if_get_ll_reserve called from net_ipv6_send_nscrashes because of iface->l2->reserve (no function attached to it maybe?).

 

The project configuration is the default prj_nrf5.conf and no modifications where made on the code apart from some extras debug messages.

 

Since I haven't changed anything from the configuration and project that could generate this error I'm very confused.

 

 

Steps to reproduce the problem:

1. make pristine 

2. make CONF_FILE=prj_nrf5.conf BOARD=nrf52_pca10040

3. program the board.

 

 

Serial output (I can't access pastebin from here, sorry):

[net/core] [DBG] net_init: (0x2000691c): Priority 90

[net/core] [DBG] l2_init: (0x2000691c): Network L2 init done

[net/core] [DBG] l3_init: (0x2000691c): Network L3 init done

[net/core] [DBG] net_rx_thread: (0x2000229c): Starting RX thread (stack 2048 bytes)

[net/if] [DBG] net_if_init: (0x2000229c): 

[net/if] [DBG] net_if_tx_thread: (0x20002a9c): Starting TX thread (stack 2048 bytes)

[net/if] [DBG] net_if_post_init: (0x2000229c): 

shell> [echo-client] [INF] init_app: Run echo client

[net/if] [DBG] net_if_ipv6_start_dad: (0x2000691c): Interface 0x20000900 ll addr 34:80:04:F0:07:FA tentative IPv6 addr 2001:db8::1

***** BUS FAULT *****

  Executing thread ID (thread): 0x2000691c

  Faulting instruction address:  0x6b6360

  Instruction bus error

Fatal fault in essential thread! Spinning...

 

 

I'm new to Zephyr, so I can lack basic knowledge while configurating the project and with the Zephyr RTOS structure and data flow.

 

 

Thanks,

Flávio Arieta Netto.


Re: Problems with Zephyr JS

Li, Hao X <hao.x.li@...>
 

Hey Kevin

It’s JS IDE problem which developer is fixing:

#156 Large size transferring issue

#166 Device disconnected on Windows when running large size JS files

 

Codes are OK, I try to reduce some code lines, they can work.

 

 

Thanks,

Li Hao

 

From: zephyr-users-bounces@... [mailto:zephyr-users-bounces@...] On Behalf Of Kevin Stöckl
Sent: Wednesday, June 14, 2017 4:44 PM
To: zephyr-users@...
Subject: [Zephyr-users] Problems with Zephyr JS

 

Hello,

when i try to run following code in the zephyr js ide, then the application did not start. What could be the problem? In the console it just writes "echo o" and than it stops.

 

var aio = require("aio");
//var ble = require("ble");
var pins = require("arduino101_pins");

// heart rate calculation
var IBI = 600;               // value holds the time interval between beats! Must be seeded!
var pulse = false;           // "True" when User's live heartbeat is detected. "False" when not a "live beat".
var rate = [10];               // array to hold last ten IBI values
var sampleCounter = 0;       // used to determine pulse timing
var lastBeatTime = 0;        // used to find IBI
var P = 2048;                // used to find peak in pulse wave, seeded
var T = 2048;                // used to find trough in pulse wave, seeded
var thresh = 2100;           // used to find instant moment of heart beat, seeded
var amp = 400;               // used to hold amplitude of pulse waveform, seeded
var firstBeat = true;        // used to seed rate array so we startup with reasonable BPM
var secondBeat = false;      // used to seed rate array so we startup with reasonable BPM

// pins
var pin = aio.open({device:0, pin: pins.A1 });

function measureHeartRate(signal) {
    var HR = 0;

    sampleCounter += 2;                        // keep track of the time in mS with this variable
    var N = sampleCounter - lastBeatTime;       // monitor the time since the last beat to avoid noise

    // find the peak and trough of the pulse wave
    if (signal < thresh && (N > ((IBI / 5) * 3))) { // avoid dichrotic noise by waiting 3/5 of last IBI
        if (signal < T) {                       // T is the trough
            T = signal;                         // keep track of lowest point in pulse wave
        }
    }

    if (signal > thresh && signal > P) {        // thresh condition helps avoid noise
        P = signal;                             // P is the peak
    }                                           // keep track of highest point in pulse wave

    // NOW IT'S TIME TO LOOK FOR THE HEART BEAT
    // signal surges up in value every time there is a pulse
    if (N > 250 && N < 2000) {                  // avoid noise. 30 bpm < possible human heart beat < 240
        if ((signal > thresh) && (pulse == false) && (N > ((IBI / 5) * 3))) {
            pulse = true;                       // set the pulse flag when we think there is a pulse
            IBI = sampleCounter - lastBeatTime; // measure time between beats in mS
            lastBeatTime = sampleCounter;       // keep track of time for next pulse

            if (secondBeat) {                   // if this is the second beat, if secondBeat == TRUE
                console.log("Measured 2nd beat");
                secondBeat = false;             // clear secondBeat flag
                for(var i = 0; i <= 9; i++) {   // seed the running total to get a realisitic BPM at startup
                    rate[i] = IBI;
                }
            }

            if (firstBeat) {                    // if it's the first time we found a beat, if firstBeat == TRUE
                console.log("Measured 1st beat");
                firstBeat = false;              // clear firstBeat flag
                secondBeat = true;              // set the second beat flag
                return 0;                       // IBI value is unreliable so discard it
            }

            // keep a running total of the last 10 IBI values
            var runningTotal = 0;               // clear the runningTotal variable

            for (var i = 0; i <= 8; i++) {      // shift data in the rate array
                rate[i] = rate[i + 1];          // and drop the oldest IBI value
                runningTotal += rate[i];        // add up the 9 oldest IBI values
            }

            rate[9] = IBI;                      // add the latest IBI to the rate array
            runningTotal += rate[9];            // add the latest IBI to runningTotal
            runningTotal /= 10;                 // average the last 10 IBI values
            HR = 60000 / runningTotal;          // how many beats can fit into a minute? that's BPM!
        }
    }

    if (signal < thresh && pulse == true) {     // when the values are going down, the beat is over
        pulse = false;                          // reset the pulse flag so we can do it again
        amp = P - T;                            // get amplitude of the pulse wave
        thresh = (amp * 2 / 3) + T;             // set thresh at 67% of the amplitude
        P = thresh;                             // reset these for next time
        T = thresh;
    }

    if (N > 2500) {                             // if 2.5 seconds go by without a beat
        thresh = 2048;                          // set thresh default
        P = 2048;                               // set P default
        T = 2048;                               // set T default
        lastBeatTime = sampleCounter;           // bring the lastBeatTime up to date
        firstBeat = true;                       // set these to avoid noise
        secondBeat = false;                     // when we get the heartbeat back
   }

    return HR;                              // return integer instead of float
}

setInterval(function() {
    var rawSignal = pin.read();
    var signal = measureHeartRate(rawSignal);
    // send notification
    console.log("HR=" + signal);
}, 0);

 


Problems with L2 on samples/net/echo_client and nrf52_pca10040

Flavio Arieta <flavioarieta@...>
 

Hi,

I'm having some problems with the echo_client sample while using my nrf52 pca10040.

From what I understood of the problem is that net_if_get_ll_reserve called from net_ipv6_send_nscrashes because of iface->l2->reserve (no function attached to it maybe?).

The project configuration is the default prj_nrf5.conf and no modifications where made on the code apart from some extras debug messages.

Since I haven't changed anything from the configuration and project that could generate this error I'm very confused.


Steps to reproduce the problem:
1. make pristine 
2. make CONF_FILE=prj_nrf5.conf BOARD=nrf52_pca10040
3. program the board.


Serial output (I can't access pastebin from here, sorry):
[net/core] [DBG] net_init: (0x2000691c): Priority 90
[net/core] [DBG] l2_init: (0x2000691c): Network L2 init done
[net/core] [DBG] l3_init: (0x2000691c): Network L3 init done
[net/core] [DBG] net_rx_thread: (0x2000229c): Starting RX thread (stack 2048 bytes)
[net/if] [DBG] net_if_init: (0x2000229c): 
[net/if] [DBG] net_if_tx_thread: (0x20002a9c): Starting TX thread (stack 2048 bytes)
[net/if] [DBG] net_if_post_init: (0x2000229c): 
shell> [echo-client] [INF] init_app: Run echo client
[net/if] [DBG] net_if_ipv6_start_dad: (0x2000691c): Interface 0x20000900 ll addr 34:80:04:F0:07:FA tentative IPv6 addr 2001:db8::1
***** BUS FAULT *****
  Executing thread ID (thread): 0x2000691c
  Faulting instruction address:  0x6b6360
  Instruction bus error
Fatal fault in essential thread! Spinning...


I'm new to Zephyr, so I can lack basic knowledge while configurating the project and with the Zephyr RTOS structure and data flow.


Thanks,
Flávio Arieta Netto.


Problems with Zephyr JS

Kevin Stöckl <k_stoeckl@...>
 

Hello,

when i try to run following code in the zephyr js ide, then the application did not start. What could be the problem? In the console it just writes "echo o" and than it stops.


var aio = require("aio");
//var ble = require("ble");
var pins = require("arduino101_pins");

// heart rate calculation
var IBI = 600;               // value holds the time interval between beats! Must be seeded!
var pulse = false;           // "True" when User's live heartbeat is detected. "False" when not a "live beat".
var rate = [10];               // array to hold last ten IBI values
var sampleCounter = 0;       // used to determine pulse timing
var lastBeatTime = 0;        // used to find IBI
var P = 2048;                // used to find peak in pulse wave, seeded
var T = 2048;                // used to find trough in pulse wave, seeded
var thresh = 2100;           // used to find instant moment of heart beat, seeded
var amp = 400;               // used to hold amplitude of pulse waveform, seeded
var firstBeat = true;        // used to seed rate array so we startup with reasonable BPM
var secondBeat = false;      // used to seed rate array so we startup with reasonable BPM

// pins
var pin = aio.open({device:0, pin: pins.A1 });

function measureHeartRate(signal) {
    var HR = 0;

    sampleCounter += 2;                        // keep track of the time in mS with this variable
    var N = sampleCounter - lastBeatTime;       // monitor the time since the last beat to avoid noise

    // find the peak and trough of the pulse wave
    if (signal < thresh && (N > ((IBI / 5) * 3))) { // avoid dichrotic noise by waiting 3/5 of last IBI
        if (signal < T) {                       // T is the trough
            T = signal;                         // keep track of lowest point in pulse wave
        }
    }

    if (signal > thresh && signal > P) {        // thresh condition helps avoid noise
        P = signal;                             // P is the peak
    }                                           // keep track of highest point in pulse wave

    // NOW IT'S TIME TO LOOK FOR THE HEART BEAT
    // signal surges up in value every time there is a pulse
    if (N > 250 && N < 2000) {                  // avoid noise. 30 bpm < possible human heart beat < 240
        if ((signal > thresh) && (pulse == false) && (N > ((IBI / 5) * 3))) {
            pulse = true;                       // set the pulse flag when we think there is a pulse
            IBI = sampleCounter - lastBeatTime; // measure time between beats in mS
            lastBeatTime = sampleCounter;       // keep track of time for next pulse

            if (secondBeat) {                   // if this is the second beat, if secondBeat == TRUE
                console.log("Measured 2nd beat");
                secondBeat = false;             // clear secondBeat flag
                for(var i = 0; i <= 9; i++) {   // seed the running total to get a realisitic BPM at startup
                    rate[i] = IBI;
                }
            }

            if (firstBeat) {                    // if it's the first time we found a beat, if firstBeat == TRUE
                console.log("Measured 1st beat");
                firstBeat = false;              // clear firstBeat flag
                secondBeat = true;              // set the second beat flag
                return 0;                       // IBI value is unreliable so discard it
            }

            // keep a running total of the last 10 IBI values
            var runningTotal = 0;               // clear the runningTotal variable

            for (var i = 0; i <= 8; i++) {      // shift data in the rate array
                rate[i] = rate[i + 1];          // and drop the oldest IBI value
                runningTotal += rate[i];        // add up the 9 oldest IBI values
            }

            rate[9] = IBI;                      // add the latest IBI to the rate array
            runningTotal += rate[9];            // add the latest IBI to runningTotal
            runningTotal /= 10;                 // average the last 10 IBI values
            HR = 60000 / runningTotal;          // how many beats can fit into a minute? that's BPM!
        }
    }

    if (signal < thresh && pulse == true) {     // when the values are going down, the beat is over
        pulse = false;                          // reset the pulse flag so we can do it again
        amp = P - T;                            // get amplitude of the pulse wave
        thresh = (amp * 2 / 3) + T;             // set thresh at 67% of the amplitude
        P = thresh;                             // reset these for next time
        T = thresh;
    }

    if (N > 2500) {                             // if 2.5 seconds go by without a beat
        thresh = 2048;                          // set thresh default
        P = 2048;                               // set P default
        T = 2048;                               // set T default
        lastBeatTime = sampleCounter;           // bring the lastBeatTime up to date
        firstBeat = true;                       // set these to avoid noise
        secondBeat = false;                     // when we get the heartbeat back
   }

    return HR;                              // return integer instead of float
}

setInterval(function() {
    var rawSignal = pin.read();
    var signal = measureHeartRate(rawSignal);
    // send notification
    console.log("HR=" + signal);
}, 0);


NXP FRDM-K64F networking

Kevin Stöckl <k_stoeckl@...>
 

Hi

How is it possible to get my data into the cloud with the frdm-k64f board?


Error flasing Nucleo F401RE

Lucas Tanure <tanure@...>
 

Hi,

I got this error trying to use the board Nucleo F401RE.

Where is the definition for the flash start address used by openocd ?

tanure@archTanure hello_world $ make BOARD=nucleo_f401re flash
make[1]: Entering directory '/home/tanure/workspace/zephyr'
make[2]: Entering directory
'/home/tanure/workspace/zephyr/samples/hello_world/outdir/nucleo_f401re'
Using /home/tanure/workspace/zephyr as source for kernel
GEN ./Makefile
CHK include/generated/version.h
CHK include/generated/generated_dts_board.h
CHK misc/generated/configs.c
CHK include/generated/offsets.h
make[3]: 'isr_tables.o' is up to date.
Flashing nucleo_f401re
Flashing Target Device
Open On-Chip Debugger 0.9.0-dirty (2017-05-16-18:46)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The
results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v27 API v2 SWIM v15 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.257255
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0* stm32f4x.cpu hla_target little stm32f4x.cpu halted
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000358 msp: 0x20018000
auto erase enabled
Info : device id = 0x10016433
Info : flash size = 512kbytes
Warn : no flash bank found for address 0
wrote 0 bytes from file
/home/tanure/workspace/zephyr/samples/hello_world/outdir/nucleo_f401re/zephyr.bin
in 0.000737s (0.000 KiB/s)
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000358 msp: 0x20018000
diff 0 address 0x00000000. Was 0x00 instead of 0x68
diff 1 address 0x00000001. Was 0x80 instead of 0x08
diff 2 address 0x00000002. Was 0x01 instead of 0x00
diff 3 address 0x00000004. Was 0x59 instead of 0x1d
diff 4 address 0x00000005. Was 0x03 instead of 0x21
diff 5 address 0x00000008. Was 0xa1 instead of 0x6d
diff 6 address 0x00000009. Was 0x03 instead of 0x21
diff 7 address 0x0000000c. Was 0xa1 instead of 0xc5
More than 8 errors, the rest are not printed.

make[2]: *** [/home/tanure/workspace/zephyr/Makefile:1299: flash] Error 1
make[2]: Leaving directory
'/home/tanure/workspace/zephyr/samples/hello_world/outdir/nucleo_f401re'
make[1]: *** [Makefile:176: sub-make] Error 2
make[1]: Leaving directory '/home/tanure/workspace/zephyr'
make: *** [/home/tanure/workspace/zephyr/Makefile.inc:88: flash] Error 2

Thanks

--
Lucas Tanure
Embedded Developer


Patch for zephyr 1.6 which includes deep sleep for quark_se

Mahendravarman Rajarao (RBEI/EAA10) <Mahendravarman.Rajarao@...>
 

Hi

 

In Zephyr 1.7 , the implementation for deep sleep for quark_se is done

 

We have finalized our application based on zephyr 1.6. In this version deep sleep implementation for quark_se is NOT available

 

 

Is there any patch I can apply on zephyr 1.6, to get the deep sleep support for quark_se ??

 

Thanks

Mahendra

2501 - 2520 of 2576