Date   

API meeting: agenda

Carles Cufi
 

Hi all,

*************************************************
We will be using Teams instead of Zoom:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_YzYzZTAzNGItOWFiMS00MDBkLTkyYmMtNzljZjkwNDVlMThm%40thread.v2/0?context=%7b%22Tid%22%3a%22686ea1d3-bc2b-4c6f-a92c-d99c5c301635%22%2c%22Oid%22%3a%2262b63b80-05d3-4465-b5a0-f04e4e156f10%22%7d
*************************************************

Today's topics:

- RFC: use compatible name for prefix for device-specific API
- PR: https://github.com/zephyrproject-rtos/zephyr/issues/24978

- RTC API follow-up (if the relevant people are present and there is material for discussion)
- PR: https://github.com/zephyrproject-rtos/zephyr/pull/23526

- Documenting API behavior in Doxygen:
- Issue: https://github.com/zephyrproject-rtos/zephyr/issues/18970
- Issue: https://github.com/zephyrproject-rtos/zephyr/issues/21061

Additional items in the "Triage" column in the GitHub project may be discussed if time permits.
If you want an item included in the meeting, please add it to the GitHub project.

https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-api-discussion
https://github.com/zephyrproject-rtos/zephyr/projects/18
https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit

Regards,

Carles


Re: samples/basic/blinky

Lawrence King
 

Hi Patrice:

 

Your statement that the behavior of the LED is ‘inverted’ is completely correct.

 

Your statement about the current is at best confusing. It is true that the GPIO doesn’t need to ‘source’ the current to turn the LED, but the GPIO does need to ‘sink’ the current. The amount of current flowing either into or out of the GPIO will be same no matter how the LED and resistor are connected. The reason we electrical engineers always choose to have the GPIO ‘sink’ the current is purely historical.

 

In the dark ages when we used +5V TTL logic (example 74LS04), the outputs of a logic gate could only source a small amount of current typically 6mA, and could sink a larger amount of current, typically 18mA. The LEDs available at the time needed at least 10mA to light up (and even at 10mA were not very bright), hence we were forced to use the sink capabilities of the gate to connect a LED to an output.

 

For no good reason we have continued with this convention, current generation LEDs are very bright with only 2mA of current, and current logic gates are symmetric drive which can source or sink 10mA or even 20mA. There is no good reason to have the logic ‘inverted’ other than historical convention.

 

I haven’t tried out all of the features of the new GPIO functions yet, but I think you can setup a GPIO to be “GPIO_ACTIVE_LOW” when calling gpio_pin_configure() and then drive the pin to GPIO_OUTPUT_ACTIVE when calling gpio_pin_set(), I believe this should turn the LED on.

 

Lawrence King

Principal Developer

+1(416)627-7302

 

From: users@... <users@...> On Behalf Of patrice.gerin via lists.zephyrproject.org
Sent: Monday, May 4, 2020 3:41 AM
To: users@...
Subject: Re: [Zephyr-users] samples/basic/blinky

 

Hellor Tristen,

The behavior of your LED seems normal!
In embedded design, LED are usually and voluntary inverted. Doing this will avoid the GPIO pin to provide the current by itself, the LED current will be supplied by the power directly.
                led       resistor
VCC |------|>|-----^v^v^v----------< GPIO |
If GPIO is set => no current
if GPIO is unset => current from VCC to the GPIO, no current provided by the stm32!
The LED is "active low".
Patrice


Re: samples/basic/blinky

Tristen Ennemuist
 

ah, thank you patrice - and now i've gained an understanding of the reason as well, much appreciated.  


Re: samples/basic/blinky

Tristen Ennemuist
 

heya nik thank you for responding, thankfully the schematics are available for download so i'll take a look and see what i can learn.

whew i've done plenty of programming on linux but i've never had to understand anything at this level, so thank you again for taking the time to help me out.


Network forum agenda

Jukka Rissanen
 

Hi all,

There is a network forum meeting tomorrow 5 May at 8AM PDT / 17.00 CET.

