Date   

Zephyr v1.14.0-rc3 Tagged

Kumar Gala
 

Hi all,

We have just tagged Zephyr 1.14.0-rc3.

At this point ONLY PRs related to docs or related to a GitHub issue / bug will go in. If a PR fixes a bug it MUST have an associated GitHub issue.

Our bug counts are looking pretty good for the release at this point:

6 - High [Goal 0]
26 - Medium [Goal 20]
57 - Low [Goal 50]

The final release is tentatively scheduled for the 12th of April.

The full release log can be found here:
https://github.com/zephyrproject-rtos/zephyr/releases/tag/v1.14.0-rc3

Thanks to everybody who contributed to this release!

Kumar


Re: Syntax in dts file for defining a GPIO output based on nxp,kinetis-gpio.yaml #defines

Andrei Gansari
 

Hello,

 

Yes, my example was hardcoded in regard to port and pin number. Your example makes them configurable via dts, while code remains the same.

 

I only have to point another thing: the generated macros name will remain the same in other dts configurations if you keep the same name across dts (in the example:  _test {} ).

 

 

Regards,

Andrei

 

 

From: devel@... <devel@...> On Behalf Of Bo.Kragelund via Lists.Zephyrproject.Org
Sent: Thursday, March 28, 2019 5:06 PM
To: devel@...
Cc: devel@...
Subject: Re: [Zephyr-devel] Syntax in dts file for defining a GPIO output based on nxp,kinetis-gpio.yaml #defines

 

Hello Andrei,

And thank you very much for your quick answer.
I really appriciate the quick link to where I can find the documentation and also the example you have provided.

I am also aware of, that it will be in the code, that you configure the pin to be input or output.

But what is not so great is, that we would very much like to define the port and pin number at the dts level for the specific boards, that we support.
We want the code to be generic and not be changed, if a new board will use another pin for the same function.

This is what zephyr has achieved by making the gpio-leds.yaml and then setup the leds in the board specific dts files.
By doing this, along with using alias, you simply refer to the define LED0_GPIO_PIN in your code across all boards without knowing what pin it is and what port in the code, which we like.

We have actually made our own gpio-xxx.yaml, which looks similar to gpio-leds.yaml and placed it in the same location as gpio-leds.yaml.
Then we put the following lines in the dts file for the given board:

_test {

compatible = "gpio-xxx";

test_pin {

gpios = <&gpiob 22 0>;

label = "My test pin";

};

};


This will create the following in the auto generated header file:

/* test_pin */

#define DT_GPIO_OUT_TEST_PIN_GPIO_CONTROLLER "GPIO_1"

#define DT_GPIO_OUT_TEST_PIN_GPIO_FLAGS 0

#define DT_GPIO_OUT_TEST_PIN_GPIO_PIN 22

#define DT_GPIO_OUT_TEST_PIN_LABEL "My test pin"

 

We don't use alias because we want to see in the code, that the defines comes from dts.
The code will then have lines like this:


wdt_device = device_get_binding(DT_GPIO_OUT_TEST_PIN_GPIO_CONTROLLER);

gpio_pin_configure(wdt_device, DT_GPIO_OUT_TEST_PIN_GPIO_PIN, GPIO_DIR_OUT | DT_GPIO_OUT_TEST_PIN_GPIO_FLAGS);

gpio_pin_write(wdt_device, DT_GPIO_OUT_TEST_PIN_GPIO_PIN, 1);

 

I guess this is a way to do it, if you want to keep your code independant of pin numbers etc.
Of course you have to write the dts lines with the exact same names in all dts files supporting this function.

Best regards,
Bo


Re: Syntax in dts file for defining a GPIO output based on nxp,kinetis-gpio.yaml #defines

Bo.Kragelund@...
 

Hello Andrei,

And thank you very much for your quick answer.
I really appriciate the quick link to where I can find the documentation and also the example you have provided.

I am also aware of, that it will be in the code, that you configure the pin to be input or output.

But what is not so great is, that we would very much like to define the port and pin number at the dts level for the specific boards, that we support.
We want the code to be generic and not be changed, if a new board will use another pin for the same function.

This is what zephyr has achieved by making the gpio-leds.yaml and then setup the leds in the board specific dts files.
By doing this, along with using alias, you simply refer to the define LED0_GPIO_PIN in your code across all boards without knowing what pin it is and what port in the code, which we like.

We have actually made our own gpio-xxx.yaml, which looks similar to gpio-leds.yaml and placed it in the same location as gpio-leds.yaml.
Then we put the following lines in the dts file for the given board:

_test {
compatible = "gpio-xxx";
test_pin {
gpios = <&gpiob 22 0>;
label = "My test pin";
};
};

This will create the following in the auto generated header file:

/* test_pin */
#define DT_GPIO_OUT_TEST_PIN_GPIO_CONTROLLER "GPIO_1"
#define DT_GPIO_OUT_TEST_PIN_GPIO_FLAGS 0
#define DT_GPIO_OUT_TEST_PIN_GPIO_PIN 22
#define DT_GPIO_OUT_TEST_PIN_LABEL "My test pin"
 
We don't use alias because we want to see in the code, that the defines comes from dts.
The code will then have lines like this:

