Date   

Re: [RFC] Ring buffers

Mitsis, Peter <Peter.Mitsis@...>
 

It occurs to me that a buffered pipe may be leveraged as a generic ring buffer with concurrency control--though not a light-weight one.

Peter

-----Original Message-----
From: Boie, Andrew P [mailto:andrew.p.boie(a)intel.com]
Sent: September-23-16 4:32 PM
To: devel(a)lists.zephyrproject.org; Korovkin, Dmitriy
Subject: [devel] Re: [RFC] Ring buffers

On Fri, 2016-09-23 at 13:27 -0700, Boie, Andrew P wrote:
NACK, for reasons below.
Just to qualify this -- if you wanted to create a general purpose kernel
object type that builds on what is in ring_buffer.h, I would not be
opposed.

But I want the existing definition left as-is as it is intentionally
lightweight and for scenarios where you have a single producer and single
consumer you don't need extra concurrency control.

Andrew


Re: [RFC] Ring buffers

Boie, Andrew P
 

On Fri, 2016-09-23 at 13:27 -0700, Boie, Andrew P wrote:
NACK, for reasons below.
Just to qualify this -- if you wanted to create a general purpose
kernel object type that builds on what is in ring_buffer.h, I would not
be opposed.

But I want the existing definition left as-is as it is intentionally
lightweight and for scenarios where you have a single producer and
single consumer you don't need extra concurrency control.

Andrew


Re: [RFC] Ring buffers

Boie, Andrew P
 

On Fri, 2016-09-23 at 15:33 -0400, Dmitriy Korovkin wrote:
Colleagues, any comment on this?

In it's current state the ring buffers appear as internal kernel
objects 
used by event loger and ipm console.

The proposal here is to make them kernel objects available for
application 
developers, that includes the following steps:
NACK, for reasons below.


- move the ring buffers declaration to include/kernel.h and chage
routine
The header is currently in misc/ring_buffer.h. This is available to
applications, why do you want to move it?

   names according to the public API naming convention;
Why do you think the names need to be changed?


- pend writing threads for a certain timeout if no space available;

- pend reading threads (with timeout) if the buffer is empty.
No, don't bake this stuff into the basic ring buffer structure. If you
want to implement this kind of protocl you can build on top of the
existing ring buffer code.

It says as much in the documentation:

/**
 * @brief Place an entry into the ring buffer
 *
 * Concurrency control is not implemented, however no synchronization
is needed
 * between put() and get() operations as they independently work on the
 * tail and head values, respectively.
 * Any use-cases involving multiple producers will need to synchronize
use
 * of this function, by either disabling preemption or using a mutex.
 */

There is no one-size-fits-all concurrency model that makes everyone
happy, these considerations are application specific. The fact that
concurrency control is not included is definitely by design.

Andrew


Re: [RFC] Ring buffers

Dmitriy Korovkin
 

On Fri, 23 Sep 2016, Andy Ross wrote:

Korovkin, Dmitriy (Wind River) wrote (on Friday, September 23, 2016 12:33PM):
- move the ring buffers declaration to include/kernel.h and chage routine
names according to the public API naming convention;

- pend writing threads for a certain timeout if no space available;

- pend reading threads (with timeout) if the buffer is empty.
That sounds more like a hybrid between a ring buffer (a data
structure) and a fifo (an IPC mechanism). I think there's value for a
generic buffer for bytewise streamlike data which isn't tied to a
particular idea of syncronization. Maybe split them up and have a
"stream" IPC abstraction that the user can wrap around a ring buffer
they provide?
User can always add a semaphore. Or specify K_NO_WAIT as a timeout value.

/Dmitriy

Andy


Re: [RFC] Ring buffers

Andy Ross
 

Korovkin, Dmitriy (Wind River) wrote (on Friday, September 23, 2016 12:33PM):
- move the ring buffers declaration to include/kernel.h and chage routine
names according to the public API naming convention;

- pend writing threads for a certain timeout if no space available;

- pend reading threads (with timeout) if the buffer is empty.
That sounds more like a hybrid between a ring buffer (a data
structure) and a fifo (an IPC mechanism). I think there's value for a
generic buffer for bytewise streamlike data which isn't tied to a
particular idea of syncronization. Maybe split them up and have a
"stream" IPC abstraction that the user can wrap around a ring buffer
they provide?

Andy


[RFC] Ring buffers

Dmitriy Korovkin
 

Colleagues, any comment on this?

In it's current state the ring buffers appear as internal kernel objects
used by event loger and ipm console.

The proposal here is to make them kernel objects available for application
developers, that includes the following steps:

- move the ring buffers declaration to include/kernel.h and chage routine
names according to the public API naming convention;

- pend writing threads for a certain timeout if no space available;

- pend reading threads (with timeout) if the buffer is empty.

Is there a need for this?

Regards,
Dmitriy Korovkin


Re: Timer utility function to use single timer

Boie, Andrew P
 

On Fri, 2016-09-23 at 09:41 -0700, Andy Ross wrote:
Would anyone object to a patch that set CONFIG_NUM_DYNAMIC_TIMERS to
zero by default and disabled the API unless it was 1 or greater?  Or
maybe deprecating it for future removal?
+1 on deprecation!

Andrew