We will be using Teams instead of Zoom:
________________________________________________________________
Join Microsoft Teams Meeting<
https://teams.microsoft.com/l/meetup-join/19%3ameeting_ODE2MzMzZmItYWZjNC00N2E5LThjZjAtNGY3YTJkNDhlYTQw%40thread.v2/0?context=%7b%22Tid%22%3a%22686ea1d3-bc2b-4c6f-a92c-d99c5c301635%22%2c%22Oid%22%3a%2262b63b80-05d3-4465-b5a0-f04e4e156f10%22%7d
+1 213-437-3346<tel:+1%20213-437-3346,,335898965#> United States, Los
Angeles (Toll)
Conference ID: 335 898 965#
Local numbers<
https://dialin.teams.microsoft.com/488d1b50-0dd2-4ca1-aee4-92bb50a48081?id=335898965
| Reset PIN<https://mysettings.lync.com/pstnconferencing> | Learn
more about Teams<https://aka.ms/JoinTeamsMeeting> | Meeting options<
https://teams.microsoft.com/meetingOptions/?organizerId=62b63b80-05d3-4465-b5a0-f04e4e156f10&tenantId=686ea1d3-bc2b-4c6f-a92c-d99c5c301635&threadId=19_meeting_ODE2MzMzZmItYWZjNC00N2E5LThjZjAtNGY3YTJkNDhlYTQw@...&messageId=0&language=en-US
________________________________________________________________

Preliminary agenda:

* TCP2 status
* User mode networking

If you have anything you want to discuss, please let me know.


Cheers,
Jukka


Re: samples/basic/blinky

patrice.gerin@...
 

Hellor Tristen,

The behavior of your LED seems normal!
In embedded design, LED are usually and voluntary inverted. Doing this will avoid the GPIO pin to provide the current by itself, the LED current will be supplied by the power directly.
                led       resistor
VCC |------|>|-----^v^v^v----------< GPIO |
If GPIO is set => no current
if GPIO is unset => current from VCC to the GPIO, no current provided by the stm32!
The LED is "active low".
Patrice


samples/basic/blinky

Tristen Ennemuist
 

hello, i am [slowly] working my way through the examples, and i am a bit confused with the blinky sample project.

it seems that when 0 (zero) is written using gpio_pin_set then the LED on my board lights up and when 1 (one) is written the LED turns off. this is the opposite of what i was expecting,

however i am completely new to embedded development so i must apologise in embarrassment if it is my expectation that is the opposite!

ok, with the code:

i increased SLEEP_TIME_MS to 10000 so i could be sure there wasn't a timing issue on the output and i added the if/printk block to the while loop, and sure enough writing a zero results in led on and writing a one results in led off.

ie: the led is unlit and "led is now on", the led is lit and "led is now off".

my board is the stm32f469i_disco and i'm developing on fedora, below is the modified while loop, any feedback/advice would be much appreciated, thank you.

 while (1) {
gpio_pin_set(dev, PIN, (int)led_is_on);

if (led_is_on)
{
printk("led is now on\n");
}
else
{
printk("led is now off\n");
}

led_is_on = !led_is_on;
k_sleep(SLEEP_TIME_MS);
}  


Using device's HW crypto module with zephyr OS #nrf52-pca10040 #crypto

mdl.mailme@...
 

Hi,

I tried figuring out how to use the HW AES module on my device (nrf52 dk) with zephyr OS, but I didn't find any example and didn't manage to understand the crypto API and how to use it. I would like to have a minimal example of a working AES encryption in CCM mode. What Kconfig options do I have to set? Which crypto library do I have to use? Which variables do I have to set and which functions do I have to call?

Thanks in advance and regards,

Marco Liess


Test-related labels on GitHub

Carles Cufi
 

Hi all,

I have tried to clean up the test-related labels on GitHub, performing the following changes:

- "Testing" has been removed
- "Testing Suite" has been renamed to "Test Framework" and should be used for issues that are related to either the framework or missing platforms (eg. a new target on QEMU, an issue that affects multiple individual tests)
- "Tests" should be used for issues related to specific tests
- "Sanitycheck" should be used for issues related to the sanitycheck Python script

Additional labels, such as "Bug" or the relevant architecture(s) should be used to complement the information provided by the Test-related ones.

I have tried to go through all test-related issues and re-label them as appropriate.
Please use the new labels as described.

Thanks,

Carles


[2.3 release] Feature merge window close (M2) next week

Carles Cufi
 

Hi all,

This is just a reminder that the feature merge window close is on the 8th of May.
This means that any changes that are not bugfixes or documentation changes must be merged by then.

See the full timeline for the 2.3 release here:
https://github.com/zephyrproject-rtos/zephyr/wiki/Program-Management#actual-and-planned-milestone-dates

Thanks,

Carles


Re: Connect two Zephyr instances via zeth interface

Jukka Rissanen
 

Hi Lei,

see this example how to setup Linux host in this kind of setup
https://github.com/zephyrproject-rtos/zephyr/issues/24282

Cheers,
Jukka

On Tue, 2020-04-28 at 17:19 +0200, Lei Xu wrote:
Hi,