wdt_device = device_get_binding(DT_GPIO_OUT_TEST_PIN_GPIO_CONTROLLER);
gpio_pin_configure(wdt_device, DT_GPIO_OUT_TEST_PIN_GPIO_PIN, GPIO_DIR_OUT | DT_GPIO_OUT_TEST_PIN_GPIO_FLAGS);
gpio_pin_write(wdt_device, DT_GPIO_OUT_TEST_PIN_GPIO_PIN, 1);
 
I guess this is a way to do it, if you want to keep your code independant of pin numbers etc.
Of course you have to write the dts lines with the exact same names in all dts files supporting this function.

Best regards,
Bo


Re: Syntax in dts file for defining a GPIO output based on nxp,kinetis-gpio.yaml #defines

Andrei Gansari
 

Hello Bo,

 

 

We have a general help page for Device Tree: https://docs.zephyrproject.org/latest/guides/dts/index.html

 

In your particular case, you need to set port b pin 22 as output.

 

Device Tree:

The purpose of DT is to describe the HW of the board (boot time @ Linux, compile time @ Zephyr).

K64F’s DT file is found in: boards/arm/frdm_k64f/frdm_k64f.dts I expect this is what you are looking at. It also includes file dts/arm/nxp/nxp_k6x.dtsi where port b is set using nxp,kinetis-gpio.yaml. Dtsi file is a generic dts include file that describes the SoC (we may have another board with the same SoC on it).

Add the following to frdm_k64f.dts to use gpiob from nxp_k6x.dtsi:

&gpiob {

    status = "ok";

};

You can comment out/remove the following to remove he led configuration on the same pin:

        red_led: led_0 {

            gpios = <&gpiob 22 0>;

            label = "User LD1";

        };

 

Code:

You can’t configure a pin as in/out, using DT, we have board’s pinmux.c (in boards/arm/frdm_k64f) to do that. This is because GPIO should be dynamic during the application.

pinmux_pin_set(portb, 22, PORT_PCR_MUX(kPORT_MuxAsGpio));

The code above sets pin as GPIO (for the led in the case above). Then set pin to output and send a signal:

#include <gpio.h>

 

    pinmux_pin_set(portb, 22, PORT_PCR_MUX(kPORT_MuxAsGpio));

 

    struct device *gpiob =

           device_get_binding(DT_NXP_KINETIS_GPIO_GPIO_B_LABEL);

 

    gpio_pin_configure(gpiob, 22, GPIO_DIR_OUT);

    gpio_pin_write(gpiob, 22, 0);

 

DT_NXP_KINETIS_GPIO_GPIO_B_LABEL can be found in files zephyr/include/generated/generated_dts_board*** (relative to build folder) this is the effect of setting portb in dts.

 

 

Regards,

Andrei Gânsari

 

From: devel@... <devel@...> On Behalf Of Bo.Kragelund via Lists.Zephyrproject.Org
Sent: Thursday, March 28, 2019 12:57 PM
To: devel@...
Cc: devel@...
Subject: [Zephyr-devel] Syntax in dts file for defining a GPIO output based on nxp,kinetis-gpio.yaml #defines

 

Hello developers!

I have difficulties finding any documentation/examples of how to define a simple GPIO as an e.g. output in the frdm_k64f.dts file for the frdm_k64f board.

As long as we talk about defining the outputs for LEDS on the board, this is done very nice based on the gpio-keys.yaml specific for this purpose.
As seen below, which is copied from the frdm_k64f.dts file, you simply define the port, pin number, and flags in one line like this: gpios = <&gpiob 22 0>, which means port b, pin 22, and no flags.

leds {

compatible = "gpio-leds";

red_led: led_0 {

gpios = <&gpiob 22 0>;

label = "User LD1";

};

};

 

But in general, I believe the idea is to define GPIO in the dts file based on the nxp,kinetis-gpio.yaml file created for this purpose, instead of the gpio-keys.yaml file.
But this file has a completely different way/syntax for defining a GPIO compared to the gpio-keys.yaml file.
It doesn't have the gpios property, but reg and interrupt instead. It also includes the below lines, which I guess I should use in some way:

"#cells":

  - pin

  - flags

 

Since I am rather new in dts and yaml syntax, I hope someone can help me with the syntax for setting port b, pin 22, and no flags, based on the nxp,kinetis-gpio.yaml file...

As written before, I haven't been able to find any examples so far in either the zephyr repository or zephyr documentation.

Thank you for your help.

Best regards,
Bo Kragelund

I hope someone can help me,


Re: How to run samples/subsys/usb/console on windows with nrf52840_pac10056?

Carles Cufi
 

Hi Aaron,

 

There is a Pull Request to fix this, but it is not merged yet:

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

 

Regards,

 

Carles

 

From: Aaron Xu <overheat1984@...>
Sent: 28 March 2019 12:30
To: Andrei Emeltchenko <andrei.emeltchenko.news@...>
Cc: Lars Knudsen <larsgk@...>; Cufi, Carles <Carles.Cufi@...>; zephyr-devel <zephyr-devel@...>; Szymczyk, Marcin <Marcin.Szymczyk@...>; devel@...
Subject: Re: [Zephyr-devel] How to run samples/subsys/usb/console on windows with nrf52840_pac10056?

 