Re: Timer utility function to use single timer

Andy Ross
 

Korovkin, Dmitriy wrote:
On Fri, 23 Sep 2016, Andy Ross wrote:
Would anyone object to a patch that set CONFIG_NUM_DYNAMIC_TIMERS to
zero by default and disabled the API unless it was 1 or greater? Or
maybe deprecating it for future removal?
I was also thinking on setting this to 0 and save some space.
/Dmitriy
https://gerrit.zephyrproject.org/r/#/c/4954/


Re: Timer utility function to use single timer

Dmitriy Korovkin
 

On Fri, 23 Sep 2016, Andy Ross wrote:

Bag, Amit K wrote:
In Zephyr there will be a chance to run out of timers at times and
we will not get the timer handle to use for our modules.

Means whenever we required a timer for our module we can call a
timer API defined in zephyr
(i.e. *task_timer_alloc(),task_timer_start(),task_timer_stop, etc*)
I'm a little curious about this API design too. AFAICT, it's always
legal to statically allocate a k_timer struct of your own and
initialize and use it at runtime. If you need to know you won't run
out of timers, you can be guaranteed not to lose this one.

The allocate/free API looks like it's just a convenience wrapper to
allow sharing of timer objects between usages if you know they aren't
all going to be needed simultaneously.

The problem though, is that to get this facility Zephyr allocates 10
(by default) k_timer objects in a pool and shares only those.
Obviously Zephyr has no heap, so it can't share the memory as anything
but timers. And these aren't tiny objects. My quick manual count
says that they're 64 bytes a piece, so that's half a kb of RAM that
we're allocating in every default-configured app just to save a
handful of bytes in apps that want to use the "sharing" convenience
API. That seems like a bad trade to me.

Would anyone object to a patch that set CONFIG_NUM_DYNAMIC_TIMERS to
zero by default and disabled the API unless it was 1 or greater? Or
maybe deprecating it for future removal?
I was also thinking on setting this to 0 and save some space.
/Dmitriy

Andy


Re: RFC: Initializing and placement of thread/fiber/task stacks

Mitsis, Peter <Peter.Mitsis@...>
 

Apparently redefining '__stack' for both a thread's stack alignment and stack section placement will not work as we have many instances where those stacks are embedded within other structures.

Thus, I would like to modify the original proposal to the following:


1. Introduce a new tag (__stack_section) that will put thread stacks into the appropriate linker section. If CONFIG_INIT_STACKS is enabled, this stack section will be initialized to 0xaa's at boot time.

2. Rename the existing '__stack' tag to '__stack_align'. This is to make it clear that the tag is strictly for ensuring proper alignment, and that it does not become confused with '__stack_section'.

3. Update the thread initialization code to initialize its stack to 0xaa's only if ...

a. CONFIG_INIT_STACKS is enabled

b. AND the stack is not in the stack section (for when the stack is embedded in another structure).

Thoughts, comments, objections?

Peter Mitsis

From: Mitsis, Peter [mailto:Peter.Mitsis(a)windriver.com]
Sent: September-21-16 4:21 PM
To: devel(a)lists.zephyrproject.org
Subject: [devel] RFC: Initializing and placement of thread/fiber/task stacks

Any objections/comments to the following?

Thread stacks (as defined by the __stack attribute) should be placed into their own section. By default this section should be a part of the .noinit section so that they do not impact run time performance. However, if the Kconfig option INIT_STACKS is enabled, then the stacks should be placed into their own unique section and their stack space should be initialized at boot time to a known value (0xaa).

Although this will result in a longer boot time (when INIT_STACKS) is enabled, it means that aside from the potential boot time penalty, there is never a stack initialization run time penalty when creating a thread. This may be particularly beneficial should a thread be restarted or thread-space be reused as the stack will not be re-initialized. Note that this changes the semantics of thread stack usage to mean thread stack usage for all threads that use that stack.

Peter Mitsis


Re: Timer utility function to use single timer

Andy Ross
 

Bag, Amit K wrote:
In Zephyr there will be a chance to run out of timers at times and
we will not get the timer handle to use for our modules.

Means whenever we required a timer for our module we can call a
timer API defined in zephyr
(i.e. *task_timer_alloc(),task_timer_start(),task_timer_stop, etc*)
I'm a little curious about this API design too. AFAICT, it's always
legal to statically allocate a k_timer struct of your own and
initialize and use it at runtime. If you need to know you won't run
out of timers, you can be guaranteed not to lose this one.

The allocate/free API looks like it's just a convenience wrapper to
allow sharing of timer objects between usages if you know they aren't
all going to be needed simultaneously.

The problem though, is that to get this facility Zephyr allocates 10
(by default) k_timer objects in a pool and shares only those.
Obviously Zephyr has no heap, so it can't share the memory as anything
but timers. And these aren't tiny objects. My quick manual count
says that they're 64 bytes a piece, so that's half a kb of RAM that
we're allocating in every default-configured app just to save a
handful of bytes in apps that want to use the "sharing" convenience
API. That seems like a bad trade to me.

Would anyone object to a patch that set CONFIG_NUM_DYNAMIC_TIMERS to
zero by default and disabled the API unless it was 1 or greater? Or
maybe deprecating it for future removal?

Andy


Re: RFC: Thread abort handler in unified kernel

