Re: [RFC] Assign driver_api at compile/link time
Jason Rotella <jrotella@...>
Hi Daniel,
toggle quoted messageShow quoted text
Are there plans for Zephyr OS to run on STM32F401 (Nucleo-64) boards? Thanks, Jason
On Apr 12, 2016, at 6:37 PM, Daniel Leung <daniel.leung(a)intel.com> wrote:
|
|
[RFC] Assign driver_api at compile/link time
Daniel Leung <daniel.leung@...>
Problem Statement:
Shrink binary size by doing driver_api assignment at compile/link time. Problem Description: For some drivers, the assignment of driver_api is unconditionally done. This is especially true for drivers that will never fail initialization, hence there is no need to set NULL. Therefore, the assignment of driver_api can be statically done at compile/link time, and skips the code to do the assignment at runtime. Proposal: To achieve this, a new API is proposed to do the extra work of assignment when the driver instance is declared. The current mechanism of declaring a driver instance (via DEVICE_INIT()) remains the same, which still requires the driver init function to do the assignment. The code can be seen at [1]. The changes to the pinmux/dev drivers can be seen at [2], where similar changes can be applied to other drivers. Here is the results from sanitycheck after [2]: galileo : tests/drivers/pinmux/test_pinmux_dev ram_size -10, is now 33255 -0.03% rom_size -10, is now 27075 -0.04% quark_se_devboard : tests/drivers/pinmux/test_pinmux_dev rom_size -7, is now 13278 -0.05% arduino_due : tests/drivers/pinmux/test_pinmux_dev rom_size -8, is now 5732 -0.14% stm32_mini_a15 : tests/drivers/pinmux/test_pinmux_dev rom_size -8, is now 7712 -0.10% frdm_k64f : tests/drivers/pinmux/test_pinmux_dev rom_size -8, is now 7992 -0.10% nucleo_f103rb : tests/drivers/pinmux/test_pinmux_dev rom_size -8, is now 7696 -0.10% arduino_101 : tests/drivers/pinmux/test_pinmux_dev rom_size -7, is now 13291 -0.05% quark_d2000_crb : tests/drivers/pinmux/test_pinmux_dev rom_size -7, is now 5219 -0.13% [1] https://gerrit.zephyrproject.org/r/1367 [2] https://gerrit.zephyrproject.org/r/1368
|
|
Re: RFC: Timer/Timeout API
Dmitriy Korovkin
On Tue, 12 Apr 2016, Luiz Augusto von Dentz wrote:
Hi Dmitriy,In other words, the idea of several fibers does not work for you, I see. Ok, now it gets clearer. You are asking for a nanokernel timer API thatI never said we want the ability for multiple fibers to wait on oneWith this in mind Id like to get some opinions regarding the design ofDepends on what is needed. If this is a global change (apility for multiple executes a registered callback when it expires. I do not think it is a good idea to execute callbacks in ISR context, which brings us to an idea of a fiber that executes these callbacks. Is this what you are asking for? For this we need to make sure that a fiber can sleep on multiple timers. The stack size for this fiber should be configurable. Does it look good? Regards, /Dmitriy.
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Benjamin Walsh <benjamin.walsh@...>
On Tue, Apr 12, 2016 at 08:58:34PM +0000, Boie, Andrew P wrote:
I don't remember exactly. One of the them was some renaming of eitherI already got feedback from people developing either drivers or sample pinmux or gpio functions/structures.
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Boie, Andrew P
I already got feedback from people developing either drivers or sample I'm not advocating anything w.r.t. a policiy for changing APIs rightI think we shouldn't change our existing APIs at all. They should be treated as a contract. Someone who builds code against 1.0 should be able to do so against later versions until we make a conscious decision otherwise. I think if we want to change something, we mark the old APIs with __attribute__((deprecated)) so that it's clear that the old API is going away at some point by generating a warning. But they should still be *usable*. Then, in the fullness of time, remove the APIs that were previously deprecated. Whether that is Zephyr 1.5, 2.0, doesn't matter to me. VxWorks), they did _not_ like the fact that even a small amount of ourWhat specifically changed that caused consternation? Andrew
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Thomas, Ramesh
On Tue, Apr 12, 2016 at 10:27:20, Leung, Daniel wrote:
On Tue, Apr 12, 2016 at 09:07:00AM +0200, Tomasz Bursztyka wrote:I see. So the method in the RFC is to assist in diagnosis or notification of criticalHi Ramesh,of returns errors.
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Benjamin Walsh <benjamin.walsh@...>
On Tue, Apr 12, 2016 at 10:22:21AM -0700, Daniel Leung wrote:
On Tue, Apr 12, 2016 at 10:22:13AM -0400, Benjamin Walsh wrote:Changing APIs.On Tue, Apr 12, 2016 at 09:12:19AM +0200, Tomasz Bursztyka wrote:Is this only about changing the APIs (like adding parameters, etc)?Hi Daniel and Anas,I already got feedback from people developing either drivers or sampleSaving even a minimal amount of bytes is good to consider, as longand all the existing drivers in one go as well.The init change will be in another RFC. I am testing locally to see how much
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Daniel Leung <daniel.leung@...>
On Tue, Apr 12, 2016 at 09:07:00AM +0200, Tomasz Bursztyka wrote:
Hi Ramesh,Ramesh, in a production release, there should not be any non-critical errors at device initialization (hence "production"). In a production environment, the null-returning can be used as a mechanism to signify a major problem, for example, a peripheral breaks down in the field. Notification then can be made to replace the faulty hardware, if so desired. ---------- Daniel Leung
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Daniel Leung <daniel.leung@...>
On Tue, Apr 12, 2016 at 10:22:13AM -0400, Benjamin Walsh wrote:
On Tue, Apr 12, 2016 at 09:12:19AM +0200, Tomasz Bursztyka wrote:Is this only about changing the APIs (like adding parameters, etc)?Hi Daniel and Anas,I already got feedback from people developing either drivers or sampleSaving even a minimal amount of bytes is good to consider, as longand all the existing drivers in one go as well.The init change will be in another RFC. I am testing locally to see how much How about adding APIs (but still keep the existing API unmodified)? ---------- Daniel Leung
|
|
Zephyr environment maintenance Sat, Apr 16, 0800 - 1000 PDT
Andrew Grimberg <agrimberg@...>
When: Saturday, April 16, 8AM - 10AM PDT (15:00-17:00 UTC)
What: Zephyr environment Why: OS security updates and reboots Impact Services will be unavailable briefly as the systems are rebooted. Jenkins will be paused to avoid having jobs fail due to missing resources prior to the outage. NOTE: Since upgrading to Gerrit 2.12.x Gerrit now takes a significant amount of time to restart (anywhere form 5 - 20 minutes). If you have any concerns, please contact helpdesk(a)zephyrproject.org A notice will be sent out prior too and again after the maintenance as well as a note in #zephyrproject on Freenode -- Andrew J Grimberg Systems Administrator The Linux Foundation
|
|
Daily JIRA Digest
donotreply@...
NEW JIRA items within last 24 hours: 4
[ZEP-190] Failed to receive loopback packet. https://jira.zephyrproject.org/browse/ZEP-190 [ZEP-187] BLE APIs are not documented https://jira.zephyrproject.org/browse/ZEP-187 [ZEP-188] IPStack/6LoWPAN/15.4 APIs are not documented https://jira.zephyrproject.org/browse/ZEP-188 [ZEP-189] PINMUX QMSI shim api pinmux_pin_get is not implemented https://jira.zephyrproject.org/browse/ZEP-189 UPDATED JIRA items within last 24 hours: 2 [ZEP-53] enable kernel_event_logger on ARC https://jira.zephyrproject.org/browse/ZEP-53 [ZEP-177] Windows build with MinGW https://jira.zephyrproject.org/browse/ZEP-177 CLOSED JIRA items within last 24 hours: 0 RESOLVED JIRA items within last 24 hours: 0
|
|
Daily Gerrit Digest
donotreply@...
NEW within last 24 hours:
- https://gerrit.zephyrproject.org/r/1360 : sensor: fix init driver_api - https://gerrit.zephyrproject.org/r/1357 : sensors: use SENSOR_G constant in all accelerometer drivers - https://gerrit.zephyrproject.org/r/1358 : sensors: bma280: fix slope threshold measurement unit - https://gerrit.zephyrproject.org/r/1345 : docs: Getting Started overhaul - https://gerrit.zephyrproject.org/r/1347 : doc: remove usage of sudo and reduce notes - https://gerrit.zephyrproject.org/r/1346 : doc: remove networking configuration section - https://gerrit.zephyrproject.org/r/1356 : drivers/nble: Fix spelling typo - https://gerrit.zephyrproject.org/r/1353 : samples: Using new GPIO API callbacks - https://gerrit.zephyrproject.org/r/1354 : cc2520: Using new GPIO API callbacks - https://gerrit.zephyrproject.org/r/1350 : samples: Use consistent file naming for project config file UPDATED within last 24 hours: - https://gerrit.zephyrproject.org/r/1278 : sensor: fix coding style (bmc150 and lsm9ds0) - https://gerrit.zephyrproject.org/r/1340 : sensor: add the posibility to fetch one data type - https://gerrit.zephyrproject.org/r/1303 : sensors: add driver for TMP007 infrared thermopile sensor - https://gerrit.zephyrproject.org/r/1271 : sensors: Using new GPIO API callbacks - https://gerrit.zephyrproject.org/r/1341 : sensor: add driver for LSM9DS0 accel and magn - https://gerrit.zephyrproject.org/r/1327 : doc: fix wording in device documentation - https://gerrit.zephyrproject.org/r/1323 : docs: remove notes from bluetooth document - https://gerrit.zephyrproject.org/r/1328 : doc: make naming conventions apply to none kernel functions - https://gerrit.zephyrproject.org/r/1322 : doc: Fixed structure in collab guide - https://gerrit.zephyrproject.org/r/1321 : doc: create subsystem section - https://gerrit.zephyrproject.org/r/1320 : doc: move device driver to a new section - https://gerrit.zephyrproject.org/r/1257 : 802.15.4/cc2520: move driver_api assignment later - https://gerrit.zephyrproject.org/r/1201 : Bluetooth: tester: Add support for seqence gatt database - https://gerrit.zephyrproject.org/r/1200 : Bluetooth: tester: Update server commands with sequence params - https://gerrit.zephyrproject.org/r/1202 : Bluetooth: tester: Return pre defined db offset on start server - https://gerrit.zephyrproject.org/r/914 : gpio: Improve the public API to handle multi callbacks - https://gerrit.zephyrproject.org/r/1307 : net: contiki: Enable 802.15.4 auto-ack for null RDC - https://gerrit.zephyrproject.org/r/999 : Bluetooth: BR/EDR: Initiate encryption on link - https://gerrit.zephyrproject.org/r/998 : Bluetooth: BR/EDR: Initiate authentication - https://gerrit.zephyrproject.org/r/1034 : Bluetooth: BR/EDR: Notify about pairing while JustWorks - https://gerrit.zephyrproject.org/r/1325 : power_mgmt: Provide APIs for devices to signal busy to PM policy mgr - https://gerrit.zephyrproject.org/r/1221 : new SoC naming convention - https://gerrit.zephyrproject.org/r/1135 : boards: nucleo: Adding flash support - https://gerrit.zephyrproject.org/r/1326 : power_mgmt: Sample usage of device_xxx__busy() APIs - https://gerrit.zephyrproject.org/r/1217 : stm32: reorganise soc directory and use family/series - https://gerrit.zephyrproject.org/r/1219 : soc: introduce SoC families and series - https://gerrit.zephyrproject.org/r/1214 : stm32: rename CONFIG_SOC_STM32 -> CONFIG_SOC_FAMILY_STM32 - https://gerrit.zephyrproject.org/r/1215 : stm32: rename SOC_STM32F1X -> SOC_SERIES_STM32F1X - https://gerrit.zephyrproject.org/r/1263 : build: support icx llvm compiler - https://gerrit.zephyrproject.org/r/1342 : cc2520: Enable hardware filtering all the time - https://gerrit.zephyrproject.org/r/1305 : cc2520: Set short address and ieee address from the driver - https://gerrit.zephyrproject.org/r/1306 : cc2520: Make AUTOACK working MERGED within last 24 hours: - https://gerrit.zephyrproject.org/r/1359 : cc2520: Make the generated MAC address to look more random - https://gerrit.zephyrproject.org/r/1344 : net: fix uip_udp_conn leak - https://gerrit.zephyrproject.org/r/1349 : build: Add a toolchain file for the GCC ARM Embedded toolchain - https://gerrit.zephyrproject.org/r/1348 : sanitycheck: align output for easier visual comparison - https://gerrit.zephyrproject.org/r/1355 : Bluetooth: drivers/nble: Fix minor coding style issue - https://gerrit.zephyrproject.org/r/1352 : drivers/nble: Implement multiple read in bt_gatt_read - https://gerrit.zephyrproject.org/r/1351 : drivers/nble: Update RPC to Nordic BLE Module - https://gerrit.zephyrproject.org/r/1262 : serial/uart.h: no need to check driver_api being NULL - https://gerrit.zephyrproject.org/r/1259 : uart/nsim: fixed missing driver_api assignment - https://gerrit.zephyrproject.org/r/1258 : gpio/pcal_9535a: move driver_api assignment later - https://gerrit.zephyrproject.org/r/1329 : openocd: make openocd variables overridable from env - https://gerrit.zephyrproject.org/r/1261 : device_get_binding() returns NULL if driver_api is not set - https://gerrit.zephyrproject.org/r/1260 : spi/intel: move driver_api assignment later - https://gerrit.zephyrproject.org/r/1256 : pwm/pca_9685: move driver_api assignment later - https://gerrit.zephyrproject.org/r/1313 : samples: A test app for spi flash - https://gerrit.zephyrproject.org/r/1337 : gpio: dw: Activate by default on D2000 - https://gerrit.zephyrproject.org/r/1316 : nano_fifo: Fix problem with nano_fifo and timeouts - https://gerrit.zephyrproject.org/r/997 : Bluetooth: BR/EDR: Move up code in conn.c - https://gerrit.zephyrproject.org/r/1339 : Revert "Bluetooth: Fix compare logic in ATT read rsp" - https://gerrit.zephyrproject.org/r/1338 : drivers/nble: Correct auth configuration for No Input / Output
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Tomasz Bursztyka
Hi Benjamin,
Thus why we may enforce a version of the API vs a Zephyr version. AndI already got feedback from people developing either drivers or sampleHow long are we supposed to support this API 1.0? Can't we drop someIMO the driver interface is still considered public APIs.AFAIK, the device init interface is not API from my understanding. Application move on with a new one. If they want to get stuck with API 1.0 they could use Zephyr 1.2 (1.3 maybe) and that's it. Our APIs are, on many aspects, like prototype APIs. It's not surprising we are willing to modify them, and some quite a lot actually. Also: we may keep the public API compatible, but the device driver API below might change. Unless we want to bloat our drivers. Tomasz
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Benjamin Walsh <benjamin.walsh@...>
On Tue, Apr 12, 2016 at 09:12:19AM +0200, Tomasz Bursztyka wrote:
Hi Daniel and Anas,I already got feedback from people developing either drivers or sampleSaving even a minimal amount of bytes is good to consider, as longand all the existing drivers in one go as well.The init change will be in another RFC. I am testing locally to see how much application for Rocket, basically playing to role of customers of Zephyr, and I can already say that, for people used to writing software against APIs that experience a very minimal amount of changes (i.e. VxWorks), they did _not_ like the fact that even a small amount of our APIs is in flux. It basically causes lost time and frustration. I'm not advocating anything w.r.t. a policiy for changing APIs right now, but this is a data point.
|
|
Re: RFC: Timer/Timeout API
Luiz Augusto von Dentz
Hi Dmitriy,
On Mon, Apr 11, 2016 at 9:32 PM, Dmitriy Korovkin <dmitriy.korovkin(a)windriver.com> wrote: On Fri, 8 Apr 2016, Luiz Augusto von Dentz wrote:By kernel I guess you mean that each fiber has a capability to runHi,I am not quite sure I understand the problem. Kernel keeps the track of timers, which is not useful in case of net subsystem since that requires each and every timeout to have a dedicated stack. I never said we want the ability for multiple fibers to wait on oneWith this in mind Id like to get some opinions regarding the design ofDepends on what is needed. If this is a global change (apility for multiple timer, it is actually the opposite that we are doing in IP since there is a single fiber managing multiple nano_timers calling a callback when they expire. Anyway I starting to think we would be better off prototyping this under net so we get the ball rolling. As I understand the kernel has APIs to put a fiber/task to sleep for- Perhaps have the API flexible enough so private fiber could be usedAs the kernel keeps track of the timers, there may be something else is an x amount of ticks, blocking them, it doesn't have any API that the user provide a callback which gets called when the timer expire without blocking or requiring a new fiber for each call. -- Luiz Augusto von Dentz
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Tomasz Bursztyka
Hi Daniel and Anas,
Saving even a minimal amount of bytes is good to consider, as long as itand all the existing drivers in one go as well.The init change will be in another RFC. I am testing locally to see how much does not reduce features etc... and that RFC is actually fixing things. How long are we supposed to support this API 1.0? Can't we drop some ofAFAIK, the device init interface is not API from my understanding. ApplicationIMO the driver interface is still considered public APIs. its specifics in, let's say, 1.5? The more we will have to support all of it, the less we will be able to proceed on some interesting changes. :( Tomasz
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Tomasz Bursztyka
Hi Ramesh,
The idea is to let the driver decide whether it is still functioning or not.Not sure how the method in the RFC differentiates between critical andThe idea was that the kernel could not really do Unusable state is a critical error to me. A non critical error, means it is still ok to work, thus the driver API will be set. If the driver stops at non-critical error and do not set the API, it's not really a non-critical error then. (or it's a bug) I don't see much trouble with that. Up to drivers to decide And anyway, in 99.9% of the drivers: there will be critical errors only I guess (unable to get a device binding, to configure some register...). Tomasz
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Thomas, Ramesh
On Mon, 2016-04-11 at 09:23 -0700, Daniel Leung wrote:
On Mon, Apr 11, 2016 at 09:37:25AM +0200, Tomasz Bursztyka wrote:Not sure how the method in the RFC differentiates between critical andHi Daniel,You can follow the link and go to the top message. The idea was first proposed byOk I missed that discussion.The original discussion was actually started about getting rid of returns ofAnd that reminds me, that most of our drivers do not set driver API toGood point Tomasz. Might need to be part of the RFC patch that Daniel posted.NULL if they fail. non-critical errors. Isn't the driver also *not* passing on the non-critical error status to the app by not setting device_api = NULL in those cases? Then how will the app know that it needs to do something to correct such non-critical errors? If this is merely a way to indicate that the driver is in an unusable error state, then how is it different from critical error? - which is not expected to happen in production releases. The init change will be in another RFC. I am testing locally to see how muchreally care).Your RFC patch was not clear about that. It would require to change the
|
|
Re: [RFC] Device: device_get_binding() returns NULL if device fails initialization
Nashif, Anas
Hi
On 12/04/2016, 00:23, "Daniel Leung" <daniel.leung(a)intel.com> wrote: IMO the driver interface is still considered public APIs.and all the existing drivers in one go as well.The init change will be in another RFC. I am testing locally to see how much Someone might be using those to write drivers external to Zephyr, changing the signatures will break such drivers. Anas
|
|
Re: state of development and participation
Maureen Helm
toggle quoted messageShow quoted text
-----Original Message-----NXP is a founding member of the Zephyr project, so yes we will definitely continue working on it. We're still in the early stages though and will be ramping up in the coming months. What APIs are you most interested in using with the K64?Otherwise I'd like start to develop a little more for my K64, butI'd encourage you to submit such patches. The APIs should no longer be
|
|