Hi,

 

After updating my zephyr code to latest, I found some patch already done both on USB driver and sample. Good job!
And the result of console sample on my win10 PC is changed, there is one more Zephyr port, looks the USB device already be recognized, but still not works.

Any patch pending not merged?

 

2.png

 

 

On Mon, Mar 18, 2019 at 3:36 PM Andrei Emeltchenko <andrei.emeltchenko.news@...> wrote:

Hi Lars,

On Sat, Mar 16, 2019 at 12:57:52PM +0100, Lars Knudsen wrote:
>    Hi Carles,
>    If the right descriptors are added, it should be possible to get working
>    without the *.inf file.  Windows is a mess - but it *is* possible.
>    There seem to be something wrong in the descriptors (at least in the
>    WebUSB sample) preventing windows from picking up the device sans drivers
>    - but I know it is possible because I made it in this project (mbed
>    based... trying to find time to port it over ;)) ->

Do they use MS OS Descriptors to pick right driver? We have this
capability in Zephyr, it is used in RNDIS to pick RNDIS compatible
device driver.

You can also create issue for the sample.

Best regards
Andrei Emeltchenko

>    [1]https://github.com/empirikit/empirikit-controller
>    (it depends on this lib that has some of the webusb support
>    -> [2]https://os.mbed.com/users/larsgk/code/USBDevice_WebUSB/file/1d8a6665d607/WebUSBDevice/
>    )
>    Also... remember that windows remembers devices and their drivers.. and
>    during development/test of the solution, the easiest might be to have a
>    clean windows VM that can be deleted on every try ... that or bump the PID
>    ;) ... windows is ..interesting
>    br
>    Lars
>    On Sat, Mar 16, 2019 at 12:42 PM Cufi, Carles
>    <[3]carles.cufi@...> wrote:
>
>      Hi Aaron,
>
>       
>
>      This is because Windows needs an .inf file with matching VID/PID.
>
>      Marcin from Nordic is currently working on addressing that.
>
>       
>
>      See: [4]https://github.com/zephyrproject-rtos/zephyr/pull/14106
>
>       
>
>      Carles
>
>       
>
>      From: [5]devel@...
>      <[6]devel@...> On Behalf Of Aaron Xu via
>      [7]Lists.Zephyrproject.Org
>      Sent: 16 March 2019 02:10
>      To: zephyr-devel <[8]zephyr-devel@...>
>      Cc: [9]devel@...
>      Subject: [Zephyr-devel] How to run samples/subsys/usb/console on windows
>      with nrf52840_pac10056?
>
>       
>
>      Hi,
>
>      I want to evaluate the samples/subsys/usb/console sample. It looks quite
>      easy from the README file. But my PC(win10) cannot recognize the USB
>      console(I suppose CDC device) correctly.
>
>       
>
>      PS: I connect the J3 port on pca10056 to my PC and switch the SW9 to
>      "USB".
>
>       
>
>      [10]usb.png
>
>       
>
>      Do I miss something?
>
>      Thanks.
> >
> References
>
>    Visible links
>    1. https://github.com/empirikit/empirikit-controller
>    2. https://os.mbed.com/users/larsgk/code/USBDevice_WebUSB/file/1d8a6665d607/WebUSBDevice/
>    3. mailto:carles.cufi@...
>    4. https://github.com/zephyrproject-rtos/zephyr/pull/14106
>    5. mailto:devel@...
>    6. mailto:devel@...
>    7. http://lists.zephyrproject.org/
>    8. mailto:zephyr-devel@...
>    9. mailto:devel@...
>   11. https://lists.zephyrproject.org/g/devel/message/5796
>   12. mailto:larsgk@...?subject=Private:%20Re:%20Re%3A%20%5BZephyr-devel%5D%20How%20to%20run%20samples%2Fsubsys%2Fusb%2Fconsole%20on%20windows%20with%20nrf52840_pac10056%3F
>   13. mailto:devel@...?subject=Re:%20Re%3A%20%5BZephyr-devel%5D%20How%20to%20run%20samples%2Fsubsys%2Fusb%2Fconsole%20on%20windows%20with%20nrf52840_pac10056%3F
>   14. https://lists.zephyrproject.org/mt/30449543/900599
>   15. https://lists.zephyrproject.org/g/devel/post
>   16. https://lists.zephyrproject.org/g/devel/editsub/900599
>   17. mailto:devel+owner@...
>   18. https://lists.zephyrproject.org/g/devel/unsub


Re: How to run samples/subsys/usb/console on windows with nrf52840_pac10056?

Aaron Xu
 

Hi,

After updating my zephyr code to latest, I found some patch already done both on USB driver and sample. Good job!
And the result of console sample on my win10 PC is changed, there is one more Zephyr port, looks the USB device already be recognized, but still not works.

Any patch pending not merged?

2.png


On Mon, Mar 18, 2019 at 3:36 PM Andrei Emeltchenko <andrei.emeltchenko.news@...> wrote:
Hi Lars,