Andy Ross
 

Dmitriy Korovkin wrote:
Zephyr microkernel tasks allow user to set the task abort handler by
invoking task_abort_handler_set(). The abort handler is executed by
microkernel server fiber when it aborts the task.

As moving to unified kernel, it may be a good time to decide if this
functionality is needed in the future (for now it is needed for
compatibility, of course).
What's the use case? We don't really have a working exception/longjmp
framework that could clean up things after a stack unwind, so what
value is an "abort handler" going to provide anyway? A quick grep
says that we don't even have a test case for this (it gets linked in
explicitly by the footprint test, but never called).

I agree we should junk it on general principle.

Andy


Daily JIRA Digest

donotreply@...
 

NEW JIRA items within last 24 hours: 5
[ZEP-957] Create example sample for new unified kernel API usage
https://jira.zephyrproject.org/browse/ZEP-957

[ZEP-958] simplify pinmux interface and merge the so-called pinmux dev into one single API
https://jira.zephyrproject.org/browse/ZEP-958

[ZEP-960] improve accuracy of sanitycheck size calculations
https://jira.zephyrproject.org/browse/ZEP-960

[ZEP-959] sync checkpatch.pl with upstream Linux
https://jira.zephyrproject.org/browse/ZEP-959

[ZEP-956] SDK's qemu tries to access files in /opt/zephyr-sdk, even when installed somewhere else
https://jira.zephyrproject.org/browse/ZEP-956


UPDATED JIRA items within last 24 hours: 20
[ZEP-812] Compression Format for IPv6 over 802.15.4
https://jira.zephyrproject.org/browse/ZEP-812

[ZEP-813] RPL: IPv6 Routing Protocol
https://jira.zephyrproject.org/browse/ZEP-813

[ZEP-885] 802.15.4 - Beacon frame support
https://jira.zephyrproject.org/browse/ZEP-885

[ZEP-804] IPv6 Addressing Architecture
https://jira.zephyrproject.org/browse/ZEP-804

[ZEP-794] Requirements for Internet Hosts - Communication Layers
https://jira.zephyrproject.org/browse/ZEP-794

[ZEP-859] Migrate ENC28J60 driver to YAIP IP stack
https://jira.zephyrproject.org/browse/ZEP-859

[ZEP-910] Adapt tickless idle for x86
https://jira.zephyrproject.org/browse/ZEP-910

[ZEP-924] Revise documentation for Interrupts
https://jira.zephyrproject.org/browse/ZEP-924

[ZEP-923] Revise documentation for Timing
https://jira.zephyrproject.org/browse/ZEP-923

[ZEP-909] Adapt tickless idle + power management for ARM
https://jira.zephyrproject.org/browse/ZEP-909

[ZEP-875] 6LoWPAN - Context based compression support
https://jira.zephyrproject.org/browse/ZEP-875

[ZEP-884] 802.15.4 - CSMA-CA Radio protocol support
https://jira.zephyrproject.org/browse/ZEP-884

[ZEP-917] Add abort handler support
https://jira.zephyrproject.org/browse/ZEP-917

[ZEP-918] Add ring buffer support
https://jira.zephyrproject.org/browse/ZEP-918

[ZEP-954] Update device PM API to allow setting additional power states
https://jira.zephyrproject.org/browse/ZEP-954

[ZEP-913] Place thread stacks in their own linker section
https://jira.zephyrproject.org/browse/ZEP-913

[ZEP-950] USB: Device is not listed by USB20CV test suite
https://jira.zephyrproject.org/browse/ZEP-950

[ZEP-724] build on windows failed: 'make: execvp: uname: File or path name too long'
https://jira.zephyrproject.org/browse/ZEP-724

[ZEP-940] Fail to get ATT response
https://jira.zephyrproject.org/browse/ZEP-940

[ZEP-539] Jenkins marks patches -1 verified for style issues
https://jira.zephyrproject.org/browse/ZEP-539


CLOSED JIRA items within last 24 hours: 0

RESOLVED JIRA items within last 24 hours: 5
[ZEP-907] (Fixed) Test memory pool support (with mailboxes)
https://jira.zephyrproject.org/browse/ZEP-907

[ZEP-908] (Fixed) Add task offload to fiber support
https://jira.zephyrproject.org/browse/ZEP-908

[ZEP-850] (Fixed) remove obsolete boards basic_minuteia and basic_cortex_m3
https://jira.zephyrproject.org/browse/ZEP-850

[ZEP-844] (Fixed) flashing "arduino_101_sss" build onto Arduino 101 breaks DFU
https://jira.zephyrproject.org/browse/ZEP-844

[ZEP-867] (Fixed) misuse of "select" in SOC/board Kconfigs
https://jira.zephyrproject.org/browse/ZEP-867


Daily Gerrit Digest

donotreply@...
 