I'm implementing two zephyr projects in the same host, which will
communicate with each other. Then I found the sample code
https://docs.zephyrproject.org/latest/samples/net/eth_native_posix/README.html
, which shows how to setup two zephyr instances that can communicate
via the created zeth interfaces. I have tried exactly what the
instruction writes, but it doesn't work when I tried to ping the
device in the net-shell. So, could you give me some tips, should I
configure anything else in my host? Or may be some necessaries that
are missed in the instruction?

Also, as an alternative method, I tried to run net-setup.sh script
and create a zeth interfaces, in which several IP addresses are
added. My question is: is that possible for the zephyr project
directly to set the created zeth as the default interface? So that
zephyr project can directly use the added IP address.

Looking forward for your reply. Thank you!



Kind regards,

Lei


Connect two Zephyr instances via zeth interface

Lei Xu <lei.xu@...>
 

Hi,

I'm implementing two zephyr projects in the same host, which will communicate with each other. Then I found the sample code https://docs.zephyrproject.org/latest/samples/net/eth_native_posix/README.html, which shows how to setup two zephyr instances that can communicate via the created zeth interfaces. I have tried exactly what the instruction writes, but it doesn't work when I tried to ping the device in the net-shell. So, could you give me some tips, should I configure anything else in my host? Or may be some necessaries that are missed in the instruction?

Also, as an alternative method, I tried to run net-setup.sh script and create a zeth interfaces, in which several IP addresses are added. My question is: is that possible for the zephyr project directly to set the created zeth as the default interface? So that zephyr project can directly use the added IP address.

Looking forward for your reply. Thank you!


Kind regards,

Lei


API meeting: agenda

Carles Cufi
 

Hi all,

*************************************************
We will be using Teams instead of Zoom:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_YzYzZTAzNGItOWFiMS00MDBkLTkyYmMtNzljZjkwNDVlMThm%40thread.v2/0?context=%7b%22Tid%22%3a%22686ea1d3-bc2b-4c6f-a92c-d99c5c301635%22%2c%22Oid%22%3a%2262b63b80-05d3-4465-b5a0-f04e4e156f10%22%7d
*************************************************

Tomorrow's topics:

- Disabling a PWM signal:
- PR: https://github.com/zephyrproject-rtos/zephyr/pull/24724

- RTC API follow-up (if the relevant people are present)
- PR: https://github.com/zephyrproject-rtos/zephyr/pull/23526

- Documenting API behavior in Doxygen:
- Issue: https://github.com/zephyrproject-rtos/zephyr/issues/18970
- Issue: https://github.com/zephyrproject-rtos/zephyr/issues/21061

- clock_control extension to gather feedback
- PR: https://github.com/zephyrproject-rtos/zephyr/pull/24334

Additional items in the "Triage" column in the GitHub project may be discussed if time permits.
If you want an item included in the meeting, please add it to the GitHub project.

https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-api-discussion
https://github.com/zephyrproject-rtos/zephyr/projects/18
https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit

Regards,

Carles


Re: std::map where type of key is struct #std

leonardomt@...
 

Hi all again,

To fix this issue I only had to add CONFIG_LIB_CPLUSPLUS=y to my prj.conf file.

Thanks pabigot !
Leo


std::map where type of key is struct #std

leonardomt@...
 

Hello all,
I am trying to create an std::map where type of key is struct and I provide my own comparator.
The code compiles/executes correctly with g++ (click on links below) outside of the Zephyr environment but fails otherwise.
Am I missing some CONFIG_ statements in prj.conf? How do I fix this issue?
Thanks,
Leo

All of these work with g++:
    User-defined comparator:
        http://cpp.sh/8esou

    Template specialization:
        http://cpp.sh/7cslu

    Operator overloading:
        http://cpp.sh/4r3yw

None of the above work with Zephyr:
    main.cpp (user-defined comparator):
        #include <sys/printk.h>
        #include <map>
       
        struct Data {
            int index;
        };
       
        struct Comparator {
            bool operator() (const Data& first, const Data& second) const {
                return first.index < second.index;
            }
        };
       
        int main() {
            std::map<Data, int, Comparator> container;
            container[Data {0}] = 0;
            container[Data {0}] = 1;
            printk("%s\n", container.find(Data {0}) == container.end() ? "not found" : "found");
            return 0;
        }
       
    ZEPHYR_TOOLCHAIN_VARIANT:
        gnuarmemb
       
    gnuarmemb version:
        7-2018-q2-update

    prj.conf:
        CONFIG_NEWLIB_LIBC=y
        CONFIG_PRINTK=y
        CONFIG_STDOUT_CONSOLE=y
        CONFIG_CPLUSPLUS=y
        CONFIG_STD_CPP17=y
   
    compilation:
        west build -p auto -b nrf52840_pca10056 std_test
       