On Sat, Mar 16, 2019 at 12:57:52PM +0100, Lars Knudsen wrote:
>    Hi Carles,
>    If the right descriptors are added, it should be possible to get working
>    without the *.inf file.  Windows is a mess - but it *is* possible.
>    There seem to be something wrong in the descriptors (at least in the
>    WebUSB sample) preventing windows from picking up the device sans drivers
>    - but I know it is possible because I made it in this project (mbed
>    based... trying to find time to port it over ;)) ->

Do they use MS OS Descriptors to pick right driver? We have this
capability in Zephyr, it is used in RNDIS to pick RNDIS compatible
device driver.

You can also create issue for the sample.

Best regards
Andrei Emeltchenko

>    [1]https://github.com/empirikit/empirikit-controller
>    (it depends on this lib that has some of the webusb support
>    -> [2]https://os.mbed.com/users/larsgk/code/USBDevice_WebUSB/file/1d8a6665d607/WebUSBDevice/
>    )
>    Also... remember that windows remembers devices and their drivers.. and
>    during development/test of the solution, the easiest might be to have a
>    clean windows VM that can be deleted on every try ... that or bump the PID
>    ;) ... windows is ..interesting
>    br
>    Lars
>    On Sat, Mar 16, 2019 at 12:42 PM Cufi, Carles
>    <[3]carles.cufi@...> wrote:
>
>      Hi Aaron,
>
>       
>
>      This is because Windows needs an .inf file with matching VID/PID.
>
>      Marcin from Nordic is currently working on addressing that.
>
>       
>
>      See: [4]https://github.com/zephyrproject-rtos/zephyr/pull/14106
>
>       
>
>      Carles
>
>       
>
>      From: [5]devel@...
>      <[6]devel@...> On Behalf Of Aaron Xu via
>      [7]Lists.Zephyrproject.Org
>      Sent: 16 March 2019 02:10
>      To: zephyr-devel <[8]zephyr-devel@...>
>      Cc: [9]devel@...
>      Subject: [Zephyr-devel] How to run samples/subsys/usb/console on windows
>      with nrf52840_pac10056?
>
>       
>
>      Hi,
>
>      I want to evaluate the samples/subsys/usb/console sample. It looks quite
>      easy from the README file. But my PC(win10) cannot recognize the USB
>      console(I suppose CDC device) correctly.
>
>       
>
>      PS: I connect the J3 port on pca10056 to my PC and switch the SW9 to
>      "USB".
>
>       
>
>      [10]usb.png
>
>       
>
>      Do I miss something?
>
>      Thanks.
> >
> References
>
>    Visible links
>    1. https://github.com/empirikit/empirikit-controller
>    2. https://os.mbed.com/users/larsgk/code/USBDevice_WebUSB/file/1d8a6665d607/WebUSBDevice/
>    3. mailto:carles.cufi@...
>    4. https://github.com/zephyrproject-rtos/zephyr/pull/14106
>    5. mailto:devel@...
>    6. mailto:devel@...
>    7. http://lists.zephyrproject.org/
>    8. mailto:zephyr-devel@...
>    9. mailto:devel@...
>   11. https://lists.zephyrproject.org/g/devel/message/5796
>   12. mailto:larsgk@...?subject=Private:%20Re:%20Re%3A%20%5BZephyr-devel%5D%20How%20to%20run%20samples%2Fsubsys%2Fusb%2Fconsole%20on%20windows%20with%20nrf52840_pac10056%3F
>   13. mailto:devel@...?subject=Re:%20Re%3A%20%5BZephyr-devel%5D%20How%20to%20run%20samples%2Fsubsys%2Fusb%2Fconsole%20on%20windows%20with%20nrf52840_pac10056%3F
>   14. https://lists.zephyrproject.org/mt/30449543/900599
>   15. https://lists.zephyrproject.org/g/devel/post
>   16. https://lists.zephyrproject.org/g/devel/editsub/900599
>   17. mailto:devel+owner@...
>   18. https://lists.zephyrproject.org/g/devel/unsub



Syntax in dts file for defining a GPIO output based on nxp,kinetis-gpio.yaml #defines

Bo.Kragelund@...
 

Hello developers!

I have difficulties finding any documentation/examples of how to define a simple GPIO as an e.g. output in the frdm_k64f.dts file for the frdm_k64f board.

As long as we talk about defining the outputs for LEDS on the board, this is done very nice based on the gpio-keys.yaml specific for this purpose.
As seen below, which is copied from the frdm_k64f.dts file, you simply define the port, pin number, and flags in one line like this: gpios = <&gpiob 22 0>, which means port b, pin 22, and no flags.
leds {
compatible = "gpio-leds";
red_led: led_0 {
gpios = <&gpiob 22 0>;
label = "User LD1";
};
};
 
But in general, I believe the idea is to define GPIO in the dts file based on the nxp,kinetis-gpio.yaml file created for this purpose, instead of the gpio-keys.yaml file.
But this file has a completely different way/syntax for defining a GPIO compared to the gpio-keys.yaml file.
It doesn't have the gpios property, but reg and interrupt instead. It also includes the below lines, which I guess I should use in some way:

"#cells":
  - pin
  - flags
 