NEW within last 24 hours:
- https://gerrit.zephyrproject.org/r/4946 : Bluetooth: RFCOMM: Shuffle up Kconfig's RFCOMM_L2CAP_MTU
- https://gerrit.zephyrproject.org/r/4931 : x86 link: Specify ALIGN_WITH_INPUT for XIP data sections
- https://gerrit.zephyrproject.org/r/4950 : Bluetooth: Add debug keys support to HCI ECC emulation code
- https://gerrit.zephyrproject.org/r/4949 : Bluetooth: SMP: Fix unused static variable
- https://gerrit.zephyrproject.org/r/4948 : Bluetooth: SMP: Remove unused static const
- https://gerrit.zephyrproject.org/r/4943 : Bluetooth: L2CAP: Cleanup flags names for BR/EDR channels
- https://gerrit.zephyrproject.org/r/4945 : net: yaip: Fix handling onlink prefix
- https://gerrit.zephyrproject.org/r/4944 : net: yaip: Fix handling ra_neighbor
- https://gerrit.zephyrproject.org/r/4941 : net: yaip: Fix link address length calculation
- https://gerrit.zephyrproject.org/r/4942 : net: yaip: Fix creating neighbour without l2addr
- https://gerrit.zephyrproject.org/r/4937 : net: yaip: Improve net_context_connect documentation
- https://gerrit.zephyrproject.org/r/4935 : net: yaip: cc2520: Let's provide ll addr in LE already
- https://gerrit.zephyrproject.org/r/4934 : Bluetooth: A2DP: Added Disconnect API
- https://gerrit.zephyrproject.org/r/4933 : pwm: qmsi_shim: implement pwm driver required by new APIs
- https://gerrit.zephyrproject.org/r/4930 : link: Add section size validity checker
- https://gerrit.zephyrproject.org/r/4929 : apic: set initial PM state at build time
- https://gerrit.zephyrproject.org/r/4924 : ioapic: make init-time RTE masking optional
- https://gerrit.zephyrproject.org/r/4927 : init.h: use a counter when namig system devices
- https://gerrit.zephyrproject.org/r/4920 : lib: Add HTTP support for Zephyr
- https://gerrit.zephyrproject.org/r/4928 : kernel: remove lingering irq_connect_dynamic() references
- https://gerrit.zephyrproject.org/r/4926 : unified: Remove check in _reschedule_threads()
- https://gerrit.zephyrproject.org/r/4921 : lib/http: Add test-case for HTTP header fields

UPDATED within last 24 hours:
- https://gerrit.zephyrproject.org/r/4872 : DO NOT MERGE: k_poll: asynchronous I/O framework
- https://gerrit.zephyrproject.org/r/4916 : net: yaip: Fix copying incorrect byte order address field
- https://gerrit.zephyrproject.org/r/4897 : x86 link: Specify ALIGN_WITH_INPUT for XIP data sections
- https://gerrit.zephyrproject.org/r/4919 : Bluetooth: Controller: Use net_buf for evt and ACL RX
- https://gerrit.zephyrproject.org/r/4881 : nano_work: Don't assert if work is pending on submit
- https://gerrit.zephyrproject.org/r/4908 : Bluetooth: A2DP: Added Connect API
- https://gerrit.zephyrproject.org/r/3311 : include/crypto: Crypto abstraction header
- https://gerrit.zephyrproject.org/r/4858 : drivers: pwm: re-design pwm API interfaces
- https://gerrit.zephyrproject.org/r/4706 : net: fix a potential refcount leak of SYN buffers
- https://gerrit.zephyrproject.org/r/3313 : samples/drivers/crypto: crypto sample app
- https://gerrit.zephyrproject.org/r/3312 : drivers/crypto: TinyCrypt shim driver
- https://gerrit.zephyrproject.org/r/4845 : NO MERGE: WIP: draft app
- https://gerrit.zephyrproject.org/r/4846 : doc: FIFO API uses first 32 bits of data items
- https://gerrit.zephyrproject.org/r/4918 : DO NOT MERGE tests/zoap: Convert tests to the new network stack
- https://gerrit.zephyrproject.org/r/4917 : DO NOT MERGE iot/zoap: Port to the new network stack
- https://gerrit.zephyrproject.org/r/4869 : unified: Add legacy task_offload_to_fiber() routine
- https://gerrit.zephyrproject.org/r/4870 : unified: Make test_pend unified capable.
- https://gerrit.zephyrproject.org/r/4893 : unified: Build kernel objects as a static library
- https://gerrit.zephyrproject.org/r/4892 : unified: Invoke kernel object initialization with SYS_INIT macro
- https://gerrit.zephyrproject.org/r/4891 : unified: Add initialization priority level for kernel objects
- https://gerrit.zephyrproject.org/r/4282 : net: fetch valid conn. to determine MSS in data_is_sent_and_acked()
- https://gerrit.zephyrproject.org/r/4867 : unified: Eliminate useless check in idle thread
- https://gerrit.zephyrproject.org/r/4866 : unified: Remove unused _nano_get_earliest_deadline()
- https://gerrit.zephyrproject.org/r/4865 : unified: Remove #if 0 code block from wait_q.h
- https://gerrit.zephyrproject.org/r/4864 : unified: Remove obsolete wait_q.h macros
- https://gerrit.zephyrproject.org/r/4863 : unified: Remove references to obsolete task_timeout
- https://gerrit.zephyrproject.org/r/4862 : unified: Replace _nano_get_earliest_deadline()
- https://gerrit.zephyrproject.org/r/4880 : nano_work: Add nano_work_pending
- https://gerrit.zephyrproject.org/r/4489 : Bluetooth: SDP: Server: Support ServiceAttrReq and ServiceSearchAttrReq
- https://gerrit.zephyrproject.org/r/4488 : Bluetooth: SDP: Server: Support ServiceSearchRequest
- https://gerrit.zephyrproject.org/r/4894 : unified: move basic ticks-to-ms conversion to kernel.h
- https://gerrit.zephyrproject.org/r/4895 : unified: implement k_uptime_{get,delta}()
- https://gerrit.zephyrproject.org/r/4896 : Dining philosophers demo for unified kernel.
- https://gerrit.zephyrproject.org/r/4487 : Bluetooth: SDP: Server: Support service record registration
- https://gerrit.zephyrproject.org/r/4486 : Bluetooth: SDP: Server: Initialize and accept incoming connections
- https://gerrit.zephyrproject.org/r/4855 : win-doc: Adds the dependency with the pthread library
- https://gerrit.zephyrproject.org/r/4844 : win-doc: Add recommendation for regex library configuration
- https://gerrit.zephyrproject.org/r/4871 : util.h: Add DEFINED() macro for expresion-legal ifdef-checking