errors:
************
In function `std::_Rb_tree<Data, std::pair<Data const, int>, std::_Select1st<std::pair<Data const, int> >, Comparator, std::allocator<std::pair<Data const, int> > >::_M_get_insert_unique_pos(Data const&)':
arm-none-eabi/include/c++/7.3.1/bits/stl_tree.h:302: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
app/libapp.a(main.cpp.obj): In function `std::map<Data, int, Comparator, std::allocator<std::pair<Data const, int> > >::operator[](Data&&)':
arm-none-eabi/include/c++/7.3.1/bits/stl_tree.h:2304: undefined reference to `std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
arm-none-eabi/include/c++/7.3.1/bits/stl_tree.h:302: undefined reference to `std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
arm-none-eabi/include/c++/7.3.1/bits/stl_tree.h:287: undefined reference to `std::_Rb_tree_increment(std::_Rb_tree_node_base*)'
collect2.exe: error: ld returned 1 exit status
%
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: 'cmake.EXE' --build 'build'
************


Release Readiness meeting today

Carles Cufi
 

Hi all,

The release readiness meeting today will take place as planned, just using Webex instead of Zoom:

*******************************

NOTE: We will be using Webex for this meeting instead of zoom. The link is here:
https://meetingsemea5.webex.com/meetingsemea5/e.php?MTID=m64daae188a1da10f363b25708426dcb2

*******************************

Additional info:
https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-release-readinessbug-triage

Regards,

Carles


Re: #mqtt Failed to obtain RX buffer #mqtt #api

Jukka Rissanen
 

Hi Erik,

you are running out of RX network buffers. Try to increase the value of
CONFIG_NET_BUF_RX_COUNT
and optionally
CONFIG_NET_PKT_RX_COUNT
options.

Cheers,
Jukka

On Sun, 2020-04-19 at 23:58 -0700, erik.samyn@... wrote:
Hi,

I'm implementing mqtt on an nucleo stm32 board (stm32f767zi). The
communication from the broker seemed to work OK at first, however
when stressing the communication a bit the next error appears
multiple times in the log:
==> "<err> eth_stm32_hal: Failed to obtain RX buffer".

What can be the cause of this?

Kind regards

Erik Samyn


API meeting cancelled today

Carles Cufi
 

Hi all,

I have cancelled the API meeting today due to my lack of availability today. To my knowledge, we did not have any pressing matters to discuss, but as always please let me know or add the issue or PR to the API review/cleanup/rework GitHub project in order to be discussed next week.

Apologies for the short notice.

Regards,

Carles


#mqtt Failed to obtain RX buffer #mqtt #api

erik.samyn@...
 

Hi,

I'm implementing mqtt on an nucleo stm32 board (stm32f767zi). The communication from the broker seemed to work OK at first, however when stressing the communication a bit the next error appears multiple times in the log:
==> "<err> eth_stm32_hal: Failed to obtain RX buffer".

What can be the cause of this?

Kind regards 

Erik Samyn


Re: #api #api

Andy Ross
 

On 4/16/2020 3:20 PM, r.gokool@... wrote:
Hello, I am new to Zephyr. I have a need to write code that runs on both RTOS and linux. It is structured as an event loop that can monitor sockets, local queues and timers for Linux. When looking at the APIs in the RTOS I noticed that there is no common poll API. Isee k_poll() can poll kernel objects while zsock_poll() can poll sockets. Is there a way to monitor sockets and kernel objects using the same event loop?
If not I am curious to understand why the API deviates from Linux. Is there an RTOS specific benefit to splitting the poll api this way?
Mostly for the same sorts of reasons that poll() in Linux can't wait on a POSIX condition variable or futex.

The zsock_poll() implementation is designed to work the way it works on existing Berkley sockets code, and it understands sockets in the network layer. The kernel k_poll() abstraction understands existing kernel objects, which aren't sockets.

That said, it wouldn't be impossible to make these interoperate. The k_poll_event object has a "signal" type which allows arbitrary external code to provide wakeup notifications to threads blocked in k_poll(). Someone could write a constructor for such a k_poll_event in the network layer without too much trouble, I think.

It's possible we could remove the zsock_poll() implementation entirely and replace it with this sort of wrapper around k_poll, actually. But I haven't looked at that implementation and don't know what would be involved or what the costs might be.

Andy