Since I am rather new in dts and yaml syntax, I hope someone can help me with the syntax for setting port b, pin 22, and no flags, based on the nxp,kinetis-gpio.yaml file...

As written before, I haven't been able to find any examples so far in either the zephyr repository or zephyr documentation.

Thank you for your help.

Best regards,
Bo Kragelund

I hope someone can help me,


Re: Opus codec on nrf52840

nicolas lantz
 

Hi,

Very late, as I wanted to try to do that properly,

###############

Opus configuration :
- frame of 5ms
- opus bitrate (CBR) : 32kbit/s
- Sampling 16bit@16kHz
- Channel 1
- complexity 4
- Celt mode only

Zephyr build : CONFIG_SPEED_OPTIMIZATIONS=y

###############

With SDK 0.9.5, the CPU usage is about:
Opus Encoder : 50%
Opus Decoder : 30%

With SDK 0.10.0, the CPU usage is about:
Opus Encoder : 78%
Opus Decoder : 57%



Nicolas LANTZ
M : +33 (0)6 19 07 43 43
T : +33 (0)9 52 96 81 86
www.ubicore.net
Le 19/12/2018 à 10:28, Zięcik, Piotr a écrit :

Hi.

 

Great to hear that!

Do you have any information about resource usage (Flash/RAM used, CPU load etc)?

 

Piotr ZIĘCIK | Senior Firmware Engineer
M +48 698 726 973| Kraków, Poland
nordicsemi.com | devzone.nordicsemi.com

Nordic_logo_signature

 

From: nicolas lantz <nicolas.lantz@...>
Sent: Wednesday, December 19, 2018 10:15 AM
To: Zięcik, Piotr <Piotr.Ziecik@...>; Cufi, Carles <Carles.Cufi@...>; devel@...
Subject: Re: [Zephyr-devel] Opus codec on nrf52840

 

Hello,

I have a "net_opus" server sample that is able to compress and then decode an audio PCM stream with the opus codec.
- It work on the fly in realtime with an opus codec configured in low complexity on the nrf52840-dk board.
- the stream come from a  TCP client like netcat, it's encoded with opus, then decoded, and the output pcm stream is sent back to the TCP client.

Running the demo give something like that :
nc 192.0.2.1 4242 < Test_16000Hz_mono_16bit.raw  | aplay -t raw -f S16_LE -r 16000 -c 1 -

If someone is interested on it :
https://gitlab.com/ubicore/zephyr/commit/177a410c6902ecacb9552c907f1e4f60e7a23b1a



Regards,
Nicolas
 
Nicolas LANTZ
M : +33 (0)6 19 07 43 43
T : +33 (0)9 52 96 81 86
www.ubicore.net

Le 04/12/2018 à 10:38, nicolas lantz a écrit :

Thanks you for the reponse.
I took the time to extract the modified opus library code from the Smart Ready project (from the .exe to linux) and compared it to the origin opus lib.
Now i will try to use it in a zephry project
 
Regards,
 
Nicolas
Nicolas LANTZ
M : +33 (0)6 19 07 43 43
T : +33 (0)9 52 96 81 86
www.ubicore.net

Le 29/11/2018 à 12:56, Zięcik, Piotr a écrit :

Hello.

 

I can recommend looking into https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRFready-Smart-Remote-3-for-nRF52-Series

Unfortunately it is not based on the Zephyr, however it implements audio streaming using Opus and contains an optimized version of the codec

(with reduced memory requirements as well as using DPS extensions available on the Nordic chips).

 

If you require any further information, feel free to contact me.

Piotr ZIĘCIK | Senior Firmware Engineer
M +48 698 726 973| Kraków, Poland
nordicsemi.com | devzone.nordicsemi.com

Nordic_logo_signature

 

From: Cufi, Carles
Sent: Thursday, November 29, 2018 12:49 PM
To: nicolas lantz <nicolas.lantz@...>; devel@...; Zięcik, Piotr <Piotr.Ziecik@...>
Subject: RE: [Zephyr-devel] Opus codec on nrf52840

 

+ Piotr

 

From: devel@... <devel@...> On Behalf Of nicolas lantz
Sent: 29 November 2018 12:41
To: devel@...
Subject: [Zephyr-devel] Opus codec on nrf52840

 

Hi,

I would like to use the Opus codec with zephyr on a nrf52840 to encode or decode an audio stream.
Has anyone have a suggestion on this project?


Regards,
 
Nicolas
 

 

 



Re: SPI slave on nRF52840-PCA10059 #nrf52480

Riccardo
 

Thanks to Marcio I resolved. The dts overlay was missing.


I created nrf52840_pca10059.overlay in the application main folder.

&spi1 {

    compatible = "nordic,nrf-spis";   
    status = "ok"; 
    sck-pin = <22>;
    mosi-pin = <23>;
    miso-pin = <24>;
    csn-pin = <25>;
    def-char = <0xFF>;
};

at least it compiles now.

riccardo


Re: SDK migration 0.9.5 -> 0.10.0 increase CPU usage

nicolas lantz
 

Anas,

The processor is an nrf52840, and the opus codec is imported from the "nRFready Smart Remote 3 for nRF52 Series" project.