MERGED within last 24 hours:
- https://gerrit.zephyrproject.org/r/4947 : Revert "rfc: ksdk: Add KSDK ENET driver."
- https://gerrit.zephyrproject.org/r/4940 : net: yaip: Remove multiple declarations of net_ipv6_start_rs
- https://gerrit.zephyrproject.org/r/4938 : net: yaip: Íncorrectly named function in net_if.c
- https://gerrit.zephyrproject.org/r/4923 : Bluetooth: GATT: Fix locking RX fiber
- https://gerrit.zephyrproject.org/r/4925 : boards: arduino_101: remove backup/restore scripts
- https://gerrit.zephyrproject.org/r/4922 : drivers: serial: uart_qmsi: update Quark SE C1000 config
- https://gerrit.zephyrproject.org/r/4446 : rfc: ksdk: Add KSDK ENET driver.
- https://gerrit.zephyrproject.org/r/4884 : Bluetooth: Controller: Use net_buf for CC/CS TX
- https://gerrit.zephyrproject.org/r/4445 : ksdk: Build ksdk fsl_enet.c and fsl_phy.c
- https://gerrit.zephyrproject.org/r/4478 : fs: Adds file system API to get volume statistics
- https://gerrit.zephyrproject.org/r/4480 : fs: Add file system API to flush cache of an open file
- https://gerrit.zephyrproject.org/r/4372 : fs: Adds file system API to grow or shrink a file
- https://gerrit.zephyrproject.org/r/4485 : sample: fs: Add tests for fs_truncate and fs_statvfs
- https://gerrit.zephyrproject.org/r/4899 : boards: remove obsolete board basic_cortex_m3
- https://gerrit.zephyrproject.org/r/4900 : boards: remove obsolete board basic_minuteia
- https://gerrit.zephyrproject.org/r/4878 : test_mem_safe: fix breakage in unified kernel
- https://gerrit.zephyrproject.org/r/4800 : unified: fix some leftover K_<obj>_DEFINE macros
- https://gerrit.zephyrproject.org/r/4879 : unified: change signature of k_sem_reset()
- https://gerrit.zephyrproject.org/r/4887 : arm: merge Cortex-M3/M4 memory map into master Cortex-M memory map
- https://gerrit.zephyrproject.org/r/4877 : kernel: Fix for k_sem where counter is a unsigned int
- https://gerrit.zephyrproject.org/r/4905 : net: yaip: Add nbuf APIs to read/write across multiple fragments
- https://gerrit.zephyrproject.org/r/4906 : net: yaip: Add unit tests for new nbuf API's
- https://gerrit.zephyrproject.org/r/4907 : net: yaip: Adopt new nbuf API's to dhcpv4 message handlers.
- https://gerrit.zephyrproject.org/r/4904 : net: yaip: Fix distant address setting


Timer utility function to use single timer

Bag, Amit K <amit.k.bag@...>
 

Hi All,

In Zephyr there will be a chance to run out of timers at times and we will not get the timer handle to use for our modules.
Means whenever we required a timer for our module we can call a timer API defined in zephyr (i.e. task_timer_alloc(),task_timer_start(),task_timer_stop, etc )
or we need to have a pool of timer handle at the time of initialization so that we can use one of them from the pool when we need it.
Is there such a utility function already available. In case of multiple task are calling timer function and the OS is running out of timer to satisfy all the timer calls how this is handled in Zephyr OS.



Thanks & Regards,
Amit Bag


RFC: Thread abort handler in unified kernel

Dmitriy Korovkin
 

Any comment on this?

Zephyr microkernel tasks allow user to set the task abort handler by
invoking task_abort_handler_set(). The abort handler is executed by
microkernel server fiber when it aborts the task.

As moving to unified kernel, it may be a good time to decide if this
functionality is needed in the future (for now it is needed for
compatibility, of course).

Regards,

Dmitriy Korovkin


Daily JIRA Digest

donotreply@...
 

NEW JIRA items within last 24 hours: 1
[ZEP-955] Section misalignment
https://jira.zephyrproject.org/browse/ZEP-955


UPDATED JIRA items within last 24 hours: 11
[ZEP-883] IP Stack L2 Interface Management API
https://jira.zephyrproject.org/browse/ZEP-883

