Commit graph

41120 commits

Author SHA1 Message Date
Aurelien Jarno
7f334c84d6 usb: cdc_acm: call the IRQ callback from the system work queue
The IRQ callback function of the USB CDC ACM driver can currently be
called from:
- the USB thread when a bulk in or a bulk out interrupt has been
  triggered
- the thread calling cdc_acm_irq_rx_enable or cdc_acm_irq_tx_enable when
  enabling the interrupt fires an irq (ie if there is data to read or if
  there is no pending data to send)

This causes some issues with at least the shell uart backend, as the
IRQ callback function ends up being called twice concurrently in case a
USB driver sends the requested data almost instantaneously. This is the
case for example of the USB nRF driver which uses DMA. In turn this
cause ring_buf_item_get to be called concurrently, leading to data
corruption:

  uart:~$ help
  Please press the <Tab> button to see all available commandands.
  You can also use the e <Tab> button to prompt or auto-coomplelete all
  commands or its subcommands.
  You can try toto call commands with <-h> or <--help> parameter for
  more informatation.
  uart:~$

Fix that by always calling the IRQ callback function through the system
work queue.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-09 07:47:43 -06:00
Andrzej Puzdrowski
493ae365a8 settings: fix value-len-get while base64 is enabled
While base64 encoding was enabled settings_val_get_len_cb() returned
encoded length instead of decoded value length.

This patches introduce procedure which calculates the value length
properly. For that additional read of the end of the encoded value is
required for checking how many form last 3 value bytes wear encoded.

fixes #12122

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-01-09 08:40:00 -05:00
Martin Gysel
4e23d6c875 doc: boards: arm: nrf52840_pca10059: fix name of dts file to include
dts file to include is named 'fstab-debugger' not 'fstab-segger'

Signed-off-by: Martin Gysel <me@bearsh.org>
2019-01-09 10:28:42 +01:00
Piotr Mienkowski
aa2c27d007 soc: silabs_exx32: Add independent Kconfig options for HAL libraries
Zephyr gecko drivers depend on libraries provided by the vendor. The
same libraries may also be used directly by the application code or
RAIL library. To facilitate the latter use case scenario this commit
adds Kconfig options to independently enable compilation of vendor
HAL library modules.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-01-08 13:31:42 -06:00
Piotr Mienkowski
f17e7c5942 drivers: i2c: add missing I2C_GECKO Kconfig option
This commit adds missing I2C_GECKO Kconfig option which currently is
being set implicitly via .defconfig file.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-01-08 13:31:42 -06:00
Ashokkumar B
3c00d955f3 drivers: gpio: Add DTS support for Stellaris gpio driver.
* Add DTS support for gpio controller driver

Signed-off-by: Ashokkumar B <ashokkumar@zilogic.com>
Signed-off-by: Subash G <subash@zilogic.com>
Signed-off-by: Vishnu K <vishnu@zilogic.com>
Signed-off-by: Vaishnavi D <vaishnavi.d@zilogic.com>
2019-01-08 13:30:26 -06:00
Ashokkumar B
2b0507ce14 drivers: gpio: Add support for Stellaris gpio controller driver.
* Add support for gpio controller driver

Signed-off-by: Ashokkumar B <ashokkumar@zilogic.com>
Signed-off-by: Subash G <subash@zilogic.com>
Signed-off-by: Vishnu K <vishnu@zilogic.com>
Signed-off-by: Vaishnavi D <vaishnavi.d@zilogic.com>
2019-01-08 13:30:26 -06:00
Piotr Mienkowski
973af2c8d7 dts: silabs: use 'aliases' to remove dts_fixup defines
By adding 'aliases' node in SoC .dtsi file it is possible to generate
DT_ defines which specify a logical name rather than relay on module
location on APB bus. E.g. DT_SILABS_GECKO_USART_40010000_LABEL becomes
DT_SILABS_GECKO_USART_USART_0_LABEL. Thus it is possible to remove
dts_fixup.h defines.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-01-08 11:56:02 -06:00
Alberto Escolar Piedras
aefc072afb nrf52_bsim: Improve compile time check of HW models version
In 4940a3cac2 a compile time
check of the HW model version was added. This check worked
fine for cases in which the problem was that people had not
fetched a new enough version of the HW models.
But in some cases people will have fetched a new enough version
but be (unknowingly) in a past detached HEAD (or old tag).