The project is build with the NEWLIB_LIBC and i have also imported some C Flags in the CMakeLists.txt  to disable Floating point use and enable some DSP extensions available on Nordic chip .

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
 -DARM_MATH_CM4 \
 -DDISABLE_FLOAT_API \
 -DFIXED_POINT \
 -DHAVE_ALLOCA_H \
 -DUSE_ALLOCA \
 -DHAVE_LRINT \
 -DHAVE_LRINTF \
 -DOPUS_ARM_ASM \
 -DOPUS_ARM_INLINE_ASM \
 -DOPUS_ARM_INLINE_EDSP \
 -DOPUS_ARM_INLINE_MEDIA \
 -DOPUS_ARM_MAY_HAVE_EDSP \
 -DOPUS_ARM_PRESUME_EDSP \
 -DVAR_ARRAYS \
 -DOPUS_BUILD \
 -DHAVE_CONFIG_H \
 -g \
")

I guess the new toolchain does not treat these optimizations the same way...


My first demo with opus :
https://gitlab.com/ubicore/zephyr/commit/177a410c6902ecacb9552c907f1e4f60e7a23b1a

Nicolas

Nicolas LANTZ
M : +33 (0)6 19 07 43 43
T : +33 (0)9 52 96 81 86
www.ubicore.net
Le 27/03/2019 à 15:21, Nashif, Anas a écrit :

Nicolas,

Which architecture? I did not see any issues.

 

Anas

 

From: devel@... [mailto:devel@...] On Behalf Of nicolas lantz
Sent: Wednesday, March 27, 2019 9:37 AM
To: devel@...
Subject: [Zephyr-devel] SDK migration 0.9.5 -> 0.10.0 increase CPU usage

 

Hi all,

I just migrate from SDK 0.9.5 to SDK 0.10.0 on my projet and i have between 40% to 90% of additional CPU usage with the new toolchain on the audio compression and decompression tasks (using opus codec).

This over cpu consumption append both with build optimisation configured in debug and speed mode.

Does anyone have some any info or explanation ?

Thanks

-- 
Nicolas
 
Nicolas LANTZ
M : +33 (0)6 19 07 43 43
T : +33 (0)9 52 96 81 86
www.ubicore.net


Re: SDK migration 0.9.5 -> 0.10.0 increase CPU usage

Nashif, Anas
 

Nicolas,

Which architecture? I did not see any issues.

 

Anas

 

From: devel@... [mailto:devel@...] On Behalf Of nicolas lantz
Sent: Wednesday, March 27, 2019 9:37 AM
To: devel@...
Subject: [Zephyr-devel] SDK migration 0.9.5 -> 0.10.0 increase CPU usage

 

Hi all,

I just migrate from SDK 0.9.5 to SDK 0.10.0 on my projet and i have between 40% to 90% of additional CPU usage with the new toolchain on the audio compression and decompression tasks (using opus codec).

This over cpu consumption append both with build optimisation configured in debug and speed mode.

Does anyone have some any info or explanation ?

Thanks

-- 
Nicolas
 
Nicolas LANTZ
M : +33 (0)6 19 07 43 43
T : +33 (0)9 52 96 81 86
www.ubicore.net


SDK migration 0.9.5 -> 0.10.0 increase CPU usage

nicolas lantz
 

Hi all,

I just migrate from SDK 0.9.5 to SDK 0.10.0 on my projet and i have between 40% to 90% of additional CPU usage with the new toolchain on the audio compression and decompression tasks (using opus codec).

This over cpu consumption append both with build optimisation configured in debug and speed mode.

Does anyone have some any info or explanation ?

Thanks
-- 
Nicolas

Nicolas LANTZ
M : +33 (0)6 19 07 43 43
T : +33 (0)9 52 96 81 86
www.ubicore.net


Re: v1.14.0-rc3 release

Kumar Gala
 

Doc updates will still be acceptable, but please tag them with v1.14 milestone & doc label.

- k

On Mar 27, 2019, at 2:37 AM, Erwan Gouriou <erwan.gouriou@linaro.org> wrote:

Hi Kumar,

What about doc PRs?

Thanks
Erwan


On Tue, 26 Mar 2019 at 20:17, Kumar Gala <kumar.gala@linaro.org> wrote:
All,

I plan on making a -rc3 release at the end of the day on Thursday (Mar 28). After which only Bug fix PRs that have an associated GitHub issue will be merged.

Again, please tag any PRs with the v1.14 milestone and with ‘bug’ label.

thanks

- k


Fix Bugs, Win Boards

Thea Aldrich
 

Hi Zephyr Community,
I wanted to signal boost the bug fixing contest we launched yesterday on the Zephyr website. 

"To show our appreciation, the Zephyr Project will be sending the 5 contributors with the most bugs fixed in Zephyr OS 1.14 an i.MX RT1050 from our Platinum member NXPTo be eligible to win one of the i.MX RT1050 please send a list of all your closed bugs and issues to info@.... Be sure to include your name and links to the bugs you are responsible for fixing between October 2018 and the release of Zephyr OS 1.14 in mid April 2019. Zephyr Project TSC members are not eligible for this contest. Non-TSC members from Zephyr Project member companies are welcome and encouraged to participate."