[ZEP-798] IPv6
https://jira.zephyrproject.org/browse/ZEP-798

[ZEP-809] IPv6 over 802.15.4
https://jira.zephyrproject.org/browse/ZEP-809

[ZEP-805] Internet Control Message Protocol (ICMP) v6
https://jira.zephyrproject.org/browse/ZEP-805

[ZEP-745] Revisit design of PWM Driver API
https://jira.zephyrproject.org/browse/ZEP-745

[ZEP-792] ARP
https://jira.zephyrproject.org/browse/ZEP-792

[ZEP-648] New CoAP Implementation
https://jira.zephyrproject.org/browse/ZEP-648

[ZEP-796] DHCPv4
https://jira.zephyrproject.org/browse/ZEP-796

[ZEP-365] Zephyr's MQTT library
https://jira.zephyrproject.org/browse/ZEP-365

[ZEP-847] IoT protocol functionality must be moved from samples to lib/iot
https://jira.zephyrproject.org/browse/ZEP-847

[ZEP-842] Create a sample application for ENC28J60
https://jira.zephyrproject.org/browse/ZEP-842


CLOSED JIRA items within last 24 hours: 6
[ZEP-405] (Duplicate) aaD, I want to be able to build my existing code which uses assert.h on Zephyr
https://jira.zephyrproject.org/browse/ZEP-405

[ZEP-614] (Fixed) Port tinycrypt 2.0 test cases to Zephyr
https://jira.zephyrproject.org/browse/ZEP-614

[ZEP-901] (Duplicate) Test
https://jira.zephyrproject.org/browse/ZEP-901

[ZEP-555] (Cannot Reproduce) correct libgcc not getting linked for CONFIG_FLOAT=y on ARM
https://jira.zephyrproject.org/browse/ZEP-555