With this change we ensure that the required tag is an actual
ancestor for the current HW models version HEAD

Also fail with an error, instead of just printing a warning.
Users can still disable this warning if they know what they are
doing.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-08 10:59:57 -05:00
Piotr Mienkowski
1bfc52b81b drivers: i2c: remove deprecated i2c_atmel_sam3 driver
The i2c_atmel_sam3 driver was deprecated at release 1.9, this commit
removes it. Also pinmux_dev_atmel_sam3x driver is removed.
i2c_atmel_sam3 was the last one which depended on it.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-01-08 09:23:17 -06:00
Armando Visconti
f300dedcc1 drivers/sensor/lsm6dsl: Use DT defines to select I2C/SPI bus
Remove configuration parameter CONFIG_BUS_TYPE. Now we may
make use of DT_ST_LSM6DSL_BUS_I2C and DT_ST_LSM6DSL_BUS_SPI
definition to select the bus.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-08 09:15:51 -06:00
Flavio Ceolin
d1ed336b9b kernel: Do not use zero-length array
Zero length array is a GNU extension that works as an header for a
variable length object. The portable solution for this is using
flexible length array, but this can be used only in the end of a
struct declaration and this is violates MISRA-C rule 18.8.

The easiest way to rif of this is make the macro expand to nothing but
then we will have a trailing semicolon that is not allowed in C99. So
the macro was changed to automatically add the semicolon when needed.
This may break code identation in some editors but it is a fair price
to pay to have portability and compliance.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-08 09:58:24 -05:00
Loic Poulain
c9a9e0a4ee drivers: wifi: eswifi: Fix coverity issues
This patch fixes the following issues:
CID 190622 (#1 of 1): Out-of-bounds access (OVERRUN)
CID 190632 (#1 of 1): Out-of-bounds access (OVERRUN)
CID 190623 (#1 of 1): Unchecked return value (CHECKED_RETURN)
CID 190628 (#1 of 1): Out-of-bounds write (OVERRUN)
CID 190620 (#1 of 1): Dereference after null check (FORWARD_NULL)

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-01-08 08:01:20 -05:00
Tomasz Bursztyka
b04e71901f net/icmpv4: Disable broadcast echo request reply by default
Accepting broadcast echo request and replying to it could provide an
attack vector.

Fixes #12162

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-01-08 13:42:18 +02:00
Oleg Zhurakivskyy
20ee76ab22 net: ethernet: Clean an obscure ref/unref logic in ethernet_send()
Do not extra ref and then obscurely unref the packet inside
the statistics update function.

Actually, this extra ref/unref isn't needed here at all.

The packet is unreferenced only on a successful send, statistics
updating can be done before the unref in a clean and understandable way.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2019-01-08 13:39:40 +02:00
Tomasz Bursztyka
dc9e408e22 net/ieee802154: Compute ll hdr size before 6lo compression
Or then the IP header access will be bogus afterwards.

Fixes #12154

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-01-08 13:36:14 +02:00
Jukka Rissanen
235ebd0ca0 net: gptp: Track memory allocations better
Try to catch the original caller of setup_gptp_frame() function
in order to see who is allocating buffers.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-08 13:29:18 +02:00
Jukka Rissanen
69f849235f net: pkt: Only enable debug print when really needed
The NET_LOG_LEVEL is enabled also when allocation debugging is
enabled but when net_pkt debugging is not. Thus we need to use
the CONFIG_NET_PKT_LOG_LEVEL when printing normal debug log
prints.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-08 13:29:18 +02:00
Tomasz Bursztyka
88b2535e0d drivers/ieee802154: Fix UPIPE driver at boot
Before it is initialized, upipe_dev is not set. Fixes this issue:

SeaBIOS (version rel-1.11.2-0-gf9626ccb91-prebuilt.qemu-project.org)
Booting from ROM..***** CPU Page Fault (error code 0x00000000)
Supervisor thread read address 0x00000008
PDE: 0x025 Present, Read-only, User, Execute Enabled
PTE: 0x00 Non-present, Read-only, Supervisor, Execute Enabled
Current thread ID = 0x00401a40
eax: 0x00000000, ebx: 0x0040c668, ecx: 0x00000001, edx: 0x000002f8
esi: 0x0040ac5b, edi: 0x0040ac38, ebp: 0x0040b4a8, esp: 0x0040b498
eflags: 0x00000202 cs: 0x0008
call trace:
eip: 0x00008651
     0x000082a3 (0x400a8d)
     0x00008b12 (0x40c668)
     0x00008632

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-01-08 11:25:33 +02:00
Tomasz Bursztyka
05368dc16c cmake: Enable server/client rules in case of 802.15.4 UPIPE driver
Networking apps may require these rules (as echo apps) even on
non-Ethernet based configuration.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-01-08 11:25:33 +02:00
Tomasz Bursztyka
fc3f090ab8 samples/sockets: Enable 802.15.4 properly for echo apps
These were still running through Ethernet using generic
overlay-802154.conf thus creating a dedicated one.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-01-08 11:25:33 +02:00
Paul Sokolovsky
c922ce6ce4 tests: net_pkt: More net_frag_linearize tests
Add tests for "can return less data than requested" behavior.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-08 11:06:56 +02:00
Paul Sokolovsky
3329eb2c4e net: pkt: net_frag_linearize: Make consistent with net_buf_linearize
net_frag_linearize() is just a wrapper for net_buf_linearize(). As
the latter was refactored to never return error, and instead just
return actual copied length, update the former and its usages too.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-08 11:06:56 +02:00
Paul Sokolovsky
71e2e31a76 net: buf: linearize: Never return -ENOMEM, just do what user asked to
Don't try to find "errors" in the values of dst_len and len params
passed to net_buf_linearize(). Instead, do what entails with the
common sense from the values passed in, specifically:

1. Never read more than dst_len (or it would lead to buffer
overflow).
2. It's absolutely ok to read than specified by "len" param, that's
why this function returns number of bytes read in the first place.

The motivation for this change is that it's not useful with its
current behavior. For example, a number of Ethernet drivers linearize
a packet to send, but each does it with its own duplicated adhoc
routine, because net_buf_linearize() would just return error for the
natural use of:

net_buf_linearize(buf, sizeof(buf), pkt->frags, 0, sizeof(buf));

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-08 11:06:56 +02:00
Jan Van Winkel
188643e054 CODEOWNERS: Added code owner for GUI related code
Added myself as code owner for GUI related code (lib/gui &
samples/gui)

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-07 18:17:00 -05:00
Sathish Kuttan
108ca81a17 samples: intel_s1000_crb: add doc for dmic sample
Add short documentation on sample app for DMIC driver usage
on Intel S1000 CRB.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00
Sathish Kuttan
6292a2fc3b samples: intel_s1000_crb: set BOARD for dmic sample
Set BOARD variable in CMakeLists.txt for DMIC Sample App
Since this sample app is for intel_s1000_crb, setting BOARD
in CMakeLists.txt will eliminate the need to specify in
cmake command line every time during build.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00
Sathish Kuttan
4e6728eb3e samples: intel_s1000_crb: add DMIC sample app
Add a sample application to demonstrate usage of digital microphones
in an Intel S1000 CRB

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00
Sathish Kuttan
c3da9238f1 soc: intel_s1000: add DMIC power control
Add DMIC power on to SoC init sequence

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00
Frank Li
978bdf0d5d net: shell: Fix cmd_net_http_monitor build error
No declar 'count',Enable CONFIG_NET_DEBUG_HTTP_CONN will build error.

Using http_monitor_count replace count.

Fixed #12329

Signed-off-by: Frank Li <lgl88911@163.com>
2019-01-07 16:24:32 -05:00
Olivier Martin
7031d5bdda drivers: flash: w25qxxdv: write across programming pages
Until now spi_flash_wb_write/read functions were only supporting
buffers that fit into a W25Q page (even if there were not checking
the offset was page aligned).
This change allows these function to read/write multiple W25Q page.
This change is required as the caller of these functions are not
aware of flash page size.

Signed-off-by: Johannes Hutter <johannes@proglove.de>
Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
Signed-off-by: Michael Wendland <michael@proglove.de>
2019-01-07 16:09:04 -05:00
Olivier Martin
4bc4bbf350 drivers: flash: w25q: Allow to skip SYNC_LOCK/SYNC_UNLOCK
The next commit will use this new
spi_flash_wb_write_protection_set_with_lock() in
spi_flash_wb_write() that already hold the lock.
To prevent a lock we need to skip the SYNC_LOCK when we want
to disable write protection.

Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
2019-01-07 16:09:04 -05:00
Frank Li
6b5906b8e9 net: shell: Fix showing ping reply
shell_fprintf() doesn't work in callback handlers.
To fix that, set shell state to SHELL_STATE_COMMAND before using it.

Fixed: #12347

Signed-off-by: Frank Li <lgl88911@163.com>
2019-01-07 16:07:31 -05:00
Jan Van Winkel
8fb4384927 dfu: Cast offset to u32_t before calling LOG
Cast offset to u32_t before printing in hexadecimal form.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-07 16:07:03 -05:00
Jan Van Winkel
81301bf4ae sample: gui: Added basic sample for lvgl library
Added a basic sample showing how to use the LittlevGL library in an
application.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-07 16:05:35 -05:00
Jan Van Winkel
cbfcae7a1f gui: Added glue logic for LittlevGL GUI library
Added glue logic to interface Zephyr with LittlevGL GUI library

This includes:
 * KConfig options for all lvgl options
 * Kernel & user space memory management
 * Zephyr to lvgl FS call mapping
 * Color space conversion function

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-07 16:05:35 -05:00
Jan Van Winkel
49ffca4553 display: Added double buffer screen info to display API
Extend display API screen info with double buffer enum entry.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-07 16:05:35 -05:00
Manivannan Sadhasivam
a26fe1e2f4 CODEOWNERS: Add myself as the code owner for 96b_stm32_sensor_mez
Add myself as the code owner for 96b_stm32_sensor_mez board.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2019-01-07 14:30:12 -06:00
Manivannan Sadhasivam
31e89b20a7 boards: arm: 96b_stm32_sensor_mez: Enable on-board PWM
Enable PWM channels exposed on 96b_stm32_sensor_mez board via
Arduino connector.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2019-01-07 14:30:12 -06:00
Manivannan Sadhasivam
3807c9af05 drivers: pinmux: stm32_f4: Add missing pinmux definitions for PWM
Add missing pinmux definitions for STM32F4 PWM.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2019-01-07 14:30:12 -06:00
Anas Nashif
5d91118672 doc: set author to the Zephyr project
replace 'many' with something more meaningful.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-07 10:31:51 -05:00
Anas Nashif
2c4b6a5307 doc: minor tweaks to documentation guidelines
Change titles and make them consistent with the rest.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-07 10:31:51 -05:00
Anas Nashif
7efe1b14b0 doc: remove ip stack migration guide
This is now outdated and obsolete.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-07 10:31:51 -05:00
Anas Nashif
1ae9b89293 doc: reloacation: shorten long lines
Some style fixes and change title.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-07 10:31:51 -05:00
Anas Nashif
276c589dc3 doc: restructure documentation
With the new theme we are able to have more section in the top level.
Move things around and expose the most important sections in the top
table of content.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-07 10:31:51 -05:00
Anas Nashif
6b22a93286 doc: remove leading 'Zephyr' for some documentation sections
This is redundant information. We already know we are Zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-07 10:31:51 -05:00
Anas Nashif
f71c2a3948 doc: net-app: Fix structure and section layout
Mark sub-sections as such, otherwise we have all sections on the same
level.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-07 10:31:51 -05:00
Alberto Escolar Piedras
ce12abd9e4 nrf52_bsim: Add support for dynamically registering cmd line args
With this change, drivers or components can register on runtime
their own command line arguments.
What this change does is to use the dynamic command line arguments
API from BabbleSim's libUtil and provides a function for the
drivers to add their own.

Note that this change requires v1.3 of the HW models (which remove
a dependency on the board command line arguments structure)

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-07 10:27:09 -05:00
Alberto Escolar Piedras
f57bc1cae0 nrf52_bsim: arg parsing: Do not use bs_args_typical_dev_post_check
This function can only be used when the arguments structure memory
layout starts as in bs_basic_dev_args_t.
This assumption is just too dangerous in this board as somebody
may change the structure in the future unaware of this weird
requirement.
=> Do not use this function but do what it does in place.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-07 10:27:09 -05:00
Alberto Escolar Piedras
592d26bb3a nrf52_bsim: arg parsing: Be more user friendly with -nosim
When the -nosim option is used the user may still want to set
either the simulation ID string (-s) or the device number (-d)
to control the tracing prefixes and/or dump folder, but may not
care to set both of them.
=> This change allows it, while the old behaviour is otherwise
maintained (setting both or none with -nosim)

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-07 10:27:09 -05:00