A huge thank you goes out to the team at NXP for providing these boards to the community. Thanks to their donation we will have additional boards available to give out to the most active community contributors throughout the summer! Stay tuned to the Zephyr blog and this list for more information about those contests. 

Please let me know if you have any questions about this contest or need assistance with your entry.
Best,
Thea


Re: v1.14.0-rc3 release

Erwan Gouriou
 

Hi Kumar,

What about doc PRs?

Thanks
Erwan


On Tue, 26 Mar 2019 at 20:17, Kumar Gala <kumar.gala@...> wrote:
All,

I plan on making a -rc3 release at the end of the day on Thursday (Mar 28).  After which only Bug fix PRs that have an associated GitHub issue will be merged.

Again, please tag any PRs with the v1.14 milestone and with ‘bug’ label.

thanks

- k



v1.14.0-rc3 release

Kumar Gala
 

All,

I plan on making a -rc3 release at the end of the day on Thursday (Mar 28). After which only Bug fix PRs that have an associated GitHub issue will be merged.

Again, please tag any PRs with the v1.14 milestone and with ‘bug’ label.

thanks

- k


Re: How to enable DMA transfers for UART?

Li, Jun R
 

Hi Stefan and Erwan,

I’m rebasing my previous implementations to the latest master branch and you can find it here: https://github.com/zephyrproject-rtos/zephyr/pull/14916

I’m still working on it since it is still lacking a couple of things and there are some bugs affecting RX. But the basic idea is to use UART IDLE to define the end of a RX DMA transaction.

 

If you think it is worth keeping going, let’s work together to make it happen.

 

Best Regards,

Jun

 

 

 

 

 

From: Erwan Gouriou <erwan.gouriou@...>
Date: Tuesday, March 26, 2019 at 08:10
To: Stefan Jaritz <stefan@...>
Cc: Paul Sokolovsky <paul.sokolovsky@...>, devel <devel@...>, John J Li <jun.r.li@...>
Subject: Re: [Zephyr-devel] How to enable DMA transfers for UART?

 

Hi Stefan,

 

On Tue, 26 Mar 2019 at 13:01, Stefan Jaritz <stefan@...> wrote:

Hey

I done a demo driver implementation:

https://github.com/StefJar/zephyr_stm32_uart3_dma_driver

Some problems I was facing:

- DMA API: the current one doesn't support ring buffer setups

- UART API: the current API is not mapping the IDLE event.

- UART API: no callbacks possible for event driven rx

With the current design of the UART and DMA API it seems to be
challenging to get a nice fusion.

So I was implementing a simple API for the demo, making block writes
possible and calling a callback when data is received. I didn't used the
UART and DMA API because it would became a dirty hack, while calling
functions form that API & overwriting/patching the ISRs. So I decided
for a lean straight forward implementation.

Thanks for sharing code and experience, this is useful!

 

In my case I am interested into SPI + DMA and USB ACM + DMA. From an
energy perspective it is much better to use DMA transfers for the
peripheral IOs (We can put the MCU to sleep).

Indeed, we should have a proper DMA driver that could be called from other drivers.

 

Maybe it is worth to put a thought on using DMA for peripherals by
default and only the special case is doing polling or RX/TX handling via
uart etc. ISRs.

While I agree DMA has numerous benefits, I don't think this should be the only configuration,

nor the default one. Main issue is initial complexity and configuration needs.

People should be able to use the async API first and then enable DMA once they feel comfortable

with the API.

 

 Erwan

 

Stefan

On 20/03/2019 15:37, Paul Sokolovsky wrote:
> Hello Stefan,
>
> On Tue, 19 Mar 2019 15:18:02 +0000
> "Stefan Jaritz" <stefan@...> wrote:
>
>> Hey,
>>
>> I am currently experimenting with ZephyrOS on different tasks. My
>> base is an own dev board which has a stm32f4xx MCU that connects
>> different ICs etc. via UART, I2C, SPI & GPIOs.
>>
>> Currently the UART ISR is too slow to catch all chars at a rx burst.
>> Usually I am using UART + DMA transfers to relieve the MCU and save
>> energy.
>>
> []
>
>> So I am asking for help or some example how to do an UART & DMA.
>>
>> Think having an ringbuffer for rx and an intr firing after n Bytes
>> received via DMA. Also doing the tx via DMA would be perfect. Any
>> ideas to setup the Zephyr drivers to do so?
> Recently, a new "async" UART API was added to Zephyr, whose
> implementation could leverage DMA support (that was one of usecases for
> this API). There's an open ticket to implement it for STM32:
> https://github.com/zephyrproject-rtos/zephyr/issues/13955
>
> You're welcome to cooperate with the STM32 maintainers on implementing
> it.
>
> []
>


Re: How to enable DMA transfers for UART?

Erwan Gouriou
 

Hi Stefan,

On Tue, 26 Mar 2019 at 13:01, Stefan Jaritz <stefan@...> wrote:
Hey

I done a demo driver implementation:

https://github.com/StefJar/zephyr_stm32_uart3_dma_driver

Some problems I was facing:

- DMA API: the current one doesn't support ring buffer setups

- UART API: the current API is not mapping the IDLE event.

- UART API: no callbacks possible for event driven rx