[ZEP-871] (Won't Do) cannot find -lgcc when build qemu_x86 with issm toolchain
https://jira.zephyrproject.org/browse/ZEP-871

[ZEP-698] (Fixed) samples/task_profiler issues
https://jira.zephyrproject.org/browse/ZEP-698


RESOLVED JIRA items within last 24 hours: 2
[ZEP-750] (Fixed) Arduino 101 board should support one configuration using original bootloader
https://jira.zephyrproject.org/browse/ZEP-750

[ZEP-606] (Fixed) Doc files deleted from gerrit aren't deleted from website
https://jira.zephyrproject.org/browse/ZEP-606


Daily Gerrit Digest

donotreply@...
 

NEW within last 24 hours:
- https://gerrit.zephyrproject.org/r/4915 : build: Support for integrating third party build systems
- https://gerrit.zephyrproject.org/r/4919 : Bluetooth: Controller: Use net_buf for evt and ACL RX
- https://gerrit.zephyrproject.org/r/4907 : net: yaip: Adopt new nbuf API's to dhcpv4 message handlers.
- https://gerrit.zephyrproject.org/r/4906 : net: yaip: Add unit tests for new nbuf API's
- https://gerrit.zephyrproject.org/r/4918 : DO NOT MERGE tests/zoap: Convert tests to the new network stack
- https://gerrit.zephyrproject.org/r/4917 : DO NOT MERGE iot/zoap: Port to the new network stack
- https://gerrit.zephyrproject.org/r/4916 : net: yaip: Fix copying incorrect byte order address field
- https://gerrit.zephyrproject.org/r/4904 : net: yaip: Fix distant address setting
- https://gerrit.zephyrproject.org/r/4905 : net: yaip: Add nbuf APIs to read/write across multiple fragments
- https://gerrit.zephyrproject.org/r/4887 : arm: merge Cortex-M3/M4 memory map into master Cortex-M memory map
- https://gerrit.zephyrproject.org/r/4901 : Bluetooth: AVDTP: Connect and Disconnect API
- https://gerrit.zephyrproject.org/r/4908 : Bluetooth: A2DP: Added Connect API
- https://gerrit.zephyrproject.org/r/4884 : Bluetooth: Controller: Use net_buf for CC/CS TX
- https://gerrit.zephyrproject.org/r/4903 : net/yaip: Remove unneeded sections for nbr and ll
- https://gerrit.zephyrproject.org/r/4900 : boards: remove obsolete board basic_minuteia
- https://gerrit.zephyrproject.org/r/4899 : boards: remove obsolete board basic_cortex_m3
- https://gerrit.zephyrproject.org/r/4898 : drivers: shared irq: clean nested #if condition and align
- https://gerrit.zephyrproject.org/r/4897 : x86 link: Specify ALIGN_WITH_INPUT for XIP data sections
- https://gerrit.zephyrproject.org/r/4896 : Dining philosophers demo for unified kernel.
- https://gerrit.zephyrproject.org/r/4895 : unified: implement k_uptime_{get,delta}()
- https://gerrit.zephyrproject.org/r/4894 : unified: move basic ticks-to-ms conversion to kernel.h
- https://gerrit.zephyrproject.org/r/4892 : unified: Invoke kernel object initialization with SYS_INIT macro
- https://gerrit.zephyrproject.org/r/4893 : unified: Build kernel objects as a static library
- https://gerrit.zephyrproject.org/r/4889 : unified: Add tickless idle support for ARM
- https://gerrit.zephyrproject.org/r/4890 : unified: Enable tickless idle test
- https://gerrit.zephyrproject.org/r/4891 : unified: Add initialization priority level for kernel objects

UPDATED within last 24 hours:
- https://gerrit.zephyrproject.org/r/4485 : sample: fs: Add tests for fs_truncate and fs_statvfs
- https://gerrit.zephyrproject.org/r/4372 : fs: Adds file system API to grow or shrink a file
- https://gerrit.zephyrproject.org/r/4649 : net: tests: Add TCP unit tests
- https://gerrit.zephyrproject.org/r/4648 : net: yaip: Initial TCP commit
- https://gerrit.zephyrproject.org/r/4580 : net: yaip: Special handling for net_if for Quark SE devboard
- https://gerrit.zephyrproject.org/r/4321 : Bluetooth: BR/EDR: Refactor distribution of security procedure status
- https://gerrit.zephyrproject.org/r/3312 : drivers/crypto: TinyCrypt shim driver
- https://gerrit.zephyrproject.org/r/3313 : samples/drivers/crypto: crypto sample app
- https://gerrit.zephyrproject.org/r/4871 : util.h: Add DEFINED() macro for expresion-legal ifdef-checking
- https://gerrit.zephyrproject.org/r/4874 : Bluetooth: RFCOMM: Handle dlc disconnection from peer
- https://gerrit.zephyrproject.org/r/4480 : fs: Add file system API to flush cache of an open file
- https://gerrit.zephyrproject.org/r/4478 : fs: Adds file system API to get volume statistics
- https://gerrit.zephyrproject.org/r/3311 : include/crypto: Crypto abstraction header
- https://gerrit.zephyrproject.org/r/4819 : tests/zoap: Add tests for the observe feature
- https://gerrit.zephyrproject.org/r/4818 : iot/zoap: Add helpers for dealing with integer options
- https://gerrit.zephyrproject.org/r/4816 : iot/zoap: Add support for observing resources
- https://gerrit.zephyrproject.org/r/4817 : iot/zoap: Add port information to network addresses
- https://gerrit.zephyrproject.org/r/4858 : drivers: pwm: re-design pwm API interfaces
- https://gerrit.zephyrproject.org/r/4879 : unified: change signature of k_sem_reset()
- https://gerrit.zephyrproject.org/r/4868 : unified: Add tickless idle support for x86
- https://gerrit.zephyrproject.org/r/4865 : unified: Remove #if 0 code block from wait_q.h
- https://gerrit.zephyrproject.org/r/4866 : unified: Remove unused _nano_get_earliest_deadline()
- https://gerrit.zephyrproject.org/r/4867 : unified: Eliminate useless check in idle thread
- https://gerrit.zephyrproject.org/r/4864 : unified: Remove obsolete wait_q.h macros
- https://gerrit.zephyrproject.org/r/4862 : unified: Replace _nano_get_earliest_deadline()
- https://gerrit.zephyrproject.org/r/4863 : unified: Remove references to obsolete task_timeout
- https://gerrit.zephyrproject.org/r/4872 : DO NOT MERGE: k_poll: asynchronous I/O framework
- https://gerrit.zephyrproject.org/r/4354 : ztest: Add documentation
- https://gerrit.zephyrproject.org/r/4355 : ztest: Add simple integration and unit tests
- https://gerrit.zephyrproject.org/r/4870 : unified: Make test_pend unified capable.
- https://gerrit.zephyrproject.org/r/4357 : tests: Add a sample for testing natively
- https://gerrit.zephyrproject.org/r/4450 : tests: Add gcov support
- https://gerrit.zephyrproject.org/r/4356 : tests: convert tests/net/buf to the new framework
- https://gerrit.zephyrproject.org/r/4353 : ztest: Add native building support
- https://gerrit.zephyrproject.org/r/4869 : unified: Add legacy task_offload_to_fiber() routine
- https://gerrit.zephyrproject.org/r/4118 : tests: Add a generic testing framework
- https://gerrit.zephyrproject.org/r/4880 : nano_work: Add nano_work_pending
- https://gerrit.zephyrproject.org/r/4881 : nano_work: Don't assert if work is pending on submit

MERGED within last 24 hours:
- https://gerrit.zephyrproject.org/r/4909 : net: tests: Add initial set of IPv6 tests
- https://gerrit.zephyrproject.org/r/4888 : net: Set uIP context on newly allocated buffers immediately.
- https://gerrit.zephyrproject.org/r/4902 : net: tests: Increase the timeout of trickle tests
- https://gerrit.zephyrproject.org/r/4885 : net: yaip: ieee802154: Auto ACK and CRC are always on
- https://gerrit.zephyrproject.org/r/4886 : samples: quark_se_devboard has been renamed to quark_se_c1000_devboard
- https://gerrit.zephyrproject.org/r/4815 : tests/zoap: Add simple test for retransmission
- https://gerrit.zephyrproject.org/r/4814 : iot/zoap: Fix retrieving the token for every reply
- https://gerrit.zephyrproject.org/r/4813 : iot/zoap: Fix subtly wrong indentation
- https://gerrit.zephyrproject.org/r/4463 : power_mgmt: Update Power Management device driver API
- https://gerrit.zephyrproject.org/r/4704 : power_mgmt: Update sample and drivers according to new pm device API
- https://gerrit.zephyrproject.org/r/4705 : power_mgmt: Mark old device pm API functions as deprecated
- https://gerrit.zephyrproject.org/r/4821 : drivers: gpio: reuse gpio Kconfigs for sensor subsystem
- https://gerrit.zephyrproject.org/r/4859 : drivers: timer: cortex_m_systick remove dead code
- https://gerrit.zephyrproject.org/r/4873 : doc: add zoap.h to doxygen input
- https://gerrit.zephyrproject.org/r/4852 : Bluetooth: Controller: Use net_buf for HCI RX
- https://gerrit.zephyrproject.org/r/4857 : drivers: timer: loapic remove unused workaround


Re: Porting to ARM Cortex-M7 / Atmel SAM E70 support

Piotr Mienkowski <piotr.mienkowski@...>
 

Are there different ASFs per SoC or does Atmel release a single one for all their SoCs?
Atmel releases ASF as one single zip file providing support for all its products: AVR32 and SAM SoCs. After unpacking that's a bit more than 1.5GB of data. Additionally for some families, e.g. SAM E70 there are extra software packages.

Let’s merge these files down and use some #ifdef’s in just memory_map.h. I’ve submitted a
patch to start that process:
Thanks for the patch!


Re: Main thread (and stack) isn't the (only) main

Benjamin Walsh <benjamin.walsh@...>
 

Hi Paul,

This post is probably should be treated as user feedback in
justification of unified kernel *and* getting rid of .mdef files
https://lists.zephyrproject.org/archives/list/devel(a)lists.zephyrproject.org/thread/P3JQWLBJPZ37NDAXRV54DRXMXSEM35CK/#P3JQWLBJPZ37NDAXRV54DRXMXSEM35CK

So, I started a port of a scripting language (MicroPython), initially
low-profile, starting with nanonkernel. Knowing that a scripting
language would require extended stack space, I bumped
CONFIG_MAIN_STACK_SIZE to 4K. Proceeding to add networking
capabilities, I switched to microkernel (as nanokernel demonstrated
some weird behavior). Now I understand that's where problem spot was -
CONFIG_MAIN_STACK_SIZE appear to apply (mostly) to nanokernel. But I
would need to be very proficient in Zephyr to know that beforehand.
Because description of that option is:

config MAIN_STACK_SIZE
int
prompt "Background task stack size (in bytes)"
default 1024
help
This option specifies the size of the stack used by the kernel's
background task, whose entry point is main().

So, no clear warning that it applies only to nanokernel's main() and
not microkernel main().
There is a historical reason for this, that is no longer valid: main(),
in the microkernel, used to be the kernel's entry point, and not a
possible task's entry point. The main() function used to do some kernel
initialization, and when done, turn into the idle task. All of this is
still true, except the fact that the function is not main() anymore, but
_main(). :-)

Going next, I enabled mbedTLS, and that's when I started to get
mysterious crashes - connecting to some sites, but not the others.
Clearly looked like stack related, so I bumped CONFIG_MAIN_STACK_SIZE
to 16K, and as that didn't help, network RX and TX threads. That
didn't help still, I tried to reach for GDB
(https://lists.zephyrproject.org/archives/list/devel(a)lists.zephyrproject.org/thread/TOEAZ6AM7JNIZMR4IUZG5SKQGHTBRDVC/),
that didn't help, so I resorted to printf(), and confirmed that a
stack was smashed when I got a crash. The only mystery was why it
keeps being smashed while I kept increasing it. And reaching to a .map
What you ended doing was bumping the stack of the init/idle task.

file, I saw that besides "main_task_stack", which was 16K as I set it,
there's some "__MAIN_stack" with a lowy 4K, and smashing occurs inside
it.

It took just a grep over entire tree to figure out that "MAIN" stack
comes from an .mdef file (which I of course just copy-pasted) and bump
it to have the issue resolved.


So, this is clearly a user error, but the whole matter is pretty
confusing, as I experienced first-hand. There're some things which could
be improved, like wording of nanokernel/MAIN_STACK_SIZE and perhaps var
naming (if it's *default task*, maybe its stack should be
default_task_stack).
The __MAIN_stack symbol is generated based on the name of the task in
the mdef file. You don't have to have a task with a main() entry point.
There is nothing special about main() in the microkernel. In fact, as
noted before, that symbol used to be reserved for the kernel. There is
no default task in the microkernel.

But of course, even better would be to switch to unified kernel and get
rid of multiple ways to specify app params (I'm talking about .mdef).
Yup. MDEF files are only kept in the unified kernel for legacy reasosn,
for one or two releases. We will not publicize them and should in fact
have a note against using them.

Basically, all the issues you faced here are taken care of in the
unified kernel.

So, my firm +1 on that. And grepping thru the tree, I see that
unified/ has its own Kconfig with MAIN_STACK_SIZE description
updated. Is it ready for testing by "end users"? Does it have .mdef
eliminated?
See above.

API-wise, I think we are pretty much on par with the microkernel, with a
couple of obscure ones missing and/or in review.

Regards,
Ben

6641 - 6660 of 8206