With the current design of the UART and DMA API it seems to be
challenging to get a nice fusion.

So I was implementing a simple API for the demo, making block writes
possible and calling a callback when data is received. I didn't used the
UART and DMA API because it would became a dirty hack, while calling
functions form that API & overwriting/patching the ISRs. So I decided
for a lean straight forward implementation.

Thanks for sharing code and experience, this is useful!
 
In my case I am interested into SPI + DMA and USB ACM + DMA. From an
energy perspective it is much better to use DMA transfers for the
peripheral IOs (We can put the MCU to sleep).

Indeed, we should have a proper DMA driver that could be called from other drivers.

Maybe it is worth to put a thought on using DMA for peripherals by
default and only the special case is doing polling or RX/TX handling via
uart etc. ISRs.

While I agree DMA has numerous benefits, I don't think this should be the only configuration,
nor the default one. Main issue is initial complexity and configuration needs.
People should be able to use the async API first and then enable DMA once they feel comfortable
with the API.

 Erwan

Stefan

On 20/03/2019 15:37, Paul Sokolovsky wrote:
> Hello Stefan,
>
> On Tue, 19 Mar 2019 15:18:02 +0000
> "Stefan Jaritz" <stefan@...> wrote:
>
>> Hey,
>>
>> I am currently experimenting with ZephyrOS on different tasks. My
>> base is an own dev board which has a stm32f4xx MCU that connects
>> different ICs etc. via UART, I2C, SPI & GPIOs.
>>
>> Currently the UART ISR is too slow to catch all chars at a rx burst.
>> Usually I am using UART + DMA transfers to relieve the MCU and save
>> energy.
>>
> []
>
>> So I am asking for help or some example how to do an UART & DMA.
>>
>> Think having an ringbuffer for rx and an intr firing after n Bytes
>> received via DMA. Also doing the tx via DMA would be perfect. Any
>> ideas to setup the Zephyr drivers to do so?
> Recently, a new "async" UART API was added to Zephyr, whose
> implementation could leverage DMA support (that was one of usecases for
> this API). There's an open ticket to implement it for STM32:
> https://github.com/zephyrproject-rtos/zephyr/issues/13955
>
> You're welcome to cooperate with the STM32 maintainers on implementing
> it.
>
> []
>




SPI slave on nRF52840-PCA10059 #nrf52480

Riccardo
 

Hi all,

I’m trying to get a simple SPI slave application running on nRF52840-PCA10059 dongle. So far, no success. I tried a couple of things that all lead to compilation error of the kind “symbol undeclared…”. Here’s how to reproduce:

riccardo@debian:~/zephyr_builds$ cp -r /media/sf_zephyr/samples/bluetooth/hci_spi/ .
riccardo@debian:~/zephyr_builds/hci_spi$ mkdir b
riccardo@debian:~/zephyr_builds/hci_spi$ cd b
riccardo@debian:~/zephyr_builds/hci_spi/b$ cmake -GNinja -DBOARD=nrf52840_pca10059 ..
riccardo@debian:~/zephyr_builds/hci_spi/b$ ninja

see error_hci_spi.txt (attached) for the errors.

I also tried to start from a blinky application, and enable SPI in menuconfig. If I enable

Device Drivers → SPI hardware bus support → nRF SPI nrfx drivers → SPI Port 1 Driver type → nRF SPIM 1, everything is cool. If I enable
Device Drivers → SPI hardware bus support → nRF SPI nrfx drivers → SPI Port 1 Driver type → nRF SPIS 1, I got errors as attached in error_spi_slave.txt

The symbols it mentioned are defined in an autogenerated .h, that seems to be ignored somehow.

Do you know what's going on?

Regards,
Riccardo


SPI slave on nRF52840-PCA10059 #nrf52480

Cavallari, Riccardo <riccardo.cavallari@...>
 

Hi all,

I’m trying to get a simple SPI slave application running on nRF52840-PCA10059 dongle. So far, no success. I tried a couple of things that all lead to compilation error of the kind “symbol undeclared…”. Here’s how to reproduce:

riccardo@debian:~/zephyr_builds$ cp -r /media/sf_zephyr/samples/bluetooth/hci_spi/ .
riccardo@debian:~/zephyr_builds/hci_spi$ mkdir b
riccardo@debian:~/zephyr_builds/hci_spi$ cd b
riccardo@debian:~/zephyr_builds/hci_spi/b$ cmake -GNinja -DBOARD=nrf52840_pca10059 ..
riccardo@debian:~/zephyr_builds/hci_spi/b$ ninja

see error_hci_spi.txt (attached) for the errors.

I also tried to start from a blinky application, and enable SPI in menuconfig. If I enable

Device Drivers → SPI hardware bus support → nRF SPI nrfx drivers → SPI Port 1 Driver type → nRF SPIM 1, everything is cool. If I enable
Device Drivers → SPI hardware bus support → nRF SPI nrfx drivers → SPI Port 1 Driver type → nRF SPIS 1, I got errors as attached in error_spi_slave.txt

The symbols it mentioned are defined in an autogenerated .h, that seems to be ignored somehow.

Do you know what's going on?

Regards,
Riccardo

2201 - 2220 